Make cypress tests for spotlight less flaky (#8856)
This commit is contained in:
parent
239b59d4a8
commit
8cceda66ee
1 changed files with 35 additions and 15 deletions
|
@ -282,21 +282,41 @@ describe("Spotlight", () => {
|
|||
cy.openSpotlightDialog().within(() => {
|
||||
cy.spotlightFilter(Filter.People);
|
||||
cy.spotlightSearch().clear().type("b");
|
||||
cy.spotlightResults().should("have.length", 2);
|
||||
cy.spotlightResults().eq(0).should("have.attr", "aria-selected", "true");
|
||||
cy.spotlightResults().eq(1).should("have.attr", "aria-selected", "false");
|
||||
cy.spotlightSearch().type("{downArrow}");
|
||||
cy.spotlightResults().eq(0).should("have.attr", "aria-selected", "false");
|
||||
cy.spotlightResults().eq(1).should("have.attr", "aria-selected", "true");
|
||||
cy.spotlightSearch().type("{downArrow}");
|
||||
cy.spotlightResults().eq(0).should("have.attr", "aria-selected", "false");
|
||||
cy.spotlightResults().eq(1).should("have.attr", "aria-selected", "false");
|
||||
cy.spotlightSearch().type("{upArrow}");
|
||||
cy.spotlightResults().eq(0).should("have.attr", "aria-selected", "false");
|
||||
cy.spotlightResults().eq(1).should("have.attr", "aria-selected", "true");
|
||||
cy.spotlightSearch().type("{upArrow}");
|
||||
cy.spotlightResults().eq(0).should("have.attr", "aria-selected", "true");
|
||||
cy.spotlightResults().eq(1).should("have.attr", "aria-selected", "false");
|
||||
// our debouncing logic only starts the search after a short timeout,
|
||||
// so we wait a few milliseconds.
|
||||
cy.wait(300);
|
||||
cy.get(".mx_Spinner").should("not.exist").then(() => {
|
||||
cy.spotlightResults().should("have.length", 2).then(() => {
|
||||
cy.spotlightResults().eq(0)
|
||||
.should("have.attr", "aria-selected", "true");
|
||||
cy.spotlightResults().eq(1)
|
||||
.should("have.attr", "aria-selected", "false");
|
||||
});
|
||||
cy.spotlightSearch().type("{downArrow}").then(() => {
|
||||
cy.spotlightResults().eq(0)
|
||||
.should("have.attr", "aria-selected", "false");
|
||||
cy.spotlightResults().eq(1)
|
||||
.should("have.attr", "aria-selected", "true");
|
||||
});
|
||||
cy.spotlightSearch().type("{downArrow}").then(() => {
|
||||
cy.spotlightResults().eq(0)
|
||||
.should("have.attr", "aria-selected", "false");
|
||||
cy.spotlightResults().eq(1)
|
||||
.should("have.attr", "aria-selected", "false");
|
||||
});
|
||||
cy.spotlightSearch().type("{upArrow}").then(() => {
|
||||
cy.spotlightResults().eq(0)
|
||||
.should("have.attr", "aria-selected", "false");
|
||||
cy.spotlightResults().eq(1)
|
||||
.should("have.attr", "aria-selected", "true");
|
||||
});
|
||||
cy.spotlightSearch().type("{upArrow}").then(() => {
|
||||
cy.spotlightResults().eq(0)
|
||||
.should("have.attr", "aria-selected", "true");
|
||||
cy.spotlightResults().eq(1)
|
||||
.should("have.attr", "aria-selected", "false");
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue