Skip to content

Commit

Permalink
Fix flaky client scopes test for Firefox (keycloak#26195)
Browse files Browse the repository at this point in the history
Closes keycloak#26148

Signed-off-by: Alfredo Moises Boullosa <[email protected]>
  • Loading branch information
Aboullos authored Jan 16, 2024
1 parent d7f26bf commit af4954a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/apps/admin-ui/cypress/e2e/client_scopes_test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ describe("Client Scopes test", () => {

it("should filter item by name", () => {
const itemName = clientScopeName + 0;

listingPage
.searchItem("", false)
.itemsEqualTo(10)
.checkEmptySearch()
.searchItem(itemName, false)
.itemsEqualTo(1)
.itemExist(itemName, true);
Expand Down
14 changes: 14 additions & 0 deletions js/apps/admin-ui/cypress/support/pages/admin-ui/ListingPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,20 @@ export default class ListingPage extends CommonElements {
return this;
}

checkEmptySearch() {
cy.get(this.tableRowItem).its("length").as("initialCount");
this.searchItem("", false);
cy.get(this.tableRowItem).its("length").as("finalCount");

cy.get("@initialCount").then((initial) => {
cy.get("@finalCount").then((final) => {
expect(initial).to.eq(final);
});
});

return this;
}

itemsEqualTo(amount: number) {
cy.get(this.tableRowItem).its("length").should("be.eq", amount);

Expand Down

0 comments on commit af4954a

Please sign in to comment.