Skip to content

Commit 2b28130

Browse files
committed
Minor improvements on tests
1 parent 21a17bd commit 2b28130

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

tests/v2/admin_groups.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ test('Admin groups management', async ({ page }) => {
9595
}
9696
await modal.getByRole('button', { name: 'Add' }).click();
9797
await waitModalClosed(page);
98-
finalCount = selectableGroups.length + 2;
98+
finalCount = selectableGroups1 + 2;
9999
await expect(groupBadges).toHaveCount(finalCount);
100100
await expect(page.getByRole('button', { name: 'Add group' })).not.toBeVisible();
101101
});

tests/v2/admin_jobs.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ test('Execute a job and show it on the job tables [v2]', async ({ page, request
100100

101101
await test.step('Search running jobs', async () => {
102102
await page.getByText('Reset').click();
103-
await page.selectOption('#status', 'submitted');
103+
await page.getByRole('combobox', { name: 'Status' }).selectOption('submitted');
104+
await page.getByRole('spinbutton', { name: 'Project Id' }).fill(workflow2.projectId || '');
105+
await page.getByRole('spinbutton', { name: 'Workflow Id' }).fill(workflow2.workflowId || '');
104106
await search(page);
105107
const statuses = page.locator('table tbody tr td:nth-child(2)');
106108
await expect(statuses).toHaveCount(1);

tests/v2/run_mock_tasks.spec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,16 @@ test('Run mock tasks [v2]', async ({ page, workflow }) => {
259259
expect(await page.locator('table tbody tr').count()).toEqual(5);
260260
});
261261

262+
await test.step('Ensure jobs are ended', async () => {
263+
const running = await page.getByRole('row', { name: 'submitted' }).count();
264+
if (running > 0) {
265+
console.warn(
266+
`WARNING: waiting for the completion of a job that should have already been completed!`
267+
);
268+
await expect(page.getByRole('row', { name: 'submitted' })).toHaveCount(0, { timeout: 10000 });
269+
}
270+
});
271+
262272
/** @type {string|null} */
263273
let jobId = null;
264274
await test.step('Open Info modal', async () => {

0 commit comments

Comments
 (0)