Browse Source

test(e2e): refine condition wait

Andelf 3 years ago
parent
commit
ddbe7cabeb
2 changed files with 5 additions and 4 deletions
  1. 5 0
      e2e-tests/fixtures.ts
  2. 0 4
      e2e-tests/utils.ts

+ 5 - 0
e2e-tests/fixtures.ts

@@ -67,6 +67,11 @@ base.beforeAll(async () => {
   // NOTE: The following ensures first start.
   // await page.waitForSelector('text=This is a demo graph, changes will not be saved until you open a local folder')
 
+  await page.waitForSelector(':has-text("Loading")', {
+    state: "hidden",
+    timeout: 1000 * 15,
+  });
+
   page.once('load', async () => {
     console.log('Page loaded!')
     await page.screenshot({ path: 'startup.png' })

+ 0 - 4
e2e-tests/utils.ts

@@ -18,10 +18,6 @@ export function randomString(length: number) {
   return result;
 }
 
-export async function appFirstLoaded(page: Page) {
-  await page.waitForSelector('text=This is a demo graph, changes will not be saved until you open a local folder')
-}
-
 export async function createRandomPage(page: Page) {
   const randomTitle = randomString(20)