summaryrefslogtreecommitdiffhomepage
path: root/gui/test
diff options
context:
space:
mode:
Diffstat (limited to 'gui/test')
-rw-r--r--gui/test/e2e/utils.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/gui/test/e2e/utils.ts b/gui/test/e2e/utils.ts
index b00c3dbdde..b812cdd84e 100644
--- a/gui/test/e2e/utils.ts
+++ b/gui/test/e2e/utils.ts
@@ -58,7 +58,10 @@ const waitForNavigationFactory = (
app: ElectronApplication,
page: Page,
) => {
+ // Wait for navigation animation to finish. A function can be provided that initiates the
+ // navigation, e.g. clicks a button.
return async (initiateNavigation?: () => Promise<void> | void) => {
+ // Wait for route to change after optionally initiating the navigation.
const [route] = await Promise.all([
waitForNextRoute(app),
initiateNavigation?.(),
@@ -67,6 +70,7 @@ const waitForNavigationFactory = (
// Wait for view corresponding to new route to appear
await page.getByTestId(route).isVisible();
+ // Wait until there's only one transitionContents
const transitionContents = page.getByTestId('transition-content');
let transitionContentsCount;
do {
@@ -81,6 +85,7 @@ const waitForNavigationFactory = (
};
};
+// Returns the route when it changes
const waitForNextRoute = async (app: ElectronApplication): Promise<string> => {
return await app.evaluate(({ ipcMain }) => {
return new Promise((resolve) => {