Skip to content

Commit

Permalink
test: unify test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
keita-determined committed Oct 31, 2024
1 parent ae13324 commit 4906931
Showing 1 changed file with 14 additions and 30 deletions.
44 changes: 14 additions & 30 deletions webui/react/src/e2e/tests/experimentList.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,20 @@ test.describe('Experiment List', () => {
});
});

test('Archive/Unarchive an experiment', async () => {
projectDetailsPage._page.setDefaultTimeout(60_000);

const row = projectDetailsPage.f_experimentList.dataGrid.getRowByIndex(0);

const experimentActionDropdown = await row.experimentActionDropdown.open();
await experimentActionDropdown.menuItem('Stop').pwLocator.click();
await expect((await row.getCellByColumnName('State')).pwLocator).toHaveText('canceled');
await experimentActionDropdown.menuItem('Archive').pwLocator.click();
await expect(experimentActionDropdown.menuItem('Unarchive').pwLocator).toBeVisible();
await experimentActionDropdown.menuItem('Unarchive').pwLocator.click();
await expect(experimentActionDropdown.menuItem('Archive').pwLocator).toBeVisible();
});

test.describe('Experiment List Pagination', () => {
test.beforeAll(({ newProject }) => {
Array(51)
Expand Down Expand Up @@ -677,35 +691,5 @@ test.describe('Experiment List', () => {
);
await expect(newProjectRows.length).toBe(1);
});

test('Archive an experiment', async () => {
if (experimentId === undefined) throw new Error('No experiment ID was found');

const newExperimentRow =
await projectDetailsPage.f_experimentList.dataGrid.getRowByColumnValue(
'ID',
experimentId.toString(),
);

const experimentActionDropdown = await newExperimentRow.experimentActionDropdown.open();

await experimentActionDropdown.menuItem('Archive').pwLocator.click();
await expect(experimentActionDropdown.menuItem('Unarchive').pwLocator).toBeVisible();
});

test('Unarchive an experiment', async () => {
if (experimentId === undefined) throw new Error('No experiment ID was found');

const newExperimentRow =
await projectDetailsPage.f_experimentList.dataGrid.getRowByColumnValue(
'ID',
experimentId.toString(),
);

const experimentActionDropdown = await newExperimentRow.experimentActionDropdown.open();

await experimentActionDropdown.menuItem('Unarchive').pwLocator.click();
await expect(experimentActionDropdown.menuItem('Archive').pwLocator).toBeVisible();
});
});
});

0 comments on commit 4906931

Please sign in to comment.