-
Notifications
You must be signed in to change notification settings - Fork 437
RI-8039 [E2E] 7.3 Settings -> Workbench Settings #5593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
08bc78f
c0ee55c
31acf48
cec6055
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| import { test, expect } from '../../../../fixtures/base'; | ||
|
|
||
| /** | ||
| * Workbench Settings tests (TEST_PLAN.md: 7.3 Workbench Settings) | ||
| * | ||
| * Verifies Workbench section controls are visible and that changing | ||
| * editor cleanup and pipeline commands settings persists after navigation. | ||
| * | ||
| * Note: "Configure command timeout" is N/A -- it's a per-database setting, not on the Settings page. | ||
| */ | ||
| test.describe('Workbench Settings', () => { | ||
| test.beforeEach(async ({ settingsPage }) => { | ||
| await settingsPage.goto(); | ||
| }); | ||
|
|
||
| test('should show editor cleanup switch', async ({ settingsPage }) => { | ||
| await settingsPage.expandWorkbench(); | ||
| await expect(settingsPage.editorCleanupSwitch).toBeVisible(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. haven't tested it, but if it's easy, it makes sense to add a test that executes something in the workbench so we can validate the switch logic |
||
| }); | ||
|
|
||
| test('should show pipeline commands setting', async ({ settingsPage }) => { | ||
| await settingsPage.expandWorkbench(); | ||
| await expect(settingsPage.pipelineCommandsText).toBeVisible(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and for that one too (I imagine we can set it to 2, and validate just a single command is visible)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think these should be tested here. The test must verify that you can change and save settings. How they affect the related feature, that should be tested as part of that feautre's tests |
||
| }); | ||
|
|
||
| test('should save editor cleanup when toggled', async ({ | ||
| settingsPage, | ||
| databasesPage, | ||
| }) => { | ||
| await settingsPage.expandWorkbench(); | ||
| await expect(settingsPage.editorCleanupSwitch).toBeVisible(); | ||
|
|
||
| const initialState = await settingsPage.isEditorCleanupEnabled(); | ||
| await settingsPage.toggleEditorCleanup(); | ||
| const toggledState = await settingsPage.isEditorCleanupEnabled(); | ||
| expect(toggledState).toBe(!initialState); | ||
|
|
||
| await databasesPage.goto(); | ||
| await settingsPage.goto(); | ||
| await settingsPage.expandWorkbench(); | ||
| const persistedState = await settingsPage.isEditorCleanupEnabled(); | ||
| expect(persistedState).toBe(toggledState); | ||
|
|
||
| await settingsPage.toggleEditorCleanup(); | ||
| const restoredState = await settingsPage.isEditorCleanupEnabled(); | ||
| expect(restoredState).toBe(initialState); | ||
| }); | ||
|
|
||
| test('should save pipeline commands when changed', async ({ | ||
| settingsPage, | ||
| databasesPage, | ||
| }) => { | ||
| await settingsPage.expandWorkbench(); | ||
| await expect(settingsPage.pipelineCommandsValue).toBeVisible(); | ||
|
|
||
| const initialValue = await settingsPage.getPipelineCommandsValue(); | ||
| await settingsPage.setPipelineCommandsAndApply(2); | ||
| await expect(settingsPage.pipelineCommandsValue).toHaveText('2'); | ||
|
|
||
| await databasesPage.goto(); | ||
| await settingsPage.goto(); | ||
| await settingsPage.expandWorkbench(); | ||
| const persistedValue = await settingsPage.getPipelineCommandsValue(); | ||
| expect(persistedValue.trim()).toBe('2'); | ||
|
|
||
| const restoreValue = initialValue.trim() ? parseInt(initialValue, 10) : 5; | ||
| await settingsPage.setPipelineCommandsAndApply(restoreValue); | ||
| await expect(settingsPage.pipelineCommandsValue).toHaveText( | ||
| String(restoreValue), | ||
| ); | ||
| }); | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-scoped
apply-btnlocator matches multiple componentsLow Severity
The
pipelineApplyButtonlocator usespage.getByTestId('apply-btn'), which is a page-wide selector for a generic test ID shared by everyInlineItemEditorinstance in the app. The Advanced settings section also uses aSettingItem(which wrapsInlineItemEditorwith its ownapply-btn). If both sections are ever expanded and one enters edit mode unexpectedly, this locator could match the wrong button. A scoped locator — e.g., chaining off the pipeline container — would be more resilient.