Skip to content

Commit

Permalink
chore: clear wait command in tests (#10774)
Browse files Browse the repository at this point in the history
Remove unnecessary waits in Cypress tests.
  • Loading branch information
nnaydenow authored Feb 5, 2025
1 parent b37af30 commit 5845997
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 54 deletions.
6 changes: 0 additions & 6 deletions packages/fiori/cypress/specs/ViewSettingsDialog.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ describe("View settings dialog - selection", () => {
</ViewSettingsDialog>
);

// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(100); // Wait after mounting the component temporarily, until the component is fully rendered TODO: remove this after the issue is fixed

// Open the dialog and wait until it's visible
cy.get("[ui5-view-settings-dialog]")
.as("vsd")
Expand Down Expand Up @@ -105,9 +102,6 @@ describe("View settings dialog - selection", () => {
</ViewSettingsDialog>
);

// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(100); // Wait after mounting the component temporarily, until the component is fully rendered TODO: remove this after the issue is fixed

// Open the dialog and wait until it's visible
cy.get("[ui5-view-settings-dialog]")
.as("vsd")
Expand Down
48 changes: 0 additions & 48 deletions packages/main/cypress/specs/Input.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,29 +149,21 @@ describe("Input general interaction", () => {

cy.get("@input")
.realClick();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("@input")
.realType("C");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("@popover")
.should("have.attr", "open");

cy.get("@input")
.realPress("ArrowDown");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("@input")
.should("have.attr", "value", "Titanium");

cy.get("@input")
.realPress("Escape");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("@input")
.should("have.value", "C");
Expand All @@ -198,21 +190,15 @@ describe("Input general interaction", () => {

cy.get("@input")
.realClick();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("@input")
.realType("c");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("@popover")
.should("have.attr", "open");

cy.get("@input")
.realPress("ArrowDown");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("@input")
.should("have.value", "Compact")
Expand All @@ -224,8 +210,6 @@ describe("Input general interaction", () => {

cy.get("@input")
.realPress("ArrowDown");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("ui5-suggestion-item")
.eq(2)
Expand Down Expand Up @@ -304,45 +288,31 @@ describe("Input arrow navigation", () => {
.as("popover");

cy.get("@input").realClick();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);
cy.get("@input").realType("c");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("@popover")
.should("have.attr", "open");

cy.get("@input").realPress("ArrowDown");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("ui5-suggestion-item").eq(1).should("have.attr", "text", "Compact");
cy.get("@input").should("not.have.attr", "focused");
cy.get("ui5-suggestion-item").eq(1).should("have.attr", "focused");

cy.get("@input")
.realPress("ArrowDown");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("ui5-suggestion-item").eq(2).should("have.attr", "focused");
cy.get("ui5-suggestion-item").eq(1).should("not.have.attr", "focused");

cy.get("@input")
.realPress("ArrowUp");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("ui5-suggestion-item").eq(1).should("have.attr", "focused");
cy.get("ui5-suggestion-item").eq(2).should("not.have.attr", "focused");

cy.get("@input").realPress("ArrowUp");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);
cy.get("@input").realPress("ArrowUp");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("@input").should("have.attr", "focused");
cy.get("ui5-suggestion-item").first().should("not.have.attr", "focused");
Expand Down Expand Up @@ -376,23 +346,15 @@ describe("Input PAGEUP/PAGEDOWN navigation", () => {

cy.get("@input")
.realClick();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("@input")
.realType("a");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("@input")
.realPress("ArrowDown");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("@input")
.realPress("PageDown");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("ui5-suggestion-item")
.eq(11)
Expand All @@ -409,32 +371,22 @@ describe("Input PAGEUP/PAGEDOWN navigation", () => {

cy.get("@input")
.realClick();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("@input")
.realType("a");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("@input")
.realPress("ArrowUp");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("ui5-suggestion-item-group")
.eq(0)
.should("have.attr", "focused");

cy.get("@input")
.realPress("PageDown");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("@input")
.realPress("PageUp");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);

cy.get("ui5-suggestion-item-group")
.eq(0)
Expand Down

0 comments on commit 5845997

Please sign in to comment.