The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/e2e/plugin-e2e/plugin-e2e-api-tests/as-viewer-user/permissions.spec.ts

16 lines
709 B

import { expect, test } from '@grafana/plugin-e2e';
test('should redirect to start page when permissions to navigate to page is missing', async ({ page }) => {
await page.goto('/');
const homePageURL = new URL(page.url());
await page.goto('/datasources', { waitUntil: 'networkidle' });
const redirectedPageURL = new URL(page.url());
expect(homePageURL.pathname).toEqual(redirectedPageURL.pathname);
});
test('current user should have viewer role', async ({ page, request }) => {
await page.goto('/');
const response = await request.get('/api/user/orgs');
await expect(response).toBeOK();
await expect(await response.json()).toContainEqual(expect.objectContaining({ role: 'Viewer' }));
});