Skip to content

Commit

Permalink
fix: write separate tests for each analytics app to prevent hitting 6…
Browse files Browse the repository at this point in the history
…000 ms timeout
  • Loading branch information
SomayChauhan committed Jul 5, 2024
1 parent cb53b24 commit cca216c
Showing 1 changed file with 72 additions and 4 deletions.
76 changes: 72 additions & 4 deletions apps/web/playwright/apps/analytics/analyticsApps.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,84 @@ test.describe("Check analytics Apps", () => {
await appsPage.verifyAppsInfo(6);
});

test("Check analytics Apps using the new flow", async ({ appsPage, page, users }) => {
test("Check fathom App using the new flow", async ({ appsPage, page, users }) => {
const user = await users.create();
await user.apiLogin();
const eventTypes = await user.getUserEventsAsOwner();
const eventTypesIds = eventTypes.map((item) => item.id);

for (const app of ALL_APPS) {
await page.goto("/apps/categories/analytics");
await appsPage.installAnalyticsApp(app, eventTypesIds);
await page.goto("/apps/categories/analytics");
await appsPage.installAnalyticsApp("fathom", eventTypesIds);

for (const id of eventTypesIds) {
await appsPage.verifyAppsInfoNew(ALL_APPS, id);
}
});

test("Check matomo App using the new flow", async ({ appsPage, page, users }) => {
const user = await users.create();
await user.apiLogin();
const eventTypes = await user.getUserEventsAsOwner();
const eventTypesIds = eventTypes.map((item) => item.id);

await page.goto("/apps/categories/analytics");
await appsPage.installAnalyticsApp("matomo", eventTypesIds);

for (const id of eventTypesIds) {
await appsPage.verifyAppsInfoNew(ALL_APPS, id);
}
});

test("Check plausible App using the new flow", async ({ appsPage, page, users }) => {
const user = await users.create();
await user.apiLogin();
const eventTypes = await user.getUserEventsAsOwner();
const eventTypesIds = eventTypes.map((item) => item.id);

await page.goto("/apps/categories/analytics");
await appsPage.installAnalyticsApp("plausible", eventTypesIds);

for (const id of eventTypesIds) {
await appsPage.verifyAppsInfoNew(ALL_APPS, id);
}
});

test("Check ga4 App using the new flow", async ({ appsPage, page, users }) => {
const user = await users.create();
await user.apiLogin();
const eventTypes = await user.getUserEventsAsOwner();
const eventTypesIds = eventTypes.map((item) => item.id);

await page.goto("/apps/categories/analytics");
await appsPage.installAnalyticsApp("ga4", eventTypesIds);

for (const id of eventTypesIds) {
await appsPage.verifyAppsInfoNew(ALL_APPS, id);
}
});

test("Check gtm App using the new flow", async ({ appsPage, page, users }) => {
const user = await users.create();
await user.apiLogin();
const eventTypes = await user.getUserEventsAsOwner();
const eventTypesIds = eventTypes.map((item) => item.id);

await page.goto("/apps/categories/analytics");
await appsPage.installAnalyticsApp("gtm", eventTypesIds);

for (const id of eventTypesIds) {
await appsPage.verifyAppsInfoNew(ALL_APPS, id);
}
});

test("Check metapixel App using the new flow", async ({ appsPage, page, users }) => {
const user = await users.create();
await user.apiLogin();
const eventTypes = await user.getUserEventsAsOwner();
const eventTypesIds = eventTypes.map((item) => item.id);

await page.goto("/apps/categories/analytics");
await appsPage.installAnalyticsApp("metapixel", eventTypesIds);

for (const id of eventTypesIds) {
await appsPage.verifyAppsInfoNew(ALL_APPS, id);
Expand Down

0 comments on commit cca216c

Please sign in to comment.