Skip to content

Commit 36b6f78

Browse files
committed
Added more tests
1 parent 3846ed5 commit 36b6f78

File tree

2 files changed

+89
-1
lines changed

2 files changed

+89
-1
lines changed

tests/v2/run_workflow_type_filters_priority.spec.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { getSlimSelectValues, waitModalClosed, waitPageLoading } from '../utils.js';
1+
import {
2+
getSlimSelectValues,
3+
selectSlimSelect,
4+
waitModalClosed,
5+
waitPageLoading
6+
} from '../utils.js';
27
import { createDataset } from './dataset_utils.js';
38
import { expect, test } from './workflow_fixture.js';
49
import { waitTaskSubmitted, waitTasksSuccess } from './workflow_task_utils.js';
@@ -70,6 +75,19 @@ test('Type filters priority in run workflow modal', async ({ page, workflow }) =
7075
).toBeVisible();
7176
});
7277

78+
await test.step('Select type and check confirm result', async () => {
79+
await selectSlimSelect(page, modal.getByLabel('Selector for type 3D'), 'True');
80+
await modal.getByRole('button', { name: 'Apply' }).click();
81+
await expect(modal.getByText('Total results: 2')).toBeVisible();
82+
await modal.getByRole('button', { name: 'Run' }).click();
83+
await expect(modal.getByText('Applied filters')).toBeVisible();
84+
await expect(
85+
modal.locator('li').filter({ hasText: '3D:' }).locator('[aria-checked="true"]')
86+
).toBeVisible();
87+
await modal.getByRole('button', { name: 'Cancel' }).click();
88+
await expect(modal.getByRole('button', { name: 'Run' })).toBeVisible();
89+
});
90+
7391
await test.step('Check selected filters for MIP_compound', async () => {
7492
await modal.getByRole('combobox', { name: 'Start workflow at' }).selectOption('MIP_compound');
7593
await expect(
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import { expect, test } from './workflow_fixture.js';
2+
import {
3+
getSlimSelectValues,
4+
selectSlimSelect,
5+
waitModalClosed,
6+
waitPageLoading
7+
} from '../utils.js';
8+
import { createDataset } from './dataset_utils.js';
9+
import { waitTasksSuccess } from './workflow_task_utils.js';
10+
11+
test('Workflow type filters selection in images status modal', async ({ page, workflow }) => {
12+
await page.waitForURL(workflow.url);
13+
await waitPageLoading(page);
14+
15+
test.slow();
16+
const modal = page.locator('.modal.show');
17+
18+
/** @type {string} */
19+
let zarrDir;
20+
await test.step('Create test dataset', async () => {
21+
const dataset = await createDataset(page, workflow.projectId);
22+
zarrDir = dataset.zarrDir;
23+
});
24+
25+
await test.step('Open workflow page and configure tasks', async () => {
26+
await page.goto(workflow.url);
27+
await waitPageLoading(page);
28+
await workflow.addTask('create_ome_zarr_compound');
29+
await workflow.addTask('cellpose_segmentation');
30+
await workflow.addTask('MIP_compound');
31+
await workflow.selectTask('create_ome_zarr_compound');
32+
await page.getByRole('textbox', { name: 'Image Dir' }).fill(zarrDir);
33+
await page.getByRole('spinbutton', { name: 'Num Images' }).fill('2');
34+
await page.getByRole('button', { name: 'Save changes' }).click();
35+
await expect(page.getByRole('button', { name: 'Save changes' })).toBeDisabled();
36+
});
37+
38+
await test.step('Run workflow', async () => {
39+
await page.getByRole('button', { name: 'Run workflow' }).click();
40+
await modal.waitFor();
41+
await modal.getByRole('button', { name: 'Run' }).click();
42+
await modal.getByRole('button', { name: 'Confirm' }).click();
43+
await waitModalClosed(page);
44+
await waitTasksSuccess(page);
45+
});
46+
47+
await test.step('Open cellpose_segmentation images modal', async () => {
48+
await page.getByLabel('Done images').first().click();
49+
await modal.waitFor();
50+
await expect(modal.getByLabel('Selector for type 3D')).toBeEnabled();
51+
await expect(modal.getByText('Total results: 4')).toBeVisible();
52+
await selectSlimSelect(page, modal.getByLabel('Selector for type 3D'), 'False');
53+
await modal.getByRole('button', { name: 'Apply' }).click();
54+
await expect(modal.getByText('Total results: 2')).toBeVisible();
55+
await modal.getByRole('button', { name: 'Close' }).click();
56+
await waitModalClosed(page);
57+
});
58+
59+
await test.step('Open MIP_compound images modal', async () => {
60+
await page.getByLabel('Done images').nth(1).click();
61+
await modal.waitFor();
62+
await expect(modal.getByLabel('Selector for type 3D')).toHaveClass(/ss-disabled/);
63+
await expect(modal.getByText('Total results: 2')).toBeVisible();
64+
const selectedValues = await getSlimSelectValues(
65+
page,
66+
modal.getByLabel('Selector for type 3D')
67+
);
68+
expect(selectedValues).toEqual(['True']);
69+
});
70+
});

0 commit comments

Comments
 (0)