cleanup upgrade-adapter e2e test
This commit is contained in:
parent
03d877dcee
commit
c3b9cb3a03
@ -23,10 +23,20 @@ export function itIf(cond: boolean, name: string, func: (done: DoneFn) => void):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// protractor.config.js is set to ng2 mode by default, so we must manually
|
||||||
|
// change it for upgradeAdapter tests
|
||||||
export function setProtractorToNg1Mode(): void {
|
export function setProtractorToNg1Mode(): void {
|
||||||
browser.rootEl = 'body';
|
browser.rootEl = 'body';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function setProtractorToHybridMode() {
|
||||||
|
setProtractorToNg1Mode();
|
||||||
|
browser.ng12Hybrid = true;
|
||||||
|
// remove once waitForNg1AsyncBootstrap() is removed as well
|
||||||
|
browser.ignoreSynchronization = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO remove once all update adapter tests are moved to setProtractorToHybridMode
|
||||||
// Protractor doesn't support the UpgradeAdapter's asynchronous
|
// Protractor doesn't support the UpgradeAdapter's asynchronous
|
||||||
// bootstrap with Angular 1 at the moment. Get around it by
|
// bootstrap with Angular 1 at the moment. Get around it by
|
||||||
// waiting for an element to get `ng-scope` class.
|
// waiting for an element to get `ng-scope` class.
|
||||||
@ -36,10 +46,3 @@ export function waitForNg1AsyncBootstrap() {
|
|||||||
return element(by.css('.ng-scope')).isPresent();
|
return element(by.css('.ng-scope')).isPresent();
|
||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setProtractorToHybridMode() {
|
|
||||||
setProtractorToNg1Mode();
|
|
||||||
browser.ng12Hybrid = true;
|
|
||||||
// remove once waitForNg1AsyncBootstrap() is removed as well
|
|
||||||
browser.ignoreSynchronization = false;
|
|
||||||
}
|
|
||||||
|
@ -1,15 +1,18 @@
|
|||||||
'use strict'; // necessary for es6 output in node
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { browser, element, by } from 'protractor';
|
import { browser, element, by } from 'protractor';
|
||||||
import { setProtractorToNg1Mode, waitForNg1AsyncBootstrap, setProtractorToHybridMode } from '../protractor-helpers';
|
import { setProtractorToHybridMode } from '../protractor-helpers';
|
||||||
|
|
||||||
describe('Upgrade Tests', function () {
|
describe('Upgrade Tests', function () {
|
||||||
|
|
||||||
describe('NG1 Auto-bootstrap', function() {
|
beforeAll(function () {
|
||||||
|
// setProtractorToHybridMode();
|
||||||
|
});
|
||||||
|
|
||||||
|
fdescribe('NG1 Auto-bootstrap', function() {
|
||||||
|
|
||||||
beforeAll(function () {
|
beforeAll(function () {
|
||||||
browser.get('/index-ng-app.html');
|
browser.get('/index-ng-app.html');
|
||||||
setProtractorToNg1Mode();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('bootstraps as expected', function () {
|
it('bootstraps as expected', function () {
|
||||||
@ -22,8 +25,6 @@ describe('Upgrade Tests', function () {
|
|||||||
|
|
||||||
beforeAll(function () {
|
beforeAll(function () {
|
||||||
browser.get('/index-bootstrap.html');
|
browser.get('/index-bootstrap.html');
|
||||||
setProtractorToNg1Mode();
|
|
||||||
waitForNg1AsyncBootstrap();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('bootstraps as expected', function () {
|
it('bootstraps as expected', function () {
|
||||||
@ -35,7 +36,6 @@ describe('Upgrade Tests', function () {
|
|||||||
describe('NG1-2 Hybrid Bootstrap', function() {
|
describe('NG1-2 Hybrid Bootstrap', function() {
|
||||||
|
|
||||||
beforeAll(function () {
|
beforeAll(function () {
|
||||||
setProtractorToHybridMode();
|
|
||||||
browser.get('/index-1-2-hybrid-bootstrap.html');
|
browser.get('/index-1-2-hybrid-bootstrap.html');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -48,7 +48,6 @@ describe('Upgrade Tests', function () {
|
|||||||
describe('Upgraded static component', function() {
|
describe('Upgraded static component', function() {
|
||||||
|
|
||||||
beforeAll(function () {
|
beforeAll(function () {
|
||||||
setProtractorToHybridMode();
|
|
||||||
browser.get('/index-upgrade-static.html');
|
browser.get('/index-upgrade-static.html');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -62,7 +61,6 @@ describe('Upgrade Tests', function () {
|
|||||||
describe('Upgraded component with IO', function() {
|
describe('Upgraded component with IO', function() {
|
||||||
|
|
||||||
beforeAll(function () {
|
beforeAll(function () {
|
||||||
setProtractorToHybridMode();
|
|
||||||
browser.get('/index-upgrade-io.html');
|
browser.get('/index-upgrade-io.html');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -81,7 +79,6 @@ describe('Upgrade Tests', function () {
|
|||||||
describe('Downgraded static component', function() {
|
describe('Downgraded static component', function() {
|
||||||
|
|
||||||
beforeAll(function () {
|
beforeAll(function () {
|
||||||
setProtractorToHybridMode();
|
|
||||||
browser.get('/index-downgrade-static.html');
|
browser.get('/index-downgrade-static.html');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -94,7 +91,6 @@ describe('Upgrade Tests', function () {
|
|||||||
describe('Downgraded component with IO', function() {
|
describe('Downgraded component with IO', function() {
|
||||||
|
|
||||||
beforeAll(function () {
|
beforeAll(function () {
|
||||||
setProtractorToHybridMode();
|
|
||||||
browser.get('/index-downgrade-io.html');
|
browser.get('/index-downgrade-io.html');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -117,7 +113,6 @@ describe('Upgrade Tests', function () {
|
|||||||
describe('Downgraded component with content projection', function() {
|
describe('Downgraded component with content projection', function() {
|
||||||
|
|
||||||
beforeAll(function () {
|
beforeAll(function () {
|
||||||
setProtractorToHybridMode();
|
|
||||||
browser.get('/index-1-to-2-projection.html');
|
browser.get('/index-1-to-2-projection.html');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -131,7 +126,6 @@ describe('Upgrade Tests', function () {
|
|||||||
describe('Upgraded component with transclusion', function() {
|
describe('Upgraded component with transclusion', function() {
|
||||||
|
|
||||||
beforeAll(function () {
|
beforeAll(function () {
|
||||||
setProtractorToHybridMode();
|
|
||||||
browser.get('/index-2-to-1-transclusion.html');
|
browser.get('/index-2-to-1-transclusion.html');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -145,7 +139,6 @@ describe('Upgrade Tests', function () {
|
|||||||
describe('Upgrading NG1 Providers', function() {
|
describe('Upgrading NG1 Providers', function() {
|
||||||
|
|
||||||
beforeAll(function () {
|
beforeAll(function () {
|
||||||
setProtractorToHybridMode();
|
|
||||||
browser.get('/index-1-to-2-providers.html');
|
browser.get('/index-1-to-2-providers.html');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -159,7 +152,6 @@ describe('Upgrade Tests', function () {
|
|||||||
describe('Downgrading NG2 Providers', function() {
|
describe('Downgrading NG2 Providers', function() {
|
||||||
|
|
||||||
beforeAll(function () {
|
beforeAll(function () {
|
||||||
setProtractorToHybridMode();
|
|
||||||
browser.get('/index-2-to-1-providers.html');
|
browser.get('/index-2-to-1-providers.html');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user