Skip to content

Commit 29dc9a2

Browse files
tests: update mapping of elements in ngForOf scenario for ios (#1054)
1 parent e589401 commit 29dc9a2

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

Diff for: e2e/renderer/e2e/ngforof.e2e-spec.ts

+22-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ interface ElementTuple {
1212
button: UIElement,
1313
}
1414

15-
describe("ngForOf scenario", () => {
15+
describe("ngForOf scenario", function () {
16+
this.retries(2);
1617
let driver: AppiumDriver;
1718
let addButton: UIElement;
1819
let removeButton: UIElement;
@@ -94,7 +95,11 @@ describe("ngForOf scenario", () => {
9495
await button.click();
9596
} else {
9697
index = elements.length - 1;
97-
await removeButton.click();
98+
if (driver.platformName.toLowerCase().includes("ios")) {
99+
await removeButton.tap();
100+
} else {
101+
await removeButton.click();
102+
}
98103
}
99104

100105
elements.splice(index, 1);
@@ -135,11 +140,22 @@ describe("ngForOf scenario", () => {
135140
};
136141

137142
const getElement = async (id: number) => {
138-
const label = await driver.findElementByText(
139-
"label: " + id.toString(), SearchOptions.exact);
143+
let label = null;
144+
let button = null;
145+
146+
if (driver.platformName.toLowerCase().includes("ios")) {
147+
label = await driver.findElementByAccessibilityId(
148+
"label: " + id.toString());
149+
150+
button = await driver.findElementByAccessibilityId(
151+
id.toString());
152+
} else {
153+
label = await driver.findElementByText(
154+
"label: " + id.toString(), SearchOptions.exact);
140155

141-
const button = await driver.findElementByText(
142-
id.toString(), SearchOptions.exact);
156+
button = await driver.findElementByText(
157+
id.toString(), SearchOptions.exact);
158+
}
143159

144160
return { label, button };
145161
};

0 commit comments

Comments
 (0)