diff --git a/package.json b/package.json index c3c89edcd13..96180b09ba7 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,8 @@ "build": "node ./node_modules/webpack/bin/webpack.js", "start": "node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --devtool eval", "test": "./node_modules/karma/bin/karma start", - "preinstall": "npm install -g bower@1.4.1" + "preinstall": "npm install -g bower@1.4.1", + "int": "protractor protractor.conf.js" }, "devDependencies": { "angular-mocks": "^1.4.1", @@ -86,6 +87,7 @@ "octicons": "^2.2.0", "phantomjs": "^1.9.17", "phantomjs-polyfill": "0.0.1", + "protractor": "^2.2.0", "select2": "git://github.com/select2/select2.git#3.4.8", "style-loader": "^0.12.3", "url-loader": "^0.5.6", diff --git a/protractor.conf.js b/protractor.conf.js index 377dbc2072f..837867db114 100644 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -1,24 +1,22 @@ exports.config = { - seleniumServerJar: './node_modules/selenium-server/lib/runner/selenium-server-standalone-2.44.0.jar', - chromeDriver: './node_modules/chromedriver/lib/chromedriver/chromedriver', - //seleniumAddress: 'http://localhost:4444/wd/hub', - framework: 'jasmine', - - baseUrl: 'http://0.0.0.0:9000', + troubleshoot: true, + baseUrl: 'http://localhost:9000', specs: 'test/e2e/**/*.js', getPageTimeout: 20000, allScriptsTimeout: 20000, - //directConnect:true, capabilities: { 'browserName': 'chrome', }, - onPrepare: function() { - //browser.driver.manage().window().setSize(1500, 800); - - require('jasmine-reporters'); - jasmine.getEnv().addReporter( - new jasmine.JUnitXmlReporter('xmloutput', true, true) - ); + // ----- Options to be passed to minijasminenode ----- + jasmineNodeOpts: { + // If true, display spec names. + isVerbose: true, + // If true, print colors to the terminal. + showColors: true, + // If true, include stack traces in failures. + includeStackTrace: true, + // Default time to wait in ms before a test fails. + defaultTimeoutInterval: 30000 } }; diff --git a/test/e2e/applications.e2e.js b/test/e2e/applications.e2e.js index d3462773e03..cb05d756dff 100644 --- a/test/e2e/applications.e2e.js +++ b/test/e2e/applications.e2e.js @@ -1,12 +1,9 @@ 'use strict'; var page = require('../pages/applications.page.js'); -//var Modal = require('../pages/newApplication.modal.js'); -var Q = require('q'); - var newApplicationModal = require('../pages/newApplication.modal.js'); -describe('Applications Landing Page', function() { +describe('Applications Landing Page - ', function() { var browserName; beforeEach(function(done) { @@ -24,18 +21,18 @@ describe('Applications Landing Page', function() { }; }); - describe('Rerouting: ', function () { + describe('Rerouting - ', function () { - it('should redirect to /applications from /', function() { + it('should redirect to /#/applications from /', function() { browser.get('/'); expect(page.header.getText()).toEqual('Applications'); }); }); - describe('The Actions Button', function() { + describe('The Actions Button -', function() { - describe('Create Application', function () { + describe('Create Application -', function () { it('Click the Actions Button to display Create Application action', function(done) { this.openMenu().then(function() { @@ -57,7 +54,7 @@ describe('Applications Landing Page', function() { }, console.log); }); - describe('Test the new application modal form', function () { + describe('Test the new application modal form -', function () { afterEach(function() { newApplicationModal.resetForm(); @@ -67,12 +64,6 @@ describe('Applications Landing Page', function() { expect(newApplicationModal.submit.getAttribute('disabled')).not.toBe(null); }); - it('should give a warning if the application name is not unique', function () { - newApplicationModal.typeName('deck'); - expect(newApplicationModal.uniqueNameWarning.isPresent()).toBe(true); - expect(newApplicationModal.uniqueNameWarning.getText()).toContain('unique'); - }); - it('takes a name, email, description and account', function() { newApplicationModal.typeName('deck_e2e_test_'+browserName); newApplicationModal.typeDescription('a deck test'); @@ -83,7 +74,6 @@ describe('Applications Landing Page', function() { }); it('creates the application', function(done) { - // TODO: application creation is currently busted in prestaging newApplicationModal.typeName('deck.e2e.'+browserName); newApplicationModal.typeDescription('a deck test'); newApplicationModal.typeEmail('delivery-engineering+deck-e2e@netflix.com'); diff --git a/test/pages/applications.page.js b/test/pages/applications.page.js index 71c579dcf2d..1a15da71b60 100644 --- a/test/pages/applications.page.js +++ b/test/pages/applications.page.js @@ -1,6 +1,6 @@ module.exports = { url: '#/applications', header: element(by.css('[data-purpose="view-header"]')), - menu: element(by.css('[data-purpose="applications-menu"] button')), - createApplicationMenuItem: element(by.css('[data-purpose="applications-menu"] li a')), + menu: element(by.buttonText('Actions')), + createApplicationMenuItem: element(by.linkText('Create Application')), }; diff --git a/test/pages/newApplication.modal.js b/test/pages/newApplication.modal.js index 2c9404a25ce..73dcbb9b3fc 100644 --- a/test/pages/newApplication.modal.js +++ b/test/pages/newApplication.modal.js @@ -4,10 +4,8 @@ module.exports = { header: element(by.css('[data-purpose="modal-header"]')), description: element(by.css('[data-purpose="application-description"]')), email: element(by.css('[data-purpose="application-email"]')), - name: element(by.css('[data-purpose="application-name"]')), + name: element(by.name('name')), uniqueNameWarning: element(by.css('.error-message')).element(by.tagName('span')), - //prod: element(by.css('[data-purpose="application-accounts"] [value="prod"]')), - prod: element(by.cssContainingText('option', 'prod')), submit: element(by.css('[data-purpose="submit"]')), accountSelectBox: element(by.css('.select2-input')), @@ -24,10 +22,6 @@ module.exports = { this.description.sendKeys(description) ; }, - selectProdAccount: function () { - return this.prod.click(); - }, - selectTestAccount: function () { this.accountSelectBox.click().then(function() { element(by.css('li#ui-select-choices-row-0-0 div span')).click();