Files
threshold-ui/e2e-tests/desktop/tests/settings.spec.js
T
hashicc 4ca519ce62 chore: add eslint-plugin-playwright rules for e2e tests and fix errors (#2680)
* chore: 🤖 add eslint-plugin-playwright

* chore: 🤖 add recommended eslint rules for playwright to config

* test: 💍 remove describe blocks with async functions

* fix errors related to playwright/valid-describe-callback rule

* test: 💍 fix all auto-fixable playwright rules tests
2025-02-12 12:39:16 -05:00

37 lines
1.3 KiB
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import { expect, test } from '../fixtures/baseTest.js';
test.describe('Settings Page tests', () => {
test.beforeEach(async ({ authedPage }) => {
await authedPage.getByRole('link', { name: 'Settings' }).click();
});
test('Navigates to settings page', async ({ authedPage }) => {
await expect(authedPage).toHaveURL(
/.*\/scopes\/global\/projects\/settings$/,
);
});
test('Signs out from settings page', async ({ authedPage }) => {
await authedPage.getByRole('button', { name: 'Sign Out' }).click();
await expect(authedPage).toHaveURL(/.*\/scopes\/global\/authenticate\//);
});
test('Changes log level', async ({ authedPage }) => {
await authedPage.getByLabel('Logging level').selectOption('warn');
// Navigate away and back
await authedPage.getByRole('link', { name: 'Targets' }).click();
await authedPage.getByRole('link', { name: 'Settings' }).click();
await expect(authedPage.getByLabel('Logging level')).toHaveValue('warn');
await authedPage.getByLabel('Logging level').selectOption('debug');
await expect(authedPage.getByLabel('Logging level')).toHaveValue('debug');
});
// TODO: Add some client agent tests? Need to figure out best solution to include client agent
});