blob: 68dba52c1673f781ed7ce52bfadf609df76b1a75 [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() {
Philipp Schrader80587432022-03-05 15:41:22 -080017 return (await this.waitForElement(element(by.css('.header')))).getText();
Philipp Schraderd999c9f2022-02-27 15:48:58 -080018 }
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();
Philipp Schrader93ade042022-03-05 17:16:10 -080030 expect(await page.getParagraphText()).toEqual('Team Selection');
Philipp Schraderd999c9f2022-02-27 15:48:58 -080031 });
32});