-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Warrens, Matthew (CORP)
authored and
Warrens, Matthew (CORP)
committed
Dec 1, 2017
1 parent
f56323b
commit 0e1a14c
Showing
23 changed files
with
165 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,8 +34,7 @@ testem.log | |
/typings | ||
|
||
# e2e | ||
/e2e/*.js | ||
/e2e/*.map | ||
/e2e/output | ||
|
||
# System Files | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Feature: myapp1 App | ||
myapp1 Application does things | ||
|
||
Scenario: Welcome message | ||
Given I am on the landing page | ||
Then I should see a welcome message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { browser, by } from 'protractor'; | ||
|
||
export class AppPage { | ||
public navigateTo() { | ||
return browser.get('#'); | ||
} | ||
|
||
public getText() { | ||
return browser.findElement(by.css('body')).getText(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { expect } from 'chai'; | ||
import { defineSupportCode } from 'cucumber'; | ||
|
||
import { AppPage } from './app.po'; | ||
|
||
defineSupportCode(({ Given, Then, Before }) => { | ||
let app: AppPage; | ||
|
||
Before(() => { | ||
app = new AppPage(); | ||
}); | ||
|
||
Given('I am on the landing page', () => app.navigateTo()); | ||
|
||
Then('I should see a welcome message', () => { | ||
return expect(app.getText()).to.eventually.contains('Welcome to an Angular CLI app built with Nrwl Nx! myapp1'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Feature: myapp2 App | ||
myapp2 Application does things | ||
|
||
Scenario: Welcome message | ||
Given I am on the landing page | ||
Then I should see a welcome message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { browser, by } from 'protractor'; | ||
|
||
export class AppPage { | ||
public navigateTo() { | ||
return browser.get('#'); | ||
} | ||
|
||
public getText() { | ||
return browser.findElement(by.css('body')).getText(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { expect } from 'chai'; | ||
import { defineSupportCode } from 'cucumber'; | ||
|
||
import { AppPage } from './app.po'; | ||
|
||
defineSupportCode(({ Given, Then, Before }) => { | ||
let app: AppPage; | ||
|
||
Before(() => { | ||
app = new AppPage(); | ||
}); | ||
|
||
Given('I am on the landing page', () => app.navigateTo()); | ||
|
||
Then('I should see a welcome message', () => { | ||
return expect(app.getText()).to.eventually.contains('Welcome to an Angular CLI app built with Nrwl Nx! myapp2'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
|
||
var chai = require("chai"); | ||
var chaiAsPromised = require("chai-as-promised"); | ||
|
||
module.exports = { | ||
setup: function() { | ||
try { | ||
|
||
chai.use(chaiAsPromised); | ||
|
||
} catch (e) { | ||
return browser.quit().then(function () { | ||
return process.exit(e); | ||
}); | ||
} | ||
}, | ||
|
||
name: 'core' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,55 @@ | ||
// Protractor configuration file, see link for more information | ||
// https://github.com/angular/protractor/blob/master/lib/config.ts | ||
require('ts-node/register'); | ||
const argv = require('yargs').argv; | ||
const baseUrl = argv['base-url'] || 'http://localhost:4200/'; | ||
|
||
const { SpecReporter } = require('jasmine-spec-reporter'); | ||
if(!argv.app) { | ||
throw new Error('Missing required parameter app: (ng e2e --app=appname)'); | ||
} | ||
|
||
exports.config = { | ||
allScriptsTimeout: 11000, | ||
specs: [ | ||
'./apps/**/*.e2e-spec.ts' | ||
], | ||
capabilities: { | ||
'browserName': 'chrome' | ||
browserName: 'chrome', | ||
chromeOptions: { | ||
args: ['--no-sandbox'] | ||
} | ||
}, | ||
directConnect: true, | ||
baseUrl: 'http://localhost:4200/', | ||
framework: 'jasmine', | ||
jasmineNodeOpts: { | ||
showColors: true, | ||
defaultTimeoutInterval: 30000, | ||
print: function() {} | ||
baseUrl: baseUrl, | ||
|
||
// Specs here are the cucumber feature files | ||
specs: ['./apps/' + argv.app + '/**/e2e/features/*.feature'], | ||
|
||
// Use a custom framework adapter and set its relative path | ||
framework: 'custom', | ||
frameworkPath: require.resolve('protractor-cucumber-framework'), | ||
|
||
plugins: [{ | ||
path: 'e2e/core.js' | ||
}], | ||
|
||
// cucumber command line options | ||
cucumberOpts: { | ||
// require step definition files before executing features | ||
require: ['./apps/' + argv.app + '/**/e2e/steps/**/*.steps.ts'], | ||
// <string[]> (expression) only execute the features or scenarios with tags matching the expression | ||
// tags: [], | ||
// <boolean> fail if there are any undefined or pending steps | ||
strict: true, | ||
// <string[]> (type[:path]) specify the output format, optionally supply PATH to redirect formatter output (repeatable) | ||
format: ['json:./e2e/output/' + argv.app + '-results.json'], | ||
// <boolean> invoke formatters without executing steps | ||
dryRun: false, | ||
// <string[]> ("extension:module") require files with the given EXTENSION after requiring MODULE (repeatable) | ||
compiler: [] | ||
}, | ||
|
||
// Enable TypeScript for the tests | ||
onPrepare() { | ||
require('ts-node').register({ | ||
project: './tsconfig.e2e.json' | ||
}); | ||
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
], | ||
"baseUrl": ".", | ||
"paths": { | ||
"@nrwl-protractor/*": [ | ||
"@nrwl-cucumber/*": [ | ||
"libs/*" | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
], | ||
"baseUrl": ".", | ||
"paths": { | ||
"@nrwl-protractor/*": [ | ||
"@nrwl-cucumber/*": [ | ||
"libs/*" | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters