From 1389ebb4a7d4b32ab60108e6582061048d37412f Mon Sep 17 00:00:00 2001 From: Dominik Date: Thu, 6 Jun 2024 06:31:07 +0200 Subject: [PATCH] Use separate browser context --- .../pluginInitialization/initialization.test.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/grafana-plugin/e2e-tests/pluginInitialization/initialization.test.ts b/grafana-plugin/e2e-tests/pluginInitialization/initialization.test.ts index 19b186229e..2c338a1429 100644 --- a/grafana-plugin/e2e-tests/pluginInitialization/initialization.test.ts +++ b/grafana-plugin/e2e-tests/pluginInitialization/initialization.test.ts @@ -43,7 +43,11 @@ test.describe('Plugin initialization', () => { await reloginAndWaitTillGrafanaIsLoaded({ page, username: GRAFANA_ADMIN_USERNAME }); }); - test('Plugin OnCall pages work for new viewer user right away', async ({ adminRolePage: { page } }) => { + // Separate browser context to not affect other tests that use logged in admin user in adminRolePage + test('Plugin OnCall pages work for new viewer user right away', async ({ page }) => { + // Login as admin + await reloginAndWaitTillGrafanaIsLoaded({ page, username: GRAFANA_ADMIN_USERNAME }); + // Create new editor user and login as new user const USER_NAME = `viewer-${new Date().getTime()}`; await createGrafanaUser({ page, username: USER_NAME, role: OrgRole.Viewer }); @@ -65,11 +69,10 @@ test.describe('Plugin initialization', () => { await expect(page.getByText('No Alert Groups selected')).toBeVisible(); }); - test('Extension registered by OnCall plugin works for new editor user right away', async ({ - adminRolePage: { page }, - }) => { - // Create new editor user and login as new user + test('Extension registered by OnCall plugin works for new editor user right away', async ({ page }) => { await reloginAndWaitTillGrafanaIsLoaded({ page, username: GRAFANA_ADMIN_USERNAME }); + + // Create new editor user and login as new user const USER_NAME = `editor-${new Date().getTime()}`; await createGrafanaUser({ page, username: USER_NAME, role: OrgRole.Editor }); await page.waitForLoadState('networkidle');