Added UI acceptance for the telemetry section (#14456)
* Added auth to gitignore * Added a setup for logging in which allows us to save the token for the user * Added simple acceptance test for testing our api for the DataTypes * Added simple acceptance tests for testing the API for the PartialView section * Added simple acceptance tests for testing the API for the Script section * Added acceptance tests for testing the API for the Stylesheet section. * Added acceptance tests for testing the API for the User section * Bumped the version of our testhelpers! * Added acceptance tests for testing the API for the Dictionary section. * Added acceptance tests for testing the API for the Language section. * Added acceptance tests for testing the API for the UserGroups section. * Added acceptance tests for testing the API for the Template section * Added acceptance tests for testing the API for the TemporaryFiles section * Our first UI test for v14 Added acceptance tests for the telemetry section * Removed page.pause
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import {test} from '@umbraco/playwright-testhelpers';
|
||||
import {expect} from "@playwright/test";
|
||||
|
||||
test.describe('Telemetry tests', () => {
|
||||
|
||||
test.beforeEach(async ({page, umbracoApi}, testInfo) => {
|
||||
await umbracoApi.telemetry.setTelemetryLevel("Basic");
|
||||
});
|
||||
|
||||
test.afterEach(async ({page, umbracoApi}, testInfo) => {
|
||||
await umbracoApi.telemetry.setTelemetryLevel("Basic");
|
||||
});
|
||||
|
||||
test('can change telemetry level', async ({page, umbracoApi, umbracoUi}) => {
|
||||
const expectedLevel = "Minimal";
|
||||
|
||||
await page.goto(umbracoApi.baseUrl + '/umbraco');
|
||||
|
||||
// Selects minimal as the telemetry level
|
||||
await page.getByRole('tab', { name: 'Settings' }).click();
|
||||
await page.getByRole('tab', {name: 'Telemetry Data'}).click();
|
||||
await page.locator('[name="telemetryLevel"] >> input[id=input]').fill('1');
|
||||
await page.getByRole('button', { name: 'Save telemetry settings' }).click();
|
||||
|
||||
// Assert
|
||||
// UI
|
||||
await page.reload();
|
||||
await expect(await page.locator('[name="telemetryLevel"] >> input[id=input]')).toHaveValue('1');
|
||||
// API
|
||||
await expect(await umbracoApi.telemetry.checkTelemetryLevel(expectedLevel)).toBeTruthy();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user