fix: sync call in e2e tests (#3010)

This commit is contained in:
Anshuman Pandey
2024-08-14 18:36:07 +05:30
committed by GitHub
parent 1f41770060
commit e0208da0ac
3 changed files with 33 additions and 42 deletions
+9 -16
View File
@@ -47,13 +47,6 @@ test.describe("JS Package Test", async () => {
})();
await page.waitForURL(/\/environments\/[^/]+\/surveys\/[^/]+\/summary/);
// await expect(page.getByRole("link", { name: "Surveys" })).toBeVisible();
// await page.getByRole("link", { name: "Surveys" }).click();
// await page.waitForURL(/\/environments\/[^/]+\/surveys/);
// await expect(page.getByRole("heading", { name: "Surveys" })).toBeVisible();
});
await test.step("JS display survey on page and submit response", async () => {
@@ -64,20 +57,20 @@ test.describe("JS Package Test", async () => {
await page.goto(htmlFile);
// Formbricks In App Sync has happened
const syncApi = await page.waitForResponse((response) => response.url().includes("/app/sync"), {
timeout: 20000,
});
const syncApi = await page.waitForResponse(
(response) => {
return response.url().includes("/app/sync");
},
{
timeout: 120000,
}
);
expect(syncApi.status()).toBe(200);
// Formbricks Modal exists in the DOM
await expect(page.locator("#formbricks-modal-container")).toHaveCount(1);
// const displayApi = await page.waitForResponse((response) => response.url().includes("/display"));
// expect(displayApi.status()).toBe(200);
// Formbricks Modal exists in the DOM
// await expect(page.locator("#formbricks-modal-container")).toHaveCount(1);
// Formbricks Modal is visible
await expect(
page.locator("#questionCard-0").getByRole("link", { name: "Powered by Formbricks" })