|
|
|
@ -83,6 +83,11 @@ export const selectWidget = webdriverUtils.selectWidget.bind(webdriverUtils);
|
|
|
|
|
export const dismissBehavioralPrompts = webdriverUtils.dismissBehavioralPrompts.bind(webdriverUtils);
|
|
|
|
|
export const toggleSelectable = webdriverUtils.toggleSelectable.bind(webdriverUtils);
|
|
|
|
|
export const waitToPass = webdriverUtils.waitToPass.bind(webdriverUtils);
|
|
|
|
|
export const refreshDismiss = webdriverUtils.refreshDismiss.bind(webdriverUtils);
|
|
|
|
|
export const acceptAlert = webdriverUtils.acceptAlert.bind(webdriverUtils);
|
|
|
|
|
export const isAlertShown = webdriverUtils.isAlertShown.bind(webdriverUtils);
|
|
|
|
|
export const waitForDocToLoad = webdriverUtils.waitForDocToLoad.bind(webdriverUtils);
|
|
|
|
|
export const reloadDoc = webdriverUtils.reloadDoc.bind(webdriverUtils);
|
|
|
|
|
|
|
|
|
|
export const fixturesRoot: string = testUtils.fixturesRoot;
|
|
|
|
|
|
|
|
|
@ -776,21 +781,6 @@ export async function loadDocMenu(relPath: string, wait: boolean = true): Promis
|
|
|
|
|
if (wait) { await waitForDocMenuToLoad(); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Wait for the doc to be loaded, to the point of finishing fetch for the data on the current
|
|
|
|
|
* page. If you navigate from a doc page, use e.g. waitForUrl() before waitForDocToLoad() to
|
|
|
|
|
* ensure you are checking the new page and not the old.
|
|
|
|
|
*/
|
|
|
|
|
export async function waitForDocToLoad(timeoutMs: number = 10000): Promise<void> {
|
|
|
|
|
await driver.findWait('.viewsection_title', timeoutMs);
|
|
|
|
|
await waitForServer();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function reloadDoc() {
|
|
|
|
|
await driver.navigate().refresh();
|
|
|
|
|
await waitForDocToLoad();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Wait for the doc list to show, to know that workspaces are fetched, and imports enabled.
|
|
|
|
|
*/
|
|
|
|
@ -2879,34 +2869,6 @@ export async function getFilterMenuState(): Promise<FilterMenuValue[]> {
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Refresh browser and dismiss alert that is shown (for refreshing during edits).
|
|
|
|
|
*/
|
|
|
|
|
export async function refreshDismiss() {
|
|
|
|
|
await driver.navigate().refresh();
|
|
|
|
|
await acceptAlert();
|
|
|
|
|
await waitForDocToLoad();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Accepts an alert.
|
|
|
|
|
*/
|
|
|
|
|
export async function acceptAlert() {
|
|
|
|
|
await (await driver.switchTo().alert()).accept();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns whether an alert is shown.
|
|
|
|
|
*/
|
|
|
|
|
export async function isAlertShown() {
|
|
|
|
|
try {
|
|
|
|
|
await driver.switchTo().alert();
|
|
|
|
|
return true;
|
|
|
|
|
} catch {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Dismisses any tutorial card that might be active.
|
|
|
|
|
*/
|
|
|
|
|