Playwright: Acceptance tests (#108770)

* create a set of acceptance tests to run with bench

* move tests back, fix login tests to work with supplied credentials:

* rename files again

* rename skip message
This commit is contained in:
Josh Hunt
2025-07-28 17:32:18 +01:00
committed by GitHub
parent 672e6d08bf
commit a009da2087
6 changed files with 59 additions and 35 deletions
@@ -0,0 +1,40 @@
import { test, expect } from '@grafana/plugin-e2e';
test(
'Can login successfully',
{
tag: ['@acceptance'],
},
async ({ selectors, page, grafanaAPICredentials }) => {
test.skip(grafanaAPICredentials.password === 'admin', 'Does not run with default password');
await page.goto(selectors.pages.Login.url);
await page.getByTestId(selectors.pages.Login.username).fill(grafanaAPICredentials.user);
await page.getByTestId(selectors.pages.Login.password).fill(grafanaAPICredentials.password);
await page.getByTestId(selectors.pages.Login.submit).click();
await expect(page.getByTestId(selectors.components.NavToolbar.commandPaletteTrigger)).toBeVisible();
}
);
test(
'Can login successfully and skip password change',
{
tag: ['@acceptance'],
},
async ({ selectors, page, grafanaAPICredentials }) => {
test.skip(grafanaAPICredentials.password !== 'admin', 'Only runs with the default password');
await page.goto(selectors.pages.Login.url);
await page.getByTestId(selectors.pages.Login.username).fill(grafanaAPICredentials.user);
await page.getByTestId(selectors.pages.Login.password).fill(grafanaAPICredentials.password);
await page.getByTestId(selectors.pages.Login.submit).click();
await page.getByTestId(selectors.pages.Login.skip).click();
await expect(page.getByTestId(selectors.components.NavToolbar.commandPaletteTrigger)).toBeVisible();
}
);