mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
puppeteer: Migrate navigation test from casper.
Also adds a helper function that is used in later tests too.
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user