Skip to content

Commit

Permalink
tests: update mapping of elements in ngForOf scenario for ios (#1054)
Browse files Browse the repository at this point in the history
  • Loading branch information
SvetoslavTsenov committed Oct 24, 2017
1 parent e589401 commit 29dc9a2
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions e2e/renderer/e2e/ngforof.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ interface ElementTuple {
button: UIElement,
}

describe("ngForOf scenario", () => {
describe("ngForOf scenario", function () {
this.retries(2);
let driver: AppiumDriver;
let addButton: UIElement;
let removeButton: UIElement;
Expand Down Expand Up @@ -94,7 +95,11 @@ describe("ngForOf scenario", () => {
await button.click();
} else {
index = elements.length - 1;
await removeButton.click();
if (driver.platformName.toLowerCase().includes("ios")) {
await removeButton.tap();
} else {
await removeButton.click();
}
}

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

const getElement = async (id: number) => {
const label = await driver.findElementByText(
"label: " + id.toString(), SearchOptions.exact);
let label = null;
let button = null;

if (driver.platformName.toLowerCase().includes("ios")) {
label = await driver.findElementByAccessibilityId(
"label: " + id.toString());

button = await driver.findElementByAccessibilityId(
id.toString());
} else {
label = await driver.findElementByText(
"label: " + id.toString(), SearchOptions.exact);

const button = await driver.findElementByText(
id.toString(), SearchOptions.exact);
button = await driver.findElementByText(
id.toString(), SearchOptions.exact);
}

return { label, button };
};
Expand Down

0 comments on commit 29dc9a2

Please sign in to comment.