Skip to content

Commit 9f61d7a

Browse files
authored
try to fix flaky bpmn (axonivy#780)
1 parent af82dc0 commit 9f61d7a

File tree

4 files changed

+17
-22
lines changed

4 files changed

+17
-22
lines changed

extension/src/project-explorer/import-process.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import * as vscode from 'vscode';
22
import { ImportProcessBody } from '../engine/api/generated/client';
33
import { IvyEngineManager } from '../engine/engine-manager';
44

5-
export const importNewProcess = async (selectedUri: vscode.Uri, projectDir: string) => {
6-
const input = await collectImportBpmnProcessParams(selectedUri, projectDir);
5+
export const importNewProcess = async (projectDir: string) => {
6+
const input = await collectImportBpmnProcessParams(projectDir);
77
if (input) {
88
await IvyEngineManager.instance.createProcessFromBpmn(input);
99
}
1010
};
1111

12-
const collectImportBpmnProcessParams = async (selectedUri: vscode.Uri, projectDir: string): Promise<ImportProcessBody> => {
12+
const collectImportBpmnProcessParams = async (projectDir: string): Promise<ImportProcessBody> => {
1313
const bpmnXmlFile = await vscode.window.showOpenDialog({
1414
canSelectMany: false,
1515
openLabel: 'Select BPMN XML File to Import'

extension/src/project-explorer/ivy-project-explorer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export class IvyProjectExplorer {
126126
public async importBpmnProcess(selection: TreeSelection) {
127127
const projectPath = await treeSelectionToProjectPath(selection, this.getIvyProjects());
128128
if (projectPath) {
129-
await importNewProcess(await treeSelectionToUri(selection), projectPath);
129+
await importNewProcess(projectPath);
130130
return;
131131
}
132132
vscode.window.showErrorMessage('Import BPMN Process: no valid Axon Ivy Project selected.');

playwright/tests/import-process.spec.ts

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,14 @@ import { test } from './fixtures/baseTest';
22
import { FileExplorer } from './page-objects/explorer-view';
33
import { ProcessEditor } from './page-objects/process-editor';
44

5-
test.describe('Create Process', () => {
6-
let explorer: FileExplorer;
7-
let processEditor: ProcessEditor;
5+
test('Import BPMN Process', async ({ page }) => {
6+
const processEditor = new ProcessEditor(page);
7+
await processEditor.hasDeployProjectStatusMessage();
8+
const explorer = new FileExplorer(page);
9+
await explorer.selectNode('processes');
810

9-
test.beforeEach(async ({ page }) => {
10-
explorer = new FileExplorer(page);
11-
processEditor = new ProcessEditor(page);
12-
await processEditor.hasDeployProjectStatusMessage();
13-
await explorer.selectNode('processes');
14-
});
15-
16-
test('Import BPMN Process', async () => {
17-
await explorer.selectNode('resources');
18-
await explorer.selectNode('all_elements_diagram.bpmn');
19-
await explorer.importBpmnProcess('resources/all_elements_diagram.bpmn');
20-
await explorer.hasNode(`all_elements_diagram.p.json`);
21-
});
11+
await explorer.selectNode('resources');
12+
await explorer.selectNode('all_elements_diagram.bpmn');
13+
await explorer.importBpmnProcess('resources/all_elements_diagram.bpmn');
14+
await explorer.hasNode(`all_elements_diagram.p.json`);
2215
});

playwright/tests/page-objects/page-object.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ export class PageObject {
4343

4444
async provideUserInput(input?: string) {
4545
if (input) {
46-
await this.quickInputBox().locator('input.input').fill(input);
46+
const textBox = this.quickInputBox().getByRole('textbox');
47+
await textBox.fill(input);
48+
await expect(textBox).toHaveValue(input);
4749
}
4850
await this.quickInputBox().click({ delay: 100 });
49-
await this.quickInputBox().press('Enter');
51+
await this.quickInputBox().press('Enter', { delay: 100 });
5052
}
5153

5254
async closeAllTabs() {

0 commit comments

Comments
 (0)