Skip to content

Commit

Permalink
Merge branch 'develop' into issue#6855
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 authored Dec 14, 2023
2 parents 0b6b8f3 + 881e247 commit eff3ac4
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 eff3ac4

Please sign in to comment.