Fix e2e tests (#11565)

Fixing the e2e tests
This commit is contained in:
Baptiste Devessier
2025-04-14 17:47:57 +02:00
committed by GitHub
parent 8a3f8ef324
commit 0be700f376
5 changed files with 49 additions and 41 deletions

View File

@ -17,6 +17,7 @@ export class WorkflowVisualizerPage {
readonly deactivateWorkflowButton: Locator;
readonly addTriggerButton: Locator;
readonly commandMenu: Locator;
readonly stepHeaderInCommandMenu: Locator;
readonly workflowNameLabel: Locator;
readonly triggerNode: Locator;
readonly background: Locator;
@ -68,6 +69,9 @@ export class WorkflowVisualizerPage {
});
this.addTriggerButton = page.getByText('Add a Trigger');
this.commandMenu = page.getByTestId('command-menu');
this.stepHeaderInCommandMenu = this.commandMenu.getByTestId(
'workflow-step-header',
);
this.workflowNameLabel = page
.getByTestId('top-bar-title')
.getByText(this.workflowName);

View File

@ -110,6 +110,10 @@ export class SettingsPage {
await this.releasesLink.click();
}
async logout() {
await this.page.getByText('Logout').click();
}
async toggleAdvancedSettings() {
await this.advancedToggle.click();
}

View File

@ -10,7 +10,9 @@ test('Create workflow', async ({ page }) => {
const workflowsLink = page.getByRole('link', { name: 'Workflows' });
await workflowsLink.click();
const createWorkflowButton = page.getByRole('button', { name: 'New record' });
const createWorkflowButton = page.getByRole('button', {
name: 'Create new workflow',
});
const [createWorkflowResponse] = await Promise.all([
page.waitForResponse(async (response) => {

View File

@ -1,60 +1,58 @@
import { expect } from '@playwright/test';
import { test } from '../lib/fixtures/blank-workflow';
test.fixme(
'The workflow run visualizer shows the executed draft version without the last draft changes',
async ({ workflowVisualizer, page }) => {
await workflowVisualizer.createInitialTrigger('manual');
test('The workflow run visualizer shows the executed draft version without the last draft changes', async ({
workflowVisualizer,
page,
}) => {
await workflowVisualizer.createInitialTrigger('manual');
const manualTriggerAvailabilitySelect = page.getByRole('button', {
name: 'When record(s) are selected',
});
const manualTriggerAvailabilitySelect = page.getByRole('button', {
name: 'When record(s) are selected',
});
await manualTriggerAvailabilitySelect.click();
await manualTriggerAvailabilitySelect.click();
const alwaysAvailableOption = page.getByText(
'When no record(s) are selected',
);
const alwaysAvailableOption = page.getByText(
'When no record(s) are selected',
);
await alwaysAvailableOption.click();
await alwaysAvailableOption.click();
await workflowVisualizer.closeSidePanel();
await workflowVisualizer.closeSidePanel();
const { createdStepId: firstStepId } =
await workflowVisualizer.createStep('create-record');
const { createdStepId: firstStepId } =
await workflowVisualizer.createStep('create-record');
await workflowVisualizer.closeSidePanel();
await workflowVisualizer.closeSidePanel();
const launchTestButton = page.getByLabel('Test Workflow');
const launchTestButton = page.getByLabel(workflowVisualizer.workflowName);
await launchTestButton.click();
await launchTestButton.click();
const goToExecutionPageLink = page.getByRole('link', {
name: 'View execution details',
});
const executionPageUrl = await goToExecutionPageLink.getAttribute('href');
expect(executionPageUrl).not.toBeNull();
const goToExecutionPageLink = page.getByRole('link', {
name: 'View execution details',
});
const executionPageUrl = await goToExecutionPageLink.getAttribute('href');
expect(executionPageUrl).not.toBeNull();
await workflowVisualizer.deleteStep(firstStepId);
await workflowVisualizer.deleteStep(firstStepId);
await page.goto(executionPageUrl!);
await page.goto(executionPageUrl!);
const workflowRunName = page.getByText('Execution of v1');
const workflowRunName = page.getByText(
`#1 - ${workflowVisualizer.workflowName}`,
);
await expect(workflowRunName).toBeVisible();
await expect(workflowRunName).toBeVisible();
const flowTab = page.getByText('Flow', { exact: true });
const executedFirstStepNode = workflowVisualizer.getStepNode(firstStepId);
await flowTab.click();
await expect(executedFirstStepNode).toBeVisible();
const executedFirstStepNode = workflowVisualizer.getStepNode(firstStepId);
await executedFirstStepNode.click();
await expect(executedFirstStepNode).toBeVisible();
await executedFirstStepNode.click();
await expect(
workflowVisualizer.commandMenu.getByRole('textbox').first(),
).toHaveValue('Create Record');
},
);
await expect(workflowVisualizer.stepHeaderInCommandMenu).toContainText(
'Create Record',
);
});

View File

@ -90,7 +90,7 @@ export const WorkflowStepHeader = ({
};
return (
<StyledHeader>
<StyledHeader data-testid="workflow-step-header">
<StyledHeaderIconContainer>
<Icon
color={iconColor}