Skip to content

Commit

Permalink
frontend: Fix for e2e test (#2559)
Browse files Browse the repository at this point in the history
## Why

`find('[data-cy=data-pipelines-job-executions-type-container]')` causes
the test to fail if it doesn't find any job executions. It should be
returning an empty list instead.

## What

Introduce logic that returns an empty list

## How was this tested

Ran e2e tests locally
Ran e2e tests in CI

## What type of change is this

Bug fix

 - Fix one bug in e2e tests for Data Job Executions

Signed-off-by: Goran Kokinovski <[email protected]>
  • Loading branch information
gorankokin authored Aug 17, 2023
1 parent 2276a54 commit d21ceb9
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,14 @@ export class DataJobManageExecutionsPage extends DataJobBasePO {
getDataGridExecTypeContainers(type) {
return this.getDataGrid()
.should('exist')
.find('[data-cy=data-pipelines-job-executions-type-container]')
.then(($gridContainer) => {
/**
* @type {JQuery<HTMLElement>}
*/
const $containers = $gridContainer.find('[data-cy=data-pipelines-job-executions-type-container]');

return cy.wrap($containers.length === 0 ? [] : $containers);
})
.then(($containers) => {
return cy.wrap(
Array.from($containers)
Expand Down

0 comments on commit d21ceb9

Please sign in to comment.