# What this PR does Lays ground work for #1586. Adds three new fixtures, `adminRolePage`, `editorRolePage`, and `viewerRolePage`. These fixtures can be easily accessed in a `test` context and allow the test to be run as a user authenticated with one of these Grafana basic roles. The bulk of the changes in the PR are to the "global setup" step. There is a bit of logic + communication with the Grafana instance's API, in order to create all the necessary authentication credentials. Lastly, adds the first basic role authorization test, asserting that Admin/Editors can view the list of OnCall users, whereas Viewers cannot. ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [ ] Documentation added (or `pr:no public docs` PR label added if not required) - [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required)
12 lines
546 B
TypeScript
12 lines
546 B
TypeScript
import { test, expect } from '../fixtures';
|
|
import { openCreateIntegrationModal } from '../utils/integrations';
|
|
|
|
test('integrations have unique names', async ({ adminRolePage }) => {
|
|
const { page } = adminRolePage;
|
|
await openCreateIntegrationModal(page);
|
|
|
|
const integrationNames = await page.getByTestId('integration-display-name').allInnerTexts();
|
|
const uniqueLowercasedIntegrationNames = new Set(integrationNames.map((elem) => elem.toLowerCase()));
|
|
|
|
expect(uniqueLowercasedIntegrationNames.size).toEqual(integrationNames.length);
|
|
});
|