Skip to content

Commit

Permalink
[Cypress] Allow multiple elements in ignoreRegions (#145)
Browse files Browse the repository at this point in the history
Co-authored-by: Logan Graham <[email protected]>
  • Loading branch information
omacranger and Logan Graham authored Oct 1, 2024
1 parent 2e5f7bd commit 4d79c86
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
5 changes: 5 additions & 0 deletions visual-js/.changeset/old-mails-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@saucelabs/cypress-visual-plugin": patch
---

fix ignore regions for multiple elements
16 changes: 5 additions & 11 deletions visual-js/visual-cypress/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,13 @@ function chainableWaitForAll<S>(
): Cypress.Chainable<S[]> {
const result: S[] = [];

if (list.length < 1) return cy.wrap<S[]>([]);

let curChainable = list[0];
for (let idx = 1; idx < list.length; idx++) {
curChainable = curChainable.then((resolved) => {
result.push(resolved);
return list[idx];
list.forEach((item) => {
item.then((el) => {
result.push(el);
});
}
return curChainable.then((item) => {
result.push(item);
return result;
});

return cy.wrap(result);
}

const sauceVisualCheckCommand = (
Expand Down

0 comments on commit 4d79c86

Please sign in to comment.