puppeteer: Migrate navigation test from casper.

Also adds a helper function that is used in later
tests too.
This commit is contained in:
Dinesh
2020-08-05 17:38:08 +00:00
committed by Tim Abbott
parent 184b2b055d
commit a1934797ea
3 changed files with 109 additions and 132 deletions

View File

@@ -152,6 +152,15 @@ class CommonUtils {
return await page.evaluate((selector) => $(selector).text().trim(), selector);
}
async wait_for_text(page, selector, text) {
await page.waitForFunction(
(selector, text) => $(selector).text().includes(text),
{},
selector,
text,
);
}
async get_stream_id(page, stream_name) {
return await page.evaluate(
(stream_name) => stream_data.get_stream_id(stream_name),