diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts index 748e4b7861..ee7b101f96 100644 --- a/e2e/app.e2e-spec.ts +++ b/e2e/app.e2e-spec.ts @@ -7,8 +7,13 @@ describe('protractor App', function() { page = new ProtractorPage(); }); - it('should display message saying app works', () => { + it('should display title "DSpace"', () => { page.navigateTo(); - expect(page.getParagraphText()).toEqual('app works!'); + expect(page.getPageTitleText()).toEqual('DSpace'); + }); + + it('should display title "Hello, World!"', () => { + page.navigateTo(); + expect(page.getFirstPText()).toEqual('Hello, World!'); }); }); diff --git a/e2e/app.po.ts b/e2e/app.po.ts index b4ee755213..164c524620 100644 --- a/e2e/app.po.ts +++ b/e2e/app.po.ts @@ -5,7 +5,11 @@ export class ProtractorPage { return browser.get('/'); } - getParagraphText() { - return element(by.css('app-root h1')).getText(); + getPageTitleText() { + return browser.getTitle(); } -} + + getFirstPText() { + return element(by.xpath('//p[1]')).getText(); + } +} \ No newline at end of file diff --git a/package.json b/package.json index 6a6509fad0..2441f93a50 100644 --- a/package.json +++ b/package.json @@ -46,9 +46,11 @@ "debug:build:prod": "node-nightly --inspect --debug-brk node_modules/webpack/bin/webpack.js --config webpack.prod.config.ts", "lint": "tslint \"src/**/*.ts\" || true", "global": "npm install -g angular-cli nodemon npm-check-updates rimraf ts-node typedoc typescript webpack webpack-bundle-size-analyzer marked node-gyp protractor", - "postglobal": "npm run webdriver:update -- --standalone", - "webdriver:start": "webdriver-manager start", - "webdriver:update": "webdriver-manager update" + "postglobal": "npm link protractor", + "protractor": "protractor", + "e2e": "npm run protractor", + "webdriver:start": "webdriver-manager start --seleniumPort 4444", + "webdriver:update": "webdriver-manager update --standalone" }, "dependencies": { "@angular/common": "2.2.4", @@ -128,6 +130,8 @@ "webpack-bundle-analyzer": "1.4.1", "webpack-dev-middleware": "1.8.4", "webpack-dev-server": "2.1.0-beta.11", - "webpack-merge": "1.0.2" + "webpack-merge": "1.0.2", + "jasmine-spec-reporter": "~2.7.0", + "protractor-istanbul-plugin": "~2.0.0" } } diff --git a/protractor.conf.js b/protractor.conf.js index 169743b34d..b128c26297 100644 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -6,14 +6,67 @@ var SpecReporter = require('jasmine-spec-reporter'); exports.config = { allScriptsTimeout: 11000, + // ----------------------------------------------------------------- + // Uncomment to run tests using a remote Selenium server + //seleniumAddress: 'http://selenium.address:4444/wd/hub', + // Change to 'false' to run tests using a remote Selenium server + directConnect: true, + // Change if the website to test is not on the localhost + baseUrl: 'http://localhost:4200/', + // ----------------------------------------------------------------- specs: [ './e2e/**/*.e2e-spec.ts' ], - capabilities: { - 'browserName': 'chrome' - }, - directConnect: true, - baseUrl: 'http://localhost:4200/', + // ----------------------------------------------------------------- + // Browser and Capabilities: PhantomJS + // ----------------------------------------------------------------- + // capabilities: { + // 'browserName': 'phantomjs', + // 'version': '', + // 'platform': 'ANY' + // }, + // ----------------------------------------------------------------- + // Browser and Capabilities: Chrome + // ----------------------------------------------------------------- + capabilities: { + 'browserName': 'chrome', + 'version': '', + 'platform': 'ANY' + }, + // ----------------------------------------------------------------- + // Browser and Capabilities: Firefox + // ----------------------------------------------------------------- + // capabilities: { + // 'browserName': 'firefox', + // 'version': '', + // 'platform': 'ANY' + // }, + + // ----------------------------------------------------------------- + // Browser and Capabilities: MultiCapabilities + // ----------------------------------------------------------------- + //multiCapabilities: [ + // { + // 'browserName': 'phantomjs', + // 'version': '', + // 'platform': 'ANY' + // }, + // { + // 'browserName': 'chrome', + // 'version': '', + // 'platform': 'ANY' + // } + // { + // 'browserName': 'firefox', + // 'version': '', + // 'platform': 'ANY' + // } + //], + + plugins : [{ + path: 'node_modules/protractor-istanbul-plugin' + }], + framework: 'jasmine', jasmineNodeOpts: { showColors: true,