Skip to content

Commit

Permalink
Merge branch 'develop' into debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 committed Dec 14, 2023
2 parents 0603fee + 881e247 commit 7f83596
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions cypress/pageobject/Users/UserSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,25 @@ export class UserPage {
cy.url().should("include", `page=${pageNumber}`);
}

verifyMultipleBadgesWithSameId(expectedContents: string[]) {
cy.get("#user-view-name").each((el, index) => {
expect(el.text().trim()).to.equal(expectedContents[index]);
verifyMultipleBadgesWithSameId(alreadylinkedusersviews: string[]) {
cy.get("#user-view-name").then(($elements) => {
const userViews = $elements
.map((_, el) => Cypress.$(el).text().trim())
.get();
let foundMatches = 0;

alreadylinkedusersviews.forEach((expectedContent) => {
const index = userViews.findIndex((actualContent) =>
actualContent.includes(expectedContent)
);
if (index !== -1) {
userViews.splice(index, 1); // Remove the matched element
foundMatches++;
}
if (foundMatches === alreadylinkedusersviews.length) {
return false; // Break the loop if all matches are found
}
});
});
}
}

0 comments on commit 7f83596

Please sign in to comment.