Skip to content

Commit

Permalink
Use separate browser context
Browse files Browse the repository at this point in the history
  • Loading branch information
brojd committed Jun 6, 2024
1 parent 5f3fb0c commit 1389ebb
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -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');
Expand Down

0 comments on commit 1389ebb

Please sign in to comment.