2018-10-31 08:26:51 -04:00
|
|
|
import { browser, element, ExpectedConditions as EC, by } from 'protractor';
|
2018-07-15 19:02:16 -04:00
|
|
|
|
|
|
|
browser.waitForAngularEnabled(false);
|
|
|
|
describe('Element E2E Tests', function () {
|
|
|
|
describe('Hello World Elements', () => {
|
2018-10-31 08:26:51 -04:00
|
|
|
const helloWorldEl = element(by.css('hello-world-el'));
|
|
|
|
|
|
|
|
beforeEach(() => browser.get('hello-world.html'));
|
|
|
|
|
|
|
|
it('should display "Hello World!"', function () {
|
2018-07-15 19:02:16 -04:00
|
|
|
expect(helloWorldEl.getText()).toEqual('Hello World!');
|
|
|
|
});
|
|
|
|
|
2018-10-31 08:26:51 -04:00
|
|
|
it('should display "Hello Foo!" via name attribute', function () {
|
2018-07-15 19:02:16 -04:00
|
|
|
const input = element(by.css('input[type=text]'));
|
2018-10-31 08:26:51 -04:00
|
|
|
input.sendKeys('Foo');
|
|
|
|
|
|
|
|
// Make tests less flaky on CI by waiting up to 5s for the element text to be updated.
|
|
|
|
browser.wait(EC.textToBePresentInElement(helloWorldEl, 'Hello Foo!'), 5000);
|
2018-07-15 19:02:16 -04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|