feat(aio): copy example code from angular.io
This commit is contained in:

committed by
Igor Minar

parent
3e34ba01bd
commit
1f3198cb50
35
aio/content/examples/protractor-helpers.ts
Normal file
35
aio/content/examples/protractor-helpers.ts
Normal file
@ -0,0 +1,35 @@
|
||||
import { browser } from 'protractor';
|
||||
|
||||
export var appLang = {
|
||||
appIsTs: false,
|
||||
appIsJs: false,
|
||||
appIsDart: false,
|
||||
appIsUnknown: false
|
||||
};
|
||||
|
||||
export function describeIf(cond: boolean, name: string, func: () => void): void {
|
||||
if (cond) {
|
||||
describe(name, func);
|
||||
} else {
|
||||
xdescribe(name, func);
|
||||
}
|
||||
}
|
||||
|
||||
export function itIf(cond: boolean, name: string, func: (done: DoneFn) => void): void {
|
||||
if (cond) {
|
||||
it(name, func);
|
||||
} else {
|
||||
xit(name, func);
|
||||
}
|
||||
}
|
||||
|
||||
// protractor.config.js is set to ng2 mode by default, so we must manually
|
||||
// change it for upgradeAdapter tests
|
||||
export function setProtractorToNg1Mode(): void {
|
||||
browser.rootEl = 'body';
|
||||
}
|
||||
|
||||
export function setProtractorToHybridMode() {
|
||||
setProtractorToNg1Mode();
|
||||
browser.ng12Hybrid = true;
|
||||
}
|
Reference in New Issue
Block a user