From f46cdfc555e6798aaf2628b4beea5226904cc8ac Mon Sep 17 00:00:00 2001 From: Nil Gallego Date: Tue, 22 Oct 2024 13:38:16 +0200 Subject: [PATCH] loginpage no longer static --- e2e-tests/playwright/e2e/github-discovery.spec.ts | 2 +- e2e-tests/playwright/e2e/github-happy-path.spec.ts | 2 +- .../e2e/plugins/analytics/analytics-disabled-rbac.spec.ts | 2 +- e2e-tests/playwright/e2e/plugins/bulk-import.spec.ts | 6 +++--- e2e-tests/playwright/e2e/plugins/rbac/rbac-api.spec.ts | 2 +- e2e-tests/playwright/e2e/plugins/rbac/rbac.spec.ts | 4 ++-- .../e2e/verify-tls-config-with-external-postgres-db.spec.ts | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/e2e-tests/playwright/e2e/github-discovery.spec.ts b/e2e-tests/playwright/e2e/github-discovery.spec.ts index e053eaf229..cd03f2d0f4 100644 --- a/e2e-tests/playwright/e2e/github-discovery.spec.ts +++ b/e2e-tests/playwright/e2e/github-discovery.spec.ts @@ -16,7 +16,7 @@ base.use({ storageState: GH_USER_IDAuthFile }); const test = base.extend({ catalogPage: async ({ page }, use) => { - await Common.logintoGithub(page); + await new Common(page).logintoGithub(); const catalog = new Catalog(page); await catalog.go(); use(catalog); diff --git a/e2e-tests/playwright/e2e/github-happy-path.spec.ts b/e2e-tests/playwright/e2e/github-happy-path.spec.ts index 9aebe16f70..9216e45a94 100644 --- a/e2e-tests/playwright/e2e/github-happy-path.spec.ts +++ b/e2e-tests/playwright/e2e/github-happy-path.spec.ts @@ -24,7 +24,7 @@ test.describe.serial('GitHub Happy path', () => { common = new Common(page); catalogImport = new CatalogImport(page); backstageShowcase = new BackstageShowcase(page); - await Common.logintoGithub(page); + await new Common(page).logintoGithub(); }); test('Verify Profile is Github Account Name in the Settings page', async ({ diff --git a/e2e-tests/playwright/e2e/plugins/analytics/analytics-disabled-rbac.spec.ts b/e2e-tests/playwright/e2e/plugins/analytics/analytics-disabled-rbac.spec.ts index f8126d38cb..1e969c1606 100644 --- a/e2e-tests/playwright/e2e/plugins/analytics/analytics-disabled-rbac.spec.ts +++ b/e2e-tests/playwright/e2e/plugins/analytics/analytics-disabled-rbac.spec.ts @@ -10,7 +10,7 @@ test.describe('Check RBAC "analytics-provider-segment" plugin', () => { test.beforeEach(async ({ page }) => { uiHelper = new UIhelper(page); - await Common.logintoGithub(page); + await new Common(page).logintoGithub(); await uiHelper.openSidebarButton('Administration'); await uiHelper.openSidebar('Plugins'); await uiHelper.verifyHeading('Plugins'); diff --git a/e2e-tests/playwright/e2e/plugins/bulk-import.spec.ts b/e2e-tests/playwright/e2e/plugins/bulk-import.spec.ts index 38111bb4fb..c1eeb34f2a 100644 --- a/e2e-tests/playwright/e2e/plugins/bulk-import.spec.ts +++ b/e2e-tests/playwright/e2e/plugins/bulk-import.spec.ts @@ -48,7 +48,7 @@ test.describe.serial('Bulk Import plugin', () => { uiHelper = new UIhelper(page); common = new Common(page); bulkimport = new BulkImport(page); - await Common.logintoGithub(page); + await new Common(page).logintoGithub(); }); // Select two repos: one with an existing catalog.yaml file and another without it @@ -254,7 +254,7 @@ test.describe common = new Common(page); bulkimport = new BulkImport(page); catalogImport = new CatalogImport(page); - await Common.logintoGithub(page); + await new Common(page).logintoGithub(); }); test('Verify existing repo from app-config is displayed in bulk import Added repositories', async () => { @@ -299,7 +299,7 @@ test.describe uiHelper = new UIhelper(page); common = new Common(page); - await Common.logintoGithub(page); + await new Common(page).logintoGithub(); }); test('Bulk Import - Verify users without permission cannot access', async () => { diff --git a/e2e-tests/playwright/e2e/plugins/rbac/rbac-api.spec.ts b/e2e-tests/playwright/e2e/plugins/rbac/rbac-api.spec.ts index a74fd6c91a..c8a5b5ced4 100644 --- a/e2e-tests/playwright/e2e/plugins/rbac/rbac-api.spec.ts +++ b/e2e-tests/playwright/e2e/plugins/rbac/rbac-api.spec.ts @@ -14,7 +14,7 @@ test.describe('Test RBAC plugin REST API', () => { test.beforeEach(async ({ page }) => { uiHelper = new UIhelper(page); - await Common.logintoGithub(page); + await new Common(page).logintoGithub(); const apiToken = await RhdhAuthHack.getInstance().getApiToken(page); responseHelper = new Response(apiToken); }); diff --git a/e2e-tests/playwright/e2e/plugins/rbac/rbac.spec.ts b/e2e-tests/playwright/e2e/plugins/rbac/rbac.spec.ts index 4ad30d070a..5e8ae05117 100644 --- a/e2e-tests/playwright/e2e/plugins/rbac/rbac.spec.ts +++ b/e2e-tests/playwright/e2e/plugins/rbac/rbac.spec.ts @@ -20,9 +20,9 @@ test.describe let uiHelper: UIhelper; let page: Page; - test.beforeEach(async ({ page }, testInfo) => { + test.beforeEach(async ({ page }) => { uiHelper = new UIhelper(page); - await Common.logintoGithub(page); + await new Common(page).logintoGithub(); await uiHelper.openSidebarButton('Administration'); await uiHelper.openSidebar('RBAC'); await uiHelper.verifyHeading('RBAC'); diff --git a/e2e-tests/playwright/e2e/verify-tls-config-with-external-postgres-db.spec.ts b/e2e-tests/playwright/e2e/verify-tls-config-with-external-postgres-db.spec.ts index c27dc296aa..2781159618 100644 --- a/e2e-tests/playwright/e2e/verify-tls-config-with-external-postgres-db.spec.ts +++ b/e2e-tests/playwright/e2e/verify-tls-config-with-external-postgres-db.spec.ts @@ -7,7 +7,7 @@ test.describe('Verify TLS configuration with external Postgres DB', () => { page, }) => { const uiHelper = new UIhelper(page); - await Common.logintoGithub(page); + await new Common(page).logintoGithub(); await uiHelper.openSidebar('Catalog'); await uiHelper.selectMuiBox('Kind', 'Component'); await uiHelper.clickByDataTestId('user-picker-all');