Files
grafana/e2e/plugin-e2e/plugin-e2e-api-tests/as-viewer-user/permissions.spec.ts
Ivan Ortega Alba 7bca69849f Dashboards: Enable scenes by default (#93818)
* Mark Scenes feature toggles as GA

* Move old arch e2e to a new folder

* Run E2E on scenes by default

* Upgrade e2e-selectors to ensure the tests in Playwright works
2024-09-30 10:49:02 +01:00

17 lines
709 B
TypeScript

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' }));
});