MCPcopy Create free account
hub / github.com/Rello/analytics / selectRefreshAndWaitForSave

Function selectRefreshAndWaitForSave

tests/playwright/27_options_refresh.js:37–46  ·  view source on GitHub ↗
(page, selector)

Source from the content-addressed store, hash-verified

35}
36
37async function selectRefreshAndWaitForSave(page, selector) {
38 const [response] = await Promise.all([
39 page.waitForResponse(response => /\/report\/\d+\/refresh(?:\?|$)/.test(response.url()) && response.request().method() === 'POST'),
40 page.locator(`label[for="${selector}"]`).click(),
41 ]);
42 if (!response.ok()) {
43 throw new Error(`Saving auto refresh failed with HTTP ${response.status()}`);
44 }
45 await waitForRefreshSelection(page, `#${selector}`);
46}
47
48async function openRefreshMenu(page, label) {
49 if (await page.locator('#refresh0').isVisible().catch(() => false)) {

Callers 1

Calls 4

waitForRefreshSelectionFunction · 0.85
allMethod · 0.80
requestMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected