test: 💍 Add some settings page tests (#2538)

This commit is contained in:
Zhihe Li authored and GitHub committed 2024-10-28 15:10:54 -04:00
1 parent 01a2d8e9a6
commit 788df7b16d
2 files changed
+24 -2

No files matched your search

@@ -109,6 +109,7 @@ exports.electronTest = test.extend({
env: {
NODE_ENV: 'test',
BYPASS_APP_UPDATER: true,
...process.env,
},
...options,
});
+23 -2
View File
@@ -6,11 +6,32 @@
const { test } = require('./fixtures/baseTest');
const { expect } = require('@playwright/test');
test.describe.fixme('Settings Page tests', async () => {
test('Navigates to settings page', async ({ authedPage }) => {
test.describe('Settings Page tests', async () => {
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
});