From 64592c28364260f3f5ad4dd51b3ccd8030882e0d Mon Sep 17 00:00:00 2001 From: Nil Gallego Date: Wed, 22 Jan 2025 17:13:39 +0100 Subject: [PATCH] make GitHub integration with Org data fetching parallel --- .../e2e/github-integration-org-fetch.spec.ts | 49 ++++++++++--------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/e2e-tests/playwright/e2e/github-integration-org-fetch.spec.ts b/e2e-tests/playwright/e2e/github-integration-org-fetch.spec.ts index 0f71e1631b..501a5baf70 100644 --- a/e2e-tests/playwright/e2e/github-integration-org-fetch.spec.ts +++ b/e2e-tests/playwright/e2e/github-integration-org-fetch.spec.ts @@ -1,42 +1,47 @@ -import { test, Page } from "@playwright/test"; +import { test as base } from "@playwright/test"; import { UIhelper } from "../utils/ui-helper"; -import { Common, setupBrowser } from "../utils/common"; - -let page: Page; -test.describe.serial("GitHub integration with Org data fetching", () => { - let common: Common; - let uiHelper: UIhelper; - - test.beforeAll(async ({ browser }, testInfo) => { - page = (await setupBrowser(browser, testInfo)).page; - uiHelper = new UIhelper(page); - common = new Common(page); +import { Common } from "../utils/common"; + +const test = base.extend<{ + common: Common; + uiHelper: UIhelper; +}>({ + common: async ({ page }) => { + const common = new Common(page); await common.loginAsKeycloakUser(); - }); - - test("Verify that fetching the groups of the first org works", async () => { + }, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + uiHelper: async ({ page, common }, use) => { + const uiHelper = new UIhelper(page); await uiHelper.openSidebar("Catalog"); - await uiHelper.selectMuiBox("Kind", "Group"); + await use(uiHelper); + }, +}); +test.describe("GitHub integration with Org data fetching", () => { + test("Verify that fetching the groups of the first org works", async ({ + uiHelper, + }) => { + await uiHelper.selectMuiBox("Kind", "Group"); await uiHelper.searchInputPlaceholder("maintainers"); await uiHelper.verifyRowsInTable(["maintainers"]); - await uiHelper.searchInputPlaceholder("r"); await uiHelper.verifyRowsInTable(["rhdh-qes"]); }); - test("Verify that fetching the groups of the second org works", async () => { + test("Verify that fetching the groups of the second org works", async ({ + uiHelper, + }) => { await uiHelper.searchInputPlaceholder("c"); await uiHelper.verifyRowsInTable(["catalog-group"]); - await uiHelper.searchInputPlaceholder("j"); await uiHelper.verifyRowsInTable(["janus-test"]); }); - test("Verify that fetching the users of the orgs works", async () => { - await uiHelper.openSidebar("Catalog"); + test("Verify that fetching the users of the orgs works", async ({ + uiHelper, + }) => { await uiHelper.selectMuiBox("Kind", "User"); - await uiHelper.searchInputPlaceholder("r"); await uiHelper.verifyRowsInTable(["rhdh-qe"]); });