2020-11-23 20:17:10 +02:00
|
|
|
import { element, by } from 'protractor';
|
2017-07-04 10:58:20 -04:00
|
|
|
import { AppPage } from './app.po';
|
|
|
|
|
|
|
|
|
|
|
|
describe('providers App', () => {
|
|
|
|
let page: AppPage;
|
|
|
|
const buttons = element.all(by.css('button'));
|
|
|
|
const customersButton = buttons.get(0);
|
|
|
|
const ordersButton = buttons.get(1);
|
|
|
|
|
2020-11-23 20:17:10 +02:00
|
|
|
beforeEach(async () => {
|
2017-07-04 10:58:20 -04:00
|
|
|
page = new AppPage();
|
2020-11-23 20:17:10 +02:00
|
|
|
await page.navigateTo();
|
2017-07-04 10:58:20 -04:00
|
|
|
});
|
|
|
|
|
2020-11-23 20:17:10 +02:00
|
|
|
it('should display message saying app works', async () => {
|
|
|
|
expect(await page.getTitleText()).toEqual('Lazy loading feature modules');
|
2017-07-04 10:58:20 -04:00
|
|
|
});
|
|
|
|
|
2020-07-30 13:03:13 +03:00
|
|
|
describe('Customers', () => {
|
2020-11-23 20:17:10 +02:00
|
|
|
beforeEach(() => customersButton.click());
|
2017-07-04 10:58:20 -04:00
|
|
|
|
2020-11-23 20:17:10 +02:00
|
|
|
it('should show customers when the button is clicked', async () => {
|
|
|
|
const customersMessage = element(by.css('app-customers > p'));
|
|
|
|
expect(await customersMessage.getText()).toBe('customers works!');
|
2017-07-04 10:58:20 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2020-07-30 13:03:13 +03:00
|
|
|
describe('Orders', () => {
|
2020-11-23 20:17:10 +02:00
|
|
|
beforeEach(() => ordersButton.click());
|
2017-07-04 10:58:20 -04:00
|
|
|
|
2020-11-23 20:17:10 +02:00
|
|
|
it('should show orders when the button is clicked', async () => {
|
|
|
|
const ordersMessage = element(by.css('app-orders > p'));
|
|
|
|
expect(await ordersMessage.getText()).toBe('orders works!');
|
2017-07-04 10:58:20 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|