Skip to content

Commit

Permalink
Merge branch 'brojd/plugin-initialization-improvements' into matias-e…
Browse files Browse the repository at this point in the history
…ngine-sync-with-dominik-improvements
  • Loading branch information
brojd committed Jun 27, 2024
2 parents e361d63 + 28ffbb3 commit eb32361
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import semver from 'semver';

import { test, expect } from '../fixtures';
import { OrgRole } from '../utils/constants';
import { goToGrafanaPage, goToOnCallPage } from '../utils/navigation';
Expand Down Expand Up @@ -34,6 +36,11 @@ test.describe('Plugin initialization', () => {
adminRolePage: { page },
browser,
}) => {
test.skip(
semver.lt(process.env.CURRENT_GRAFANA_VERSION, '10.3.0'),
'Extension is only available in Grafana 10.3.0 and above'
);

// Create new editor user
const USER_NAME = `editor-${new Date().getTime()}`;
await createGrafanaUser({ page, username: USER_NAME, role: OrgRole.Editor });
Expand Down
6 changes: 3 additions & 3 deletions grafana-plugin/e2e-tests/utils/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ export const createGrafanaUser = async ({

export const loginAndWaitTillGrafanaIsLoaded = async ({ page, username }: { page: Page; username: string }) => {
await goToGrafanaPage(page, '/login');
await page.getByLabel('Email or username').fill(username);
await page.getByLabel(/Password/).fill(username);
await clickButton({ page, buttonText: 'Log in' });
await page.getByPlaceholder(/Email or username/i).fill(username);
await page.getByPlaceholder(/Password/i).fill(username);
await page.locator('button[type="submit"]').click();

await page.getByText('Welcome to Grafana').waitFor();
await page.waitForLoadState('networkidle');
Expand Down

0 comments on commit eb32361

Please sign in to comment.