diff --git a/tests/integration/disable-write-actions.spec.ts b/tests/integration/disable-write-actions.spec.ts index 4799d285b..8303d36c5 100644 --- a/tests/integration/disable-write-actions.spec.ts +++ b/tests/integration/disable-write-actions.spec.ts @@ -14,9 +14,9 @@ test.describe('Enable write actions by default', () => { }); test('Cancel workflow button enabled', async ({ page }) => { - const workflowActionButton = page.locator( - '#workflow-actions-primary-button', - ); + const workflowActionButton = page + .locator('#workflow-actions-primary-button') + .locator('visible=true'); await expect(workflowActionButton).toBeEnabled(); }); }); @@ -29,9 +29,9 @@ test.describe('Disable write actions on workflow actions', () => { }); test('Cancel workflow button disabled', async ({ page }) => { - const workflowActionButton = page.locator( - '#workflow-actions-primary-button', - ); + const workflowActionButton = page + .locator('#workflow-actions-primary-button') + .locator('visible=true'); await expect(workflowActionButton).toBeDisabled(); }); }); diff --git a/tests/integration/workflow-actions.spec.ts b/tests/integration/workflow-actions.spec.ts index 88797c3e3..9c73eaa82 100644 --- a/tests/integration/workflow-actions.spec.ts +++ b/tests/integration/workflow-actions.spec.ts @@ -35,7 +35,9 @@ test.describe('Workflow Actions for a Completed Workflow', () => { }) => { await mockSettingsApi(page, { DisableWriteActions: true }); - await expect(page.getByTestId('workflow-reset-button')).toBeDisabled(); + await expect( + page.getByTestId('workflow-reset-button').locator('visible=true'), + ).toBeDisabled(); }); test('is disabled when reset is disabled via Settings API', async ({ @@ -43,7 +45,9 @@ test.describe('Workflow Actions for a Completed Workflow', () => { }) => { await mockSettingsApi(page, { WorkflowResetDisabled: true }); - await expect(page.getByTestId('workflow-reset-button')).toBeDisabled(); + await expect( + page.getByTestId('workflow-reset-button').locator('visible=true'), + ).toBeDisabled(); }); test('allows reapplying signals after the reset point', async ({ @@ -51,8 +55,14 @@ test.describe('Workflow Actions for a Completed Workflow', () => { }) => { const requestPromise = page.waitForRequest(WORKFLOW_RESET_API); - await page.getByTestId('workflow-reset-button').click(); - await page.getByTestId('workflow-reset-event-id-select-button').click(); + await page + .getByTestId('workflow-reset-button') + .locator('visible=true') + .click(); + await page + .getByTestId('workflow-reset-event-id-select-button') + .locator('visible=true') + .click(); await page .locator('#reset-event-id-select') .locator('[role="option"]') @@ -77,8 +87,14 @@ test.describe('Workflow Actions for a Completed Workflow', () => { }) => { const requestPromise = page.waitForRequest(WORKFLOW_RESET_API); - await page.getByTestId('workflow-reset-button').click(); - await page.getByTestId('workflow-reset-event-id-select-button').click(); + await page + .getByTestId('workflow-reset-button') + .locator('visible=true') + .click(); + await page + .getByTestId('workflow-reset-event-id-select-button') + .locator('visible=true') + .click(); await page .locator('#reset-event-id-select') .locator('[role="option"]') @@ -115,8 +131,14 @@ test.describe('Workflow Actions for a Completed Workflow', () => { }) => { const requestPromise = page.waitForRequest(WORKFLOW_RESET_API); - await page.getByTestId('workflow-reset-button').click(); - await page.getByTestId('workflow-reset-event-id-select-button').click(); + await page + .getByTestId('workflow-reset-button') + .locator('visible=true') + .click(); + await page + .getByTestId('workflow-reset-event-id-select-button') + .locator('visible=true') + .click(); await page .locator('#reset-event-id-select') .locator('[role="option"]') @@ -141,8 +163,14 @@ test.describe('Workflow Actions for a Completed Workflow', () => { test('Allows excluding Signals after the reset point', async ({ page }) => { const requestPromise = page.waitForRequest(WORKFLOW_RESET_API); - await page.getByTestId('workflow-reset-button').click(); - await page.getByTestId('workflow-reset-event-id-select-button').click(); + await page + .getByTestId('workflow-reset-button') + .locator('visible=true') + .click(); + await page + .getByTestId('workflow-reset-event-id-select-button') + .locator('visible=true') + .click(); await page .locator('#reset-event-id-select') .locator('[role="option"]') @@ -169,8 +197,14 @@ test.describe('Workflow Actions for a Completed Workflow', () => { test('Allows excluding Updates after the reset point', async ({ page }) => { const requestPromise = page.waitForRequest(WORKFLOW_RESET_API); - await page.getByTestId('workflow-reset-button').click(); - await page.getByTestId('workflow-reset-event-id-select-button').click(); + await page + .getByTestId('workflow-reset-button') + .locator('visible=true') + .click(); + await page + .getByTestId('workflow-reset-event-id-select-button') + .locator('visible=true') + .click(); await page .locator('#reset-event-id-select') .locator('[role="option"]') @@ -216,10 +250,12 @@ test.describe('Workflow actions for a Running Workflow', () => { }) => { await mockSettingsApi(page, { DisableWriteActions: true }); - await expect(page.locator('#workflow-actions-menu-button')).toBeDisabled(); + await expect( + page.locator('#workflow-actions-menu-button').locator('visible=true'), + ).toBeDisabled(); await expect( - page.locator('#workflow-actions-primary-button'), + page.locator('#workflow-actions-primary-button').locator('visible=true'), ).toBeDisabled(); }); @@ -230,21 +266,35 @@ test.describe('Workflow actions for a Running Workflow', () => { await mockSettingsApi(page, { WorkflowCancelDisabled: true }); await expect( - page.locator('#workflow-actions-primary-button'), + page + .locator('#workflow-actions-primary-button') + .locator('visible=true'), ).toBeDisabled(); - await page.locator('#workflow-actions-menu-button').click(); + await page + .locator('#workflow-actions-menu-button') + .locator('visible=true') + .click(); await expect( - page.locator('#workflow-actions-menu').getByText('Send a Signal'), + page + .locator('#workflow-actions-menu') + .locator('visible=true') + .getByText('Send a Signal'), ).toBeEnabled(); await expect( - page.locator('#workflow-actions-menu').getByText('Terminate'), + page + .locator('#workflow-actions-menu') + .locator('visible=true') + .getByText('Terminate'), ).toBeEnabled(); await expect( - page.locator('#workflow-actions-menu').getByText('Reset'), + page + .locator('#workflow-actions-menu') + .locator('visible=true') + .getByText('Reset'), ).toBeEnabled(); }); }); @@ -256,21 +306,35 @@ test.describe('Workflow actions for a Running Workflow', () => { await mockSettingsApi(page, { WorkflowTerminateDisabled: true }); await expect( - page.locator('#workflow-actions-primary-button'), + page + .locator('#workflow-actions-primary-button') + .locator('visible=true'), ).toBeEnabled(); - await page.locator('#workflow-actions-menu-button').click(); + await page + .locator('#workflow-actions-menu-button') + .locator('visible=true') + .click(); await expect( - page.locator('#workflow-actions-menu').getByText('Send a Signal'), + page + .locator('#workflow-actions-menu') + .locator('visible=true') + .getByText('Send a Signal'), ).toBeEnabled(); await expect( - page.locator('#workflow-actions-menu').getByText('Terminate'), + page + .locator('#workflow-actions-menu') + .locator('visible=true') + .getByText('Terminate'), ).toBeDisabled(); await expect( - page.locator('#workflow-actions-menu').getByText('Reset'), + page + .locator('#workflow-actions-menu') + .locator('visible=true') + .getByText('Reset'), ).toBeEnabled(); }); }); @@ -282,21 +346,35 @@ test.describe('Workflow actions for a Running Workflow', () => { await mockSettingsApi(page, { WorkflowSignalDisabled: true }); await expect( - page.locator('#workflow-actions-primary-button'), + page + .locator('#workflow-actions-primary-button') + .locator('visible=true'), ).toBeEnabled(); - await page.locator('#workflow-actions-menu-button').click(); + await page + .locator('#workflow-actions-menu-button') + .locator('visible=true') + .click(); await expect( - page.locator('#workflow-actions-menu').getByText('Send a Signal'), + page + .locator('#workflow-actions-menu') + .locator('visible=true') + .getByText('Send a Signal'), ).toBeDisabled(); await expect( - page.locator('#workflow-actions-menu').getByText('Terminate'), + page + .locator('#workflow-actions-menu') + .locator('visible=true') + .getByText('Terminate'), ).toBeEnabled(); await expect( - page.locator('#workflow-actions-menu').getByText('Reset'), + page + .locator('#workflow-actions-menu') + .locator('visible=true') + .getByText('Reset'), ).toBeEnabled(); }); });