diff --git a/gulpfile.js b/gulpfile.js index b46325b9..4b4393bf 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -60,9 +60,16 @@ gulp.task('webdriver_update', protractor.webdriver_update) gulp.task('webdriver_standalone', protractor.webdriver_standalone) gulp.task('protractor', function (callback) { + var args + var suite = gutil.env.suite + if (typeof suite === 'string') { + args = ['--suite', suite] + } + gulp.src(["./res/test/e2e/**/*.js"]) .pipe(protractor.protractor({ - configFile: protractorConfig + configFile: protractorConfig, + args: args })) .on('error', function (e) { console.log(e) diff --git a/res/app/components/stf/keycodes/keycodes-spec.js b/res/app/components/stf/keycodes/keycodes-spec.js index 89275b2e..d76fe4c0 100644 --- a/res/app/components/stf/keycodes/keycodes-spec.js +++ b/res/app/components/stf/keycodes/keycodes-spec.js @@ -1,11 +1,11 @@ -describe('KeycodesService', function() { - - beforeEach(angular.mock.module(require('./').name)); - - it('should ...', inject(function(KeycodesService) { - - //expect(KeycodesService.doSomething()).toEqual('something'); - - })); - -}) +//describe('KeycodesService', function() { +// +// beforeEach(angular.mock.module(require('./').name)); +// +// it('should ...', inject(function(KeycodesService) { +// +// //expect(KeycodesService.doSomething()).toEqual('something'); +// +// })); +// +//}) diff --git a/res/test/e2e/app-control-spec.js b/res/test/e2e/control/control-spec.js similarity index 64% rename from res/test/e2e/app-control-spec.js rename to res/test/e2e/control/control-spec.js index c72a9f6d..04356614 100644 --- a/res/test/e2e/app-control-spec.js +++ b/res/test/e2e/control/control-spec.js @@ -1,5 +1,5 @@ describe('Control Page', function () { - var DeviceListPage = require('./app-devices') + var DeviceListPage = require('../devices') var deviceListPage = new DeviceListPage() var ControlPage = function () { @@ -8,8 +8,13 @@ describe('Control Page', function () { } this.kickDeviceButton = element.all(by.css('.kick-device')).first() this.kickDevice = function () { + this.openDevicesDropDown() this.kickDeviceButton.click() } + this.devicesDropDown = element(by.css('.device-name-text')) + this.openDevicesDropDown = function () { + this.devicesDropDown.click() + } } var controlPage = new ControlPage() @@ -25,13 +30,13 @@ describe('Control Page', function () { expect(controlPage.kickDeviceButton, true) }) - //it('should stop controlling an usable device', function () { - // controlPage.kickDevice() - // - // browser.getLocationAbsUrl().then(function (newUrl) { - // expect(newUrl).toBe(protractor.getInstance().baseUrl + 'devices') - // }) - //}) + it('should stop controlling an usable device', function () { + controlPage.kickDevice() + + browser.getLocationAbsUrl().then(function (newUrl) { + expect(newUrl).toBe(protractor.getInstance().baseUrl + 'devices') + }) + }) describe('Dashboard', function () { describe('Shell', function () { diff --git a/res/test/e2e/app-devices-spec.js b/res/test/e2e/devices/devices-spec.js similarity index 95% rename from res/test/e2e/app-devices-spec.js rename to res/test/e2e/devices/devices-spec.js index a4b80dfd..d83fdc98 100644 --- a/res/test/e2e/app-devices-spec.js +++ b/res/test/e2e/devices/devices-spec.js @@ -1,7 +1,7 @@ describe('Device Page', function () { describe('List', function () { - var DeviceListPage = require('./app-devices') + var DeviceListPage = require('./') var deviceListPage = new DeviceListPage() it('should go to Devices List page', function () { diff --git a/res/test/e2e/app-devices.js b/res/test/e2e/devices/index.js similarity index 100% rename from res/test/e2e/app-devices.js rename to res/test/e2e/devices/index.js diff --git a/res/test/e2e/app-help-spec.js b/res/test/e2e/help/help-spec.js similarity index 100% rename from res/test/e2e/app-help-spec.js rename to res/test/e2e/help/help-spec.js diff --git a/res/test/e2e/app-login.js b/res/test/e2e/login/index.js similarity index 100% rename from res/test/e2e/app-login.js rename to res/test/e2e/login/index.js diff --git a/res/test/e2e/app-login-spec.js b/res/test/e2e/login/login-spec.js similarity index 91% rename from res/test/e2e/app-login-spec.js rename to res/test/e2e/login/login-spec.js index a5cad7f0..8ac13137 100644 --- a/res/test/e2e/app-login-spec.js +++ b/res/test/e2e/login/login-spec.js @@ -1,5 +1,5 @@ describe('Login Page', function () { - var LoginPage = require('./app-login') + var LoginPage = require('./') var loginPage = new LoginPage() it('should login with auth-mock', function () { diff --git a/res/test/e2e/app-settings-spec.js b/res/test/e2e/settings/settings-spec.js similarity index 100% rename from res/test/e2e/app-settings-spec.js rename to res/test/e2e/settings/settings-spec.js diff --git a/res/test/protractor.conf.js b/res/test/protractor.conf.js index e2414466..ca325759 100644 --- a/res/test/protractor.conf.js +++ b/res/test/protractor.conf.js @@ -1,18 +1,27 @@ // Reference: https://github.com/angular/protractor/blob/master/referenceConf.js -var LoginPage = require('./e2e/app-login.js') +var LoginPage = require('./e2e/login') exports.config = { - chromeOnly: true, baseUrl: 'http://localhost:7100/#!/', - specs: ['res/test/e2e/**/*-spec.js'], + suites: { + control: 'e2e/control/**/*-spec.js', + devices: 'e2e/devices/**/*-spec.js', + help: 'e2e/help/**/*-spec.js', + login: 'e2e/login/**/*-spec.js', + settings: 'e2e/settings/**/*-spec.js' + }, jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 30000 }, capabilities: { - browserName: 'chrome' + browserName: 'chrome', + chromeOptions: { + args: ['--test-type'] // Prevent security warning bug in ChromeDriver + } }, - onPrepare: function() { + chromeOnly: true, + onPrepare: function () { var loginPage = new LoginPage() loginPage.login() //browser.driver.wait(loginPage.login)