From ab92e92a708f6caff7879b7e486c36ceddc16f45 Mon Sep 17 00:00:00 2001 From: Colin PUY Date: Tue, 12 Jun 2018 09:01:53 +0200 Subject: [PATCH] test(layout-page): remove useless test Remove e2e test that is useless since it is ever green whatever code is tested. Also remove all protractor conf since it was the only e2e test for this page. * Remove useless test * Remove protractor and gulp configuration * Remove reslter dependency which is not compatible with recent node versions ([Github issue](https://github.com/danwrong/restler/issues/250)) * Prepare ymci integration --- resources/layout-page/gulpfile.js | 14 --- resources/layout-page/package.json | 15 +--- resources/layout-page/pom.xml | 86 ------------------- resources/layout-page/protractor.conf.js | 70 --------------- .../src/test/js/e2e/spec/layout-page.e2e.js | 73 ---------------- 5 files changed, 3 insertions(+), 255 deletions(-) delete mode 100644 resources/layout-page/gulpfile.js delete mode 100644 resources/layout-page/protractor.conf.js delete mode 100644 resources/layout-page/src/test/js/e2e/spec/layout-page.e2e.js diff --git a/resources/layout-page/gulpfile.js b/resources/layout-page/gulpfile.js deleted file mode 100644 index ea534094b..000000000 --- a/resources/layout-page/gulpfile.js +++ /dev/null @@ -1,14 +0,0 @@ -var gulp = require("gulp"); -var protractor = require("gulp-protractor").protractor; - -gulp.task("e2e", function () { - gulp.src(["./src/test/js/e2e/**/*.e2e.js"]) - .pipe(protractor({ - configFile: "protractor.conf.js" - })) - .on('error', function (e) { - console.log(e); - throw e; - }); -}); - diff --git a/resources/layout-page/package.json b/resources/layout-page/package.json index 8f5f0c3b1..21e2db35f 100644 --- a/resources/layout-page/package.json +++ b/resources/layout-page/package.json @@ -2,30 +2,21 @@ "name": "layout-page", "version": "1.0.0", "description": "layout page for a living application", - "main": "gulpfile.js", "scripts": { - "test": "karma start --single-run --config karma.conf.js", - "e2e": "gulp e2e", - "pree2e": "webdriver-manager update" + "test": "karma start --single-run --config karma.conf.js" }, "author": "julienmege", "license": "GPL", "devDependencies": { "angular-mocks": "1.3.11", - "gulp": "^3.9.0", - "gulp-protractor": "1.0.0", "jasmine-core": "2.3.4", "jasmine-reporters": "2.0.7", "karma": "1.3.0", "karma-jasmine": "1.0.2", "karma-phantomjs-launcher": "1.0.2", - "phantomjs": "2.1.7", - "protractor": "4.0.8", - "webdriver-manager": "10.2.5", - "restler": "3.1.0" + "phantomjs": "2.1.7" }, "dependencies": { - "karma": "^0.13.22", - "protractor": "4.0.8" + "karma": "^0.13.22" } } diff --git a/resources/layout-page/pom.xml b/resources/layout-page/pom.xml index f00e65d63..3c2a6bbc2 100644 --- a/resources/layout-page/pom.xml +++ b/resources/layout-page/pom.xml @@ -70,90 +70,4 @@ - - - e2e - - - - org.apache.maven.plugins - maven-dependency-plugin - 2.10 - - - copy - package - - copy - - - - - org.bonitasoft.web - ui-designer-backend-webapp - ${ui.designer.version} - jar - exec-war - ${project.build.directory}/designer - ui-designer-standalone.jar - - - - - - - - com.bazaarvoice.maven.plugins - process-exec-maven-plugin - 0.7 - - - ui-designer-process - pre-integration-test - - start - - - UiDesigner - http://localhost:8083/designer - - java - -jar - - ${basedir}/target/designer/ui-designer-standalone.jar - - -Dworkspace=${project.build.directory}/designer/repository - -httpPort=8083 - - - - - stop-all - post-integration-test - - stop-all - - - - - - com.github.eirslett - frontend-maven-plugin - - - e2e tests - - npm - - integration-test - - run e2e - - - - - - - - diff --git a/resources/layout-page/protractor.conf.js b/resources/layout-page/protractor.conf.js deleted file mode 100644 index b5ef57b20..000000000 --- a/resources/layout-page/protractor.conf.js +++ /dev/null @@ -1,70 +0,0 @@ -// A reference configuration file. -'use strict'; -exports.config = { - seleniumServerJar: './node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar', - seleniumPort: null, - //chromeDriver: './node_modules/protractor/selenium/chromedriver', - seleniumArgs: [], - chromeDriver: './node_modules/webdriver-manager/selenium/chromedriver_2.24', - // If true, only ChromeDriver will be started, not a Selenium Server. - // Tests for browsers other than Chrome will not run. - chromeOnly: false, - seleniumAddress: null, - sauceUser: null, - sauceKey: null, - sauceSeleniumAddress: null, - - specs: [ - 'src/test/js/e2e/**/*.e2e.js' - ], - - exclude: [], - - capabilities: { - browserName: 'chrome', - - // Number of times to run this set of capabilities (in parallel, unless - // limited by maxSessions). Default is 1. - count: 1, - - // If this is set to be true, specs will be sharded by file (i.e. all - // files to be run by this set of capabilities will run in parallel). - // Default is false. - shardTestFiles: false, - - // Maximum number of browser instances that can run in parallel for this - // set of capabilities. This is only needed if shardTestFiles is true. - // Default is 1. - maxInstances: 1, - - // This option allows to hide the warning "--ignore-certificate-errors" in chrome - chromeOptions: { - args: ['--test-type'] - } - - // Additional spec files to be run on this capability only. - // specs: ['spec/chromeOnlySpec.js'] - - }, - - multiCapabilities: [], - maxSessions: -1, - - baseUrl: 'http://localhost:8083', - - rootElement: 'body', - - allScriptsTimeout: 11000, - - // How long to wait for a page to load. - getPageTimeout: 10000, - - params: { - //login: { - // user: 'Jane', - // password: '1234' - //} - }, - - -}; diff --git a/resources/layout-page/src/test/js/e2e/spec/layout-page.e2e.js b/resources/layout-page/src/test/js/e2e/spec/layout-page.e2e.js deleted file mode 100644 index 2292916d0..000000000 --- a/resources/layout-page/src/test/js/e2e/spec/layout-page.e2e.js +++ /dev/null @@ -1,73 +0,0 @@ -/** Copyright (C) 2015 Bonitasoft S.A. - * BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2.0 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -(function () { - 'use strict'; - - describe('Layout page', function () { - - var width = 1280, height = 800; - - describe('preview', function () { - it('should display application name on the browser tab', function () { - browser.controlFlow().execute(deployLayoutPage).then(function () { - browser.driver.sleep(1000); - browser.driver.manage().window().setSize(width, height); - browser.get('/designer/preview/page/layout-page/'); - expect(browser.getTitle()).toEqual('LivingApplicationLayoutPageV3'); - } - ); - }); - }); - }); - - function deployLayoutPage() { - var deferred = protractor.promise.defer(); - - var fs = require('fs'); - var path = require('path'); - var pageDirPath = path.join(__dirname, '/../../../../../target/'); - fs.readdir(pageDirPath, function (err, files) { - var pagePath = files.filter(function (file) { - return /layout-page-.*\.zip/.test(file); - })[0]; - upload(path.join(pageDirPath, pagePath)); - }); - - function upload(pagePath) { - var restler = require('restler'); - - fs.stat(pagePath, function (err, stats) { - restler.post(browser.baseUrl + '/designer/import/page', { - multipart: true, - data: { - "file": restler.file(pagePath, null, stats.size, null, "application/zip") - } - }).on("complete", function () { - deferred.fulfill(); - }).on("error", function (e) { - deferred.reject(e); - }).on("fail", function (e) { - deferred.reject(e); - }); - }); - } - - return deferred.promise; - } -}) -();