Skip to content

Commit 13626e5

Browse files
authored
chore: stable failing test (#11303)
### UploadCollectionItem When the detail button is pressed, `editing` mode is activated. In this state, the element with the `.ui5-uci-file-name` class is not rendered in the DOM. ### Search (Mobile) Ensure that the responsive popover is open before interacting with any components inside it. Skip test due bug inside component #11314 ### Responsive Popover Command The responsive popover command should locate a `ui5-popover` or `ui5-dialog` within the shadow root and verify that it is internally visible.
1 parent 6480a06 commit 13626e5

File tree

5 files changed

+101
-15
lines changed

5 files changed

+101
-15
lines changed

packages/fiori/cypress/specs/Search.mobile.cy.tsx

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type ResponsivePopover from "@ui5/webcomponents/dist/ResponsivePopover.js";
12
import Search from "../../src/Search.js";
23
import SearchItem from "../../src/SearchItem.js";
34
import SearchScope from "../../src/SearchScope.js";
@@ -45,6 +46,11 @@ describe("Search Field on mobile device", () => {
4546
cy.get("[ui5-search]")
4647
.realClick();
4748

49+
cy.get("[ui5-search]")
50+
.shadow()
51+
.find<ResponsivePopover>("[ui5-responsive-popover]")
52+
.ui5ResponsivePopoverOpened();
53+
4854
cy.get("[ui5-search]")
4955
.shadow()
5056
.find(".ui5-search-popup-searching-header [ui5-button]")
@@ -73,12 +79,19 @@ describe("Search Field on mobile device", () => {
7379
cy.get("[ui5-search]")
7480
.realClick();
7581

82+
cy.get("[ui5-search]")
83+
.shadow()
84+
.find<ResponsivePopover>("[ui5-responsive-popover]")
85+
.ui5ResponsivePopoverOpened();
86+
7687
cy.get("[ui5-search]")
7788
.shadow()
7889
.find("[ui5-input]")
7990
.shadow()
8091
.find("input")
81-
.type("test{enter}");
92+
.should("be.focused");
93+
94+
cy.realType("test{enter}");
8295

8396
cy.get("[ui5-search]")
8497
.should("have.prop", "open", false);
@@ -114,12 +127,19 @@ describe("Search Field on mobile device", () => {
114127
cy.get("[ui5-search]")
115128
.realClick();
116129

130+
cy.get("[ui5-search]")
131+
.shadow()
132+
.find<ResponsivePopover>("[ui5-responsive-popover]")
133+
.ui5ResponsivePopoverOpened();
134+
117135
cy.get("[ui5-search]")
118136
.shadow()
119137
.find("[ui5-input]")
120138
.shadow()
121139
.find("input")
122-
.type("Item 1{enter}");
140+
.should("be.focused");
141+
142+
cy.realType("Item 1{enter}");
123143

124144
cy.get("[ui5-search]")
125145
.should("have.prop", "open", false);
@@ -130,7 +150,7 @@ describe("Search Field on mobile device", () => {
130150
}));
131151
});
132152

133-
it("should revert value of search if dialog is closed by cancel", () => {
153+
it.skip("should revert value of search if dialog is closed by cancel", () => {
134154
cy.mount(
135155
<>
136156
<Search showClearIcon={true}>
@@ -146,16 +166,18 @@ describe("Search Field on mobile device", () => {
146166

147167
cy.get("[ui5-search]")
148168
.realClick();
149-
169+
150170
cy.get("[ui5-search]")
151171
.shadow()
152-
.find(".ui5-search-popover-content")
153-
.should("be.visible");
172+
.find<ResponsivePopover>("[ui5-responsive-popover]")
173+
.ui5ResponsivePopoverOpened();
154174

155175
cy.get("[ui5-search]")
156176
.shadow()
157177
.find("[ui5-input]")
158-
.realPress("T");
178+
.should("be.focused");
179+
180+
cy.realPress("T");
159181

160182
cy.get("[ui5-search]")
161183
.should("have.prop", "value", "T");
@@ -165,6 +187,11 @@ describe("Search Field on mobile device", () => {
165187
.find(".ui5-search-popup-searching-header [ui5-button]")
166188
.realClick();
167189

190+
cy.get("[ui5-search]")
191+
.shadow()
192+
.find<ResponsivePopover>("[ui5-responsive-popover]")
193+
.ui5ResponsivePopoverClosed();
194+
168195
cy.get("[ui5-search]")
169196
.should("have.prop", "value", "");
170197
});
@@ -228,12 +255,19 @@ describe("Search Field on mobile device", () => {
228255
cy.get("[ui5-search]")
229256
.realClick();
230257

258+
cy.get("[ui5-search]")
259+
.shadow()
260+
.find<ResponsivePopover>("[ui5-responsive-popover]")
261+
.ui5ResponsivePopoverOpened();
262+
231263
cy.get("[ui5-search]")
232264
.shadow()
233265
.find("[ui5-input]")
234266
.shadow()
235267
.find("input")
236-
.type("Ite");
268+
.should("be.focused");
269+
270+
cy.realType("Ite");
237271

238272
cy.get("[ui5-search]")
239273
.should("have.prop", "value", "Ite");
@@ -243,7 +277,9 @@ describe("Search Field on mobile device", () => {
243277
.find("[ui5-input]")
244278
.shadow()
245279
.find("input")
246-
.type("{enter}");
280+
.should("be.focused");
281+
282+
cy.realType("{enter}");
247283

248284
cy.get("[ui5-search]")
249285
.should("have.prop", "value", "Item 1");

packages/fiori/cypress/specs/ShellBar.cy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import ShellBar from "../../src/ShellBar.js";
22
import ShellBarItem from "../../src/ShellBarItem.js";
3-
import ShellBarSpacer from "@ui5/webcomponents-fiori/dist/ShellBarSpacer.js";
3+
import ShellBarSpacer from "../../src/ShellBarSpacer.js";
44
import activities from "@ui5/webcomponents-icons/dist/activities.js";
55
import navBack from "@ui5/webcomponents-icons/dist/nav-back.js";
66
import sysHelp from "@ui5/webcomponents-icons/dist/sys-help.js";

packages/fiori/cypress/specs/UploadCollection.cy.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,16 @@ describe("Edit - various file names", () => {
569569

570570
cy.get("#item")
571571
.shadow()
572-
.find(".ui5-uci-file-name")
573-
.should("not.have.text");
572+
.find("#ui5-uci-edit-input")
573+
.should("be.visible")
574+
.and("be.focused")
575+
.and("have.value", ".gitignore")
576+
577+
cy.get("#item")
578+
.shadow()
579+
.find(".ui5-uci-file-extension")
580+
.should("exist")
581+
.and("have.text", "");
574582
});
575583

576584
it("Tests cancelling of name change via keyboard", () => {
Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
11
import type ResponsivePopover from "../../../src/ResponsivePopover.js";
2-
import { isPopupOpen } from "./utils/popup-open.js";
2+
import { isPhone } from "@ui5/webcomponents-base/dist/Device.js";
3+
import { isPopupOpen, isPopupClosed } from "./utils/popup-open.js";
34

45
Cypress.Commands.add("ui5ResponsivePopoverOpened", { prevSubject: true }, (subject: JQuery<ResponsivePopover>) => {
5-
isPopupOpen(subject);
6+
if (isPhone()) {
7+
cy.wrap(subject)
8+
.shadow()
9+
.find("[ui5-dialog]")
10+
.then($dialog => {
11+
isPopupOpen($dialog);
12+
});
13+
} else {
14+
isPopupOpen(subject);
15+
}
16+
});
17+
18+
Cypress.Commands.add("ui5ResponsivePopoverClosed", { prevSubject: true }, (subject: JQuery<ResponsivePopover>) => {
19+
if (isPhone()) {
20+
cy.wrap(subject)
21+
.shadow()
22+
.find("[ui5-dialog]")
23+
.then($dialog => {
24+
isPopupClosed($dialog);
25+
});
26+
} else {
27+
isPopupClosed(subject);
28+
}
629
});
730

831
declare global {
@@ -11,6 +34,9 @@ declare global {
1134
ui5ResponsivePopoverOpened(
1235
this: Chainable<JQuery<ResponsivePopover>>
1336
): Chainable<void>;
37+
ui5ResponsivePopoverClosed(
38+
this: Chainable<JQuery<ResponsivePopover>>
39+
): Chainable<void>;
1440
}
1541
}
1642
}

packages/main/cypress/support/commands/utils/popup-open.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ const isPopupOpen = (subject: any) => {
1414
.and("have.attr", "open");
1515
};
1616

17+
const isPopupClosed = (subject: any) => {
18+
cy.wrap(subject)
19+
.as("popup");
20+
21+
cy.get("@popup")
22+
.should("not.have.attr", "open");
23+
24+
cy.get("@popup")
25+
.should($rp => {
26+
expect($rp.is(":popover-open")).to.be.false;
27+
expect($rp).not.be.visible;
28+
})
29+
.and("not.have.attr", "open");
30+
};
31+
1732
export {
18-
isPopupOpen
33+
isPopupOpen,
34+
isPopupClosed
1935
}

0 commit comments

Comments
 (0)