Browse Source

fix e2e tests

Konstantinos Kaloutas 2 years ago
parent
commit
aacbfa4707
2 changed files with 8 additions and 9 deletions
  1. 0 1
      e2e-tests/accessibility.spec.ts
  2. 8 8
      e2e-tests/util/search-modal.ts

+ 0 - 1
e2e-tests/accessibility.spec.ts

@@ -4,7 +4,6 @@ import { expect } from '@playwright/test'
 import AxeBuilder from '@axe-core/playwright'
 
 test('should not have any automatically detectable accessibility issues', async ({ page }) => {
-    test.slow()
     await createRandomPage(page)
     await page.waitForTimeout(2000)
     const accessibilityScanResults = await new AxeBuilder({ page })

+ 8 - 8
e2e-tests/util/search-modal.ts

@@ -15,28 +15,28 @@ export async function createRandomPage(page: Page) {
     // Fill [placeholder="Search or create page"]
     await page.fill('[placeholder="Search or create page"]', randomTitle)
     // Click text=/.*New page: "new page".*/
-    await page.click('text=/.*New page: ".*/')
+    await page.click('text=/.*New page:".*/')
     // Wait for h1 to be from our new page
     await page.waitForSelector(`h1 >> text="${randomTitle}"`, { state: 'visible' })
     // wait for textarea of first block
     await page.waitForSelector('textarea >> nth=0', { state: 'visible' })
-  
+
     return randomTitle;
 }
-  
+
 export async function createPage(page: Page, page_name: string) {// Click #search-button
     await closeSearchBox(page)
     await page.click('#search-button')
     // Fill [placeholder="Search or create page"]
     await page.fill('[placeholder="Search or create page"]', page_name)
     // Click text=/.*New page: "new page".*/
-    await page.click('text=/.*New page: ".*/')
+    await page.click('text=/.*New page:".*/')
     // wait for textarea of first block
     await page.waitForSelector('textarea >> nth=0', { state: 'visible' })
-  
+
     return page_name;
   }
-  
+
 export async function searchAndJumpToPage(page: Page, pageTitle: string) {
     await closeSearchBox(page)
     await page.click('#search-button')
@@ -50,7 +50,7 @@ export async function searchAndJumpToPage(page: Page, pageTitle: string) {
 /**
  * type a search query into the search box
  * stop at the point where search box shows up
- * 
+ *
  * @param page the pw page object
  * @param query the search query to type into the search box
  * @returns the HTML element for the search results ui
@@ -61,6 +61,6 @@ export async function searchPage(page: Page, query: string): Promise<ElementHand
     await page.waitForSelector('[placeholder="Search or create page"]')
     await page.type('[placeholder="Search or create page"]', query, { delay: 10 })
     await page.waitForTimeout(2000) // wait longer for search contents to render
-  
+
     return page.$$('#ui__ac-inner>div');
 }