Skip to content

chore: fix modal navigation tests #1630

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 4 commits into from
Nov 23, 2018
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions e2e/modal-navigation-ng/e2e/screens/screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class Screen {
}

loadedHome = async () => {
const lblHome = await this._driver.findElementByAutomationText(home);
const lblHome = await this._driver.waitForElement(home);
assert.isTrue(await lblHome.isDisplayed());
console.log(home + " loaded!");
}
Expand Down Expand Up @@ -149,7 +149,7 @@ export class Screen {
}

loadedModalFrame = async () => {
const lblModal = await this._driver.findElementByAutomationText(modal, 1000);
const lblModal = await this._driver.waitForElement(modal, 5000);
assert.isTrue(await lblModal.isDisplayed(), `${modal} is not displayed!`);
console.log(modal + " loaded!");
}
Expand Down Expand Up @@ -226,7 +226,7 @@ export class Screen {
}

loadedSecondPage = async () => {
const lblModalSecond = await this._driver.findElementByAutomationText(modalSecond);
const lblModalSecond = await this._driver.waitForElement(modalSecond, 5000);
assert.isTrue(await lblModalSecond.isDisplayed());
console.log(modalSecond + " loaded!");
}
Expand Down Expand Up @@ -259,7 +259,7 @@ export class Screen {
}

loadedNestedModalFrame = async () => {
const lblModalNested = await this._driver.findElementByAutomationText(modalNested);
const lblModalNested = await this._driver.waitForElement(modalNested, 5000);
assert.isTrue(await lblModalNested.isDisplayed());
console.log(modalNested + " loaded!");
}
Expand Down
15 changes: 5 additions & 10 deletions e2e/renderer/e2e/action-bar.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from "nativescript-dev-appium";

import { isOnTheLeft } from "./helpers/location";
import { assert } from "chai";

describe("Action Bar scenario", () => {
let driver: AppiumDriver;
Expand Down Expand Up @@ -132,16 +133,10 @@ describe("Action Bar scenario", () => {
conditional = await driver.findElementByAutomationText("conditional");
});

it("should detach conditional action item when its condition is false", done => {
(async () => {
await toggle();

try {
await driver.findElementByAutomationText("conditional");
} catch (e) {
done();
}
})();
it("should detach conditional action item when its condition is false", async () => {
await toggle();
const conditionalBtn = await driver.waitForElement("conditional", 1000);
assert.isUndefined(conditionalBtn, "Conditional button should not be visible!");
});

it("should reattach conditional action item at correct place", async () => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.