Skip to content

Commit

Permalink
fix deselect logic for e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
ashtonG committed Nov 5, 2024
1 parent 1ddbd76 commit c48f016
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions webui/react/src/e2e/models/components/TableActionBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class TableActionBar extends NamedComponent {
heatmapToggle = new BaseComponent({ parent: this, selector: '[data-test="heatmapToggle"]' });
compare = new BaseComponent({ parent: this, selector: '[data-test="compare"]' });
clearSelection = new BaseComponent({ parent: this, selector: '[data-test="clear-selection"]' });
selectAll = new BaseComponent({ parent: this, selector: '[data-test="select-all"]' });
// TODO a bunch of modals
}

Expand Down
13 changes: 9 additions & 4 deletions webui/react/src/e2e/tests/experimentList.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,15 @@ test.describe('Experiment List', () => {
const count = await getCount();
if (count !== 0) {
await grid.headRow.clickSelectHeader();
const isClearSelectionVisible =
await projectDetailsPage.f_experimentList.tableActionBar.clearSelection.pwLocator.isVisible();
if (isClearSelectionVisible) {
await projectDetailsPage.f_experimentList.tableActionBar.clearSelection.pwLocator.click();
const selectAllButton = projectDetailsPage.f_experimentList.tableActionBar.selectAll;
const clearAllButton = projectDetailsPage.f_experimentList.tableActionBar.clearSelection;
if (await selectAllButton.pwLocator.isVisible()) {
await selectAllButton.pwLocator.click();
await clearAllButton.pwLocator.click();
} else if (await clearAllButton.pwLocator.isVisible()) {
await clearAllButton.pwLocator.click();
} else {
await grid.headRow.clickSelectHeader();
}
}
});
Expand Down

0 comments on commit c48f016

Please sign in to comment.