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:
@@ -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();
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user