Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

Trying to sort these brittle tests.

Matt Roberts76b0139fce75
diff --git a/e2e/setup.ts b/e2e/setup.ts
index 75335ab7e..0eece706d 100644
--- a/e2e/setup.ts
+++ b/e2e/setup.ts
@@ -1,9 +1,11 @@
-import { Before, BeforeAll, AfterAll, After } from "@cucumber/cucumber"
+import { Before, BeforeAll, AfterAll, After, setDefaultTimeout } from "@cucumber/cucumber"
import debug from "debug"
import * as playwright from "@playwright/test"
import { getLatestLinkSentTo } from "./step_definitions/fns"
import { FiderWorld } from "./world"
+setDefaultTimeout(10 * 1000) // 10 seconds for CI environments
+
let browser: playwright.Browser
let tenantName: string
type BrowserName = "chromium" | "firefox" | "webkit"
diff --git a/e2e/step_definitions/home.steps.ts b/e2e/step_definitions/home.steps.ts
index ac5f6dead..285c40207 100644
--- a/e2e/step_definitions/home.steps.ts
+++ b/e2e/step_definitions/home.steps.ts
@@ -17,6 +17,7 @@ Then("I click on the first post", async function (this: FiderWorld) {
})
Then("I search for {string}", async function (this: FiderWorld, searchTerm: string) {
+ await this.page.waitForSelector("#input-query", { state: "visible" })
await this.page.type("#input-query", searchTerm)
})
@@ -26,7 +27,8 @@ Given("I type {string} as the title", async function (this: FiderWorld, title: s
Given("I type {string} as the description", async function (this: FiderWorld, description: string) {
const editor = this.page.getByTestId("tiptap-editor")
- // Click to focus, then type
+ // Wait for editor to be visible, click to focus, then type
+ await editor.waitFor({ state: "visible" })
await editor.click()
await this.page.keyboard.type(description)
})