Initial commit
This commit is contained in:
28
e2e/protractor.conf.js
Normal file
28
e2e/protractor.conf.js
Normal file
@@ -0,0 +1,28 @@
|
||||
// Protractor configuration file, see link for more information
|
||||
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
||||
|
||||
const { SpecReporter } = require('jasmine-spec-reporter');
|
||||
|
||||
exports.config = {
|
||||
allScriptsTimeout: 11000,
|
||||
specs: [
|
||||
'./src/**/*.e2e-spec.ts'
|
||||
],
|
||||
capabilities: {
|
||||
'browserName': 'chrome'
|
||||
},
|
||||
directConnect: true,
|
||||
baseUrl: 'http://localhost:4200/',
|
||||
framework: 'jasmine',
|
||||
jasmineNodeOpts: {
|
||||
showColors: true,
|
||||
defaultTimeoutInterval: 30000,
|
||||
print: function() {}
|
||||
},
|
||||
onPrepare() {
|
||||
require('ts-node').register({
|
||||
project: require('path').join(__dirname, './tsconfig.json')
|
||||
});
|
||||
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
|
||||
}
|
||||
};
|
||||
19
e2e/src/app.e2e-spec.ts
Normal file
19
e2e/src/app.e2e-spec.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { AppPage } from './app.po';
|
||||
|
||||
describe('new App', () => {
|
||||
let page: AppPage;
|
||||
|
||||
beforeEach(() => {
|
||||
page = new AppPage();
|
||||
});
|
||||
describe('default screen', () => {
|
||||
beforeEach(() => {
|
||||
page.navigateTo('/home');
|
||||
});
|
||||
it('should have a title saying Home', () => {
|
||||
page.getPageOneTitleText().then(title => {
|
||||
expect(title).toEqual('Home');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
15
e2e/src/app.po.ts
Normal file
15
e2e/src/app.po.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { browser, by, element } from 'protractor';
|
||||
|
||||
export class AppPage {
|
||||
navigateTo(destination) {
|
||||
return browser.get(destination);
|
||||
}
|
||||
|
||||
getTitle() {
|
||||
return browser.getTitle();
|
||||
}
|
||||
|
||||
getPageOneTitleText() {
|
||||
return element(by.tagName('app-home')).element(by.deepCss('ion-title')).getText();
|
||||
}
|
||||
}
|
||||
13
e2e/tsconfig.json
Normal file
13
e2e/tsconfig.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../out-tsc/app",
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"types": [
|
||||
"jasmine",
|
||||
"jasminewd2",
|
||||
"node"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user