Skip to content

tests: update mapping of elements in ngForOf scenario for ios #1054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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