Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ivy-lli committed Jan 6, 2025
1 parent f78840f commit d6d1066
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DeepPartial } from 'test-utils';
import { render, screen, TableUtil, renderHook, waitFor, CollapsableUtil } from 'test-utils';
import { render, screen, TableUtil, renderHook, CollapsableUtil } from 'test-utils';
import { useOutputPart } from './OutputPart';
import type { PartStateFlag } from '../../editors/part/usePart';
import type { ElementData, OutputData } from '@axonivy/process-editor-inscription-protocol';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@ export class ResponsibleComponent {
this.select = new Select(part.page, locator, { nth: 1 });
}

async fill(type: ValuesAsUnion<typeof RESPONSIBLE_TYPE>, responsible?: string) {
async fill(type: ValuesAsUnion<typeof RESPONSIBLE_TYPE>, responsible = '') {
await this.typeSelect.choose(type);
switch (type) {
case 'Role from Attr.':
case 'User from Attr.':
await this.script.fill(responsible!);
await this.script.fill(responsible);
break;
case 'Role':
await this.select.choose(responsible!);
await this.select.choose(responsible);
break;
case 'Nobody & delete':
}
}

async expectFill(type: ValuesAsUnion<typeof RESPONSIBLE_TYPE>, responsible?: string) {
async expectFill(type: ValuesAsUnion<typeof RESPONSIBLE_TYPE>, responsible = '') {
await this.typeSelect.expectValue(type);
switch (type) {
case 'Role from Attr.':
case 'User from Attr.':
await this.script.expectValue(responsible!);
await this.script.expectValue(responsible);
break;
case 'Role':
await this.select.expectValue(responsible!);
await this.select.expectValue(responsible);
break;
case 'Nobody & delete':
}
Expand Down
6 changes: 4 additions & 2 deletions playwright/tests/screenshots/editor/editor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ test('connector-user', async ({ page }) => {
const editor = await ProcessEditor.openProcess(page, { file: '/processes/market/UserEnroll.p.json', waitFor: '.sprotty-graph' });
const subCall = editor.element('subProcessCall');
const inscription = await subCall.inscribe();
await expect(subCall.locator().getByRole('img').first()).toHaveAttribute('src', /.+user.png/);
await page.waitForTimeout(1000); // wait for user.png being rendered
const img = subCall.locator().getByRole('img').first();
await expect(img).toHaveJSProperty('complete', true);
await expect(img).not.toHaveJSProperty('naturalWidth', 0);
// await page.waitForTimeout(1000); // wait for user.png being rendered
const process = inscription.accordion('Process');
await process.toggle();
await screenshot(page, 'connector-user.png', { height: 400 });
Expand Down
1 change: 1 addition & 0 deletions playwright/tests/viewer/read-only.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ test('node removal disabled', async ({ page }) => {
const start = processEditor.startElement;
await start.select();
await page.keyboard.press('Delete');
// eslint-disable-next-line playwright/no-wait-for-timeout
await page.waitForTimeout(500);
await start.isSelected();
});

0 comments on commit d6d1066

Please sign in to comment.