blob: bb1c0759f595862a8c9eda6f949d8bb07cb3e25e [file] [log] [blame]
Philipp Schraderd999c9f2022-02-27 15:48:58 -08001import {browser, by, element} from 'protractor';
2
3class AppPage {
4 async navigateTo() {
5 await browser.get(browser.baseUrl);
6 }
7
8 // Wait for basically forever for these elements to appear.
9 // Bazel will manage the timeouts.
10 async waitForElement(el, timeout = 1000000) {
11 await browser.wait(() => el.isPresent(), timeout);
12 await browser.wait(() => el.isDisplayed(), timeout);
13 return el;
14 }
15
16 async getParagraphText() {
17 return (await this.waitForElement(element(by.css('h1')))).getText();
18 }
19}
20
21describe('The scouting web page', () => {
22 let page: AppPage;
23
24 beforeEach(() => {
25 page = new AppPage();
26 });
27
28 it('should display: This is an app.', async () => {
29 await page.navigateTo();
30 expect(await page.getParagraphText()).toEqual('This is an app.');
31 });
32});