2017-02-22 13:13:21 -05:00
|
|
|
import { browser, element, by } from 'protractor';
|
|
|
|
|
2020-07-30 06:03:13 -04:00
|
|
|
describe('Upgrade Tests', () => {
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-07-30 06:03:13 -04:00
|
|
|
describe('AngularJS Auto-bootstrap', () => {
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
beforeAll(() => browser.get('/index-ng-app.html'));
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
it('bootstraps as expected', async () => {
|
|
|
|
expect(await element(by.css('#message')).getText()).toEqual('Hello world');
|
2017-02-22 13:13:21 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2020-07-30 06:03:13 -04:00
|
|
|
describe('AngularJS JavaScript Bootstrap', () => {
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
beforeAll(() => browser.get('/index-bootstrap.html'));
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
it('bootstraps as expected', async () => {
|
|
|
|
expect(await element(by.css('#message')).getText()).toEqual('Hello world');
|
2017-02-22 13:13:21 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2020-07-30 06:03:13 -04:00
|
|
|
describe('AngularJS-Angular Hybrid Bootstrap', () => {
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
beforeAll(() => browser.get('/index-ajs-a-hybrid-bootstrap.html'));
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
it('bootstraps as expected', async () => {
|
|
|
|
expect(await element(by.css('#message')).getText()).toEqual('Hello world');
|
2017-02-22 13:13:21 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
describe('Upgraded static component', async () => {
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
beforeAll(() => browser.get('/index-upgrade-static.html'));
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
it('renders', async () => {
|
|
|
|
expect(await element(by.css('h2')).getText()).toEqual('Windstorm details!');
|
2017-02-22 13:13:21 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2020-07-30 06:03:13 -04:00
|
|
|
describe('Upgraded component with IO', () => {
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
beforeAll(() => browser.get('/index-upgrade-io.html'));
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
it('has inputs', async () => {
|
|
|
|
expect(await element(by.css('h2')).getText()).toEqual('Windstorm details!');
|
2017-02-22 13:13:21 -05:00
|
|
|
});
|
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
it('has outputs', async () => {
|
|
|
|
await element(by.buttonText('Delete')).click();
|
|
|
|
expect(await element(by.css('h2')).getText()).toEqual('Ex-Windstorm details!');
|
2017-02-22 13:13:21 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2020-07-30 06:03:13 -04:00
|
|
|
describe('Downgraded static component', () => {
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
beforeAll(() => browser.get('/index-downgrade-static.html'));
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
it('renders', async () => {
|
|
|
|
expect(await element(by.css('h2')).getText()).toEqual('Windstorm details!');
|
2017-02-22 13:13:21 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2020-07-30 06:03:13 -04:00
|
|
|
describe('Downgraded component with IO', () => {
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
beforeAll(() => browser.get('/index-downgrade-io.html'));
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
it('has inputs', async () => {
|
|
|
|
expect(await element.all(by.css('h2')).first().getText()).toEqual('Windstorm details!');
|
2017-02-22 13:13:21 -05:00
|
|
|
});
|
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
it('has outputs', async () => {
|
|
|
|
await element.all(by.buttonText('Delete')).first().click();
|
|
|
|
expect(await element.all(by.css('h2')).first().getText()).toEqual('Ex-Windstorm details!');
|
2017-02-22 13:13:21 -05:00
|
|
|
});
|
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
it('supports ng-repeat', async () => {
|
|
|
|
expect(await element.all(by.css('hero-detail')).count()).toBe(3);
|
2017-02-22 13:13:21 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2020-07-30 06:03:13 -04:00
|
|
|
describe('Downgraded component with content projection', () => {
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
beforeAll(() => browser.get('/index-ajs-to-a-projection.html'));
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
it('can be transcluded into', async () => {
|
|
|
|
expect(await element(by.css('hero-detail')).getText()).toContain('Specific powers of controlling winds');
|
2017-02-22 13:13:21 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2020-07-30 06:03:13 -04:00
|
|
|
describe('Upgraded component with transclusion', () => {
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
beforeAll(() => browser.get('/index-a-to-ajs-transclusion.html'));
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
it('can be projected into', async () => {
|
|
|
|
expect(await element(by.css('hero-detail')).getText()).toContain('Specific powers of controlling winds');
|
2017-02-22 13:13:21 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2020-07-30 06:03:13 -04:00
|
|
|
describe('Upgrading AngularJS Providers', () => {
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
beforeAll(() => browser.get('/index-ajs-to-a-providers.html'));
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
it('works', async () => {
|
|
|
|
expect(await element(by.css('h2')).getText()).toBe('1: Windstorm');
|
2017-02-22 13:13:21 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2020-07-30 06:03:13 -04:00
|
|
|
describe('Downgrading Angular Providers', () => {
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
beforeAll(() => browser.get('/index-a-to-ajs-providers.html'));
|
2017-02-22 13:13:21 -05:00
|
|
|
|
2020-11-23 13:17:10 -05:00
|
|
|
it('works', async () => {
|
|
|
|
expect(await element(by.css('h2')).getText()).toBe('1: Windstorm');
|
2017-02-22 13:13:21 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|