# What this PR does There are the following tests added: - admin is allowed to edit other profiles - editor is not allowed to edit other profiles ## Which issue(s) this PR fixes https://github.com/grafana/oncall/issues/1586 ## 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) --------- Co-authored-by: Rares Mardare <rares.mardare@grafana.com>
12 lines
589 B
TypeScript
12 lines
589 B
TypeScript
import type { Page, Response } from '@playwright/test';
|
|
import { BASE_URL } from './constants';
|
|
|
|
type GrafanaPage = '/plugins/grafana-oncall-app';
|
|
type OnCallPage = 'alert-groups' | 'integrations' | 'escalations' | 'schedules' | 'users';
|
|
|
|
const _goToPage = (page: Page, url = ''): Promise<Response> => page.goto(`${BASE_URL}${url}`);
|
|
|
|
export const goToGrafanaPage = (page: Page, url: GrafanaPage): Promise<Response> => _goToPage(page, url);
|
|
|
|
export const goToOnCallPage = (page: Page, onCallPage: OnCallPage): Promise<Response> =>
|
|
_goToPage(page, `/a/grafana-oncall-app/${onCallPage}`);
|