mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 13:51:27 +08:00
refactor: update e2e tests for CI (#6722)
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
--timeout 80000
|
||||
--timeout 300000
|
||||
--recursive e2e
|
||||
--reporter mocha-multi
|
||||
--reporter-options spec=-,mocha-junit-reporter=test-results.xml
|
@ -21,7 +21,7 @@ export function onNavigateSlide(args: EventData) {
|
||||
animated: true,
|
||||
transition: {
|
||||
name: "slide",
|
||||
duration: 380,
|
||||
duration: 300,
|
||||
curve: "easeIn"
|
||||
}
|
||||
});
|
||||
@ -34,7 +34,7 @@ export function onNavigateFlip(args: EventData) {
|
||||
animated: true,
|
||||
transition: {
|
||||
name: "flip",
|
||||
duration: 380,
|
||||
duration: 300,
|
||||
curve: "easeIn"
|
||||
}
|
||||
});
|
||||
|
@ -21,7 +21,7 @@ export function onNavigateSlide(args: EventData) {
|
||||
animated: true,
|
||||
transition: {
|
||||
name: "slide",
|
||||
duration: 380,
|
||||
duration: 300,
|
||||
curve: "easeIn"
|
||||
}
|
||||
});
|
||||
@ -34,7 +34,7 @@ export function onNavigateFlip(args: EventData) {
|
||||
animated: true,
|
||||
transition: {
|
||||
name: "flip",
|
||||
duration: 380,
|
||||
duration: 300,
|
||||
curve: "easeIn"
|
||||
}
|
||||
});
|
@ -1,4 +1,4 @@
|
||||
<Page codeFile="~/frame-root/frame-home-page" xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
|
||||
|
||||
<ActionBar class="action-bar">
|
||||
<NavigationButton text="frameHomeBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
|
||||
|
@ -3,11 +3,11 @@ import { EventData } from "tns-core-modules/ui/core/view";
|
||||
import { Button } from "tns-core-modules/ui/button";
|
||||
|
||||
export function onNavigateToLayoutFrame(args: EventData) {
|
||||
application._resetRootView({ moduleName: "layout-root/layout-root-frame" });
|
||||
application._resetRootView({ moduleName: "layout-root/layout-frame-root" });
|
||||
}
|
||||
|
||||
export function onNavigateToLayoutMultiFrame(args: EventData) {
|
||||
application._resetRootView({ moduleName: "layout-root/layout-root-multi-frame" });
|
||||
application._resetRootView({ moduleName: "layout-root/layout-multi-frame-root" });
|
||||
}
|
||||
|
||||
export function onNavigateToPageFrame(args: EventData) {
|
||||
@ -31,9 +31,9 @@ export function onNavigateToTabsBottomPage(args: EventData) {
|
||||
}
|
||||
|
||||
export function onNavigateToTabsTopRoot(args: EventData) {
|
||||
application._resetRootView({ moduleName: "tab-root/tab-root-top" });
|
||||
application._resetRootView({ moduleName: "tab-root/tab-top-root" });
|
||||
}
|
||||
|
||||
export function onNavigateToTabsBottomRoot(args: EventData) {
|
||||
application._resetRootView({ moduleName: "tab-root/tab-root-bottom" });
|
||||
application._resetRootView({ moduleName: "tab-root/tab-bottom-root" });
|
||||
}
|
||||
|
@ -10,9 +10,9 @@
|
||||
<Button text="Layout w/ multi frame" tap="onNavigateToLayoutMultiFrame" />
|
||||
<Button text="Page w/ frame" tap="onNavigateToPageFrame" />
|
||||
<Button text="Page w/ multi frame" tap="onNavigateToPageMultiFrame" />
|
||||
<Button ios:visibility="collapsed" text="Page w/ tabs (top)" tap="onNavigateToTabsTopPage" />
|
||||
<Button text="Page w/ tabs (top)" tap="onNavigateToTabsTopPage" />
|
||||
<Button text="Page w/ tabs (bottom)" tap="onNavigateToTabsBottomPage" />
|
||||
<Button ios:visibility="collapsed" text="Root tabs (top)" tap="onNavigateToTabsTopRoot" />
|
||||
<Button text="Root tabs (top)" tap="onNavigateToTabsTopRoot" />
|
||||
<Button text="Root tabs (bottom)" tap="onNavigateToTabsBottomRoot" />
|
||||
</StackLayout>
|
||||
</GridLayout>
|
||||
|
@ -21,7 +21,7 @@ export function onNavigateSlide(args: EventData) {
|
||||
animated: true,
|
||||
transition: {
|
||||
name: "slide",
|
||||
duration: 380,
|
||||
duration: 300,
|
||||
curve: "easeIn"
|
||||
}
|
||||
});
|
||||
@ -34,7 +34,7 @@ export function onNavigateFlip(args: EventData) {
|
||||
animated: true,
|
||||
transition: {
|
||||
name: "flip",
|
||||
duration: 380,
|
||||
duration: 300,
|
||||
curve: "easeIn"
|
||||
}
|
||||
});
|
||||
|
@ -21,7 +21,7 @@ export function onNavigateSlide(args: EventData) {
|
||||
animated: true,
|
||||
transition: {
|
||||
name: "slide",
|
||||
duration: 380,
|
||||
duration: 300,
|
||||
curve: "easeIn"
|
||||
}
|
||||
});
|
||||
@ -34,7 +34,7 @@ export function onNavigateFlip(args: EventData) {
|
||||
animated: true,
|
||||
transition: {
|
||||
name: "flip",
|
||||
duration: 380,
|
||||
duration: 300,
|
||||
curve: "easeIn"
|
||||
}
|
||||
});
|
||||
|
@ -1,4 +1,4 @@
|
||||
<GridLayout codeFile="~/layout-root/layout-root-frame" rows="auto, *, *">
|
||||
<GridLayout rows="auto, *, *">
|
||||
<Button text="reset app" tap="onReset" />
|
||||
<GridLayout row="1">
|
||||
<Frame defaultPage="layout-root/layout-home-page" />
|
@ -38,14 +38,14 @@ export function onItemTap(args: ItemEventData) {
|
||||
case "slide":
|
||||
entry.transition = {
|
||||
name: "slide",
|
||||
duration: 380,
|
||||
duration: 300,
|
||||
curve: "easeIn"
|
||||
};
|
||||
break;
|
||||
case "flip":
|
||||
entry.transition = {
|
||||
name: "flip",
|
||||
duration: 380,
|
||||
duration: 300,
|
||||
curve: "easeIn"
|
||||
};
|
||||
break;
|
||||
|
46
e2e/nested-frame-navigation/app/tab-page/tabs-bottom-page.ts
Normal file
46
e2e/nested-frame-navigation/app/tab-page/tabs-bottom-page.ts
Normal file
@ -0,0 +1,46 @@
|
||||
import { EventData } from "tns-core-modules/ui/page";
|
||||
import { Button } from "tns-core-modules/ui/button";
|
||||
|
||||
export function onNavigate(args: EventData) {
|
||||
const button = <Button>args.object;
|
||||
button.page.frame.navigate("some-page/some-page");
|
||||
}
|
||||
|
||||
export function onNavigateNone(args: EventData) {
|
||||
const button = <Button>args.object;
|
||||
button.page.frame.navigate({
|
||||
moduleName: "some-page/some-page",
|
||||
animated: false
|
||||
});
|
||||
}
|
||||
|
||||
export function onNavigateSlide(args: EventData) {
|
||||
const button = <Button>args.object;
|
||||
button.page.frame.navigate({
|
||||
moduleName: "some-page/some-page",
|
||||
animated: true,
|
||||
transition: {
|
||||
name: "slide",
|
||||
duration: 300,
|
||||
curve: "easeIn"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function onNavigateFlip(args: EventData) {
|
||||
const button = <Button>args.object;
|
||||
button.page.frame.navigate({
|
||||
moduleName: "some-page/some-page",
|
||||
animated: true,
|
||||
transition: {
|
||||
name: "flip",
|
||||
duration: 300,
|
||||
curve: "easeIn"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function onBackButtonTap(args: EventData): void {
|
||||
const button = <Button>args.object;
|
||||
button.page.frame.goBack();
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
<Page codeFile="~/tab-page/tabs-page" xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
|
||||
|
||||
<ActionBar class="action-bar">
|
||||
<NavigationButton text="tabBottomBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
|
||||
|
46
e2e/nested-frame-navigation/app/tab-page/tabs-top-page.ts
Normal file
46
e2e/nested-frame-navigation/app/tab-page/tabs-top-page.ts
Normal file
@ -0,0 +1,46 @@
|
||||
import { EventData } from "tns-core-modules/ui/page";
|
||||
import { Button } from "tns-core-modules/ui/button";
|
||||
|
||||
export function onNavigate(args: EventData) {
|
||||
const button = <Button>args.object;
|
||||
button.page.frame.navigate("some-page/some-page");
|
||||
}
|
||||
|
||||
export function onNavigateNone(args: EventData) {
|
||||
const button = <Button>args.object;
|
||||
button.page.frame.navigate({
|
||||
moduleName: "some-page/some-page",
|
||||
animated: false
|
||||
});
|
||||
}
|
||||
|
||||
export function onNavigateSlide(args: EventData) {
|
||||
const button = <Button>args.object;
|
||||
button.page.frame.navigate({
|
||||
moduleName: "some-page/some-page",
|
||||
animated: true,
|
||||
transition: {
|
||||
name: "slide",
|
||||
duration: 300,
|
||||
curve: "easeIn"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function onNavigateFlip(args: EventData) {
|
||||
const button = <Button>args.object;
|
||||
button.page.frame.navigate({
|
||||
moduleName: "some-page/some-page",
|
||||
animated: true,
|
||||
transition: {
|
||||
name: "flip",
|
||||
duration: 300,
|
||||
curve: "easeIn"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function onBackButtonTap(args: EventData): void {
|
||||
const button = <Button>args.object;
|
||||
button.page.frame.goBack();
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
<Page codeFile="~/tab-page/tabs-page" xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
|
||||
|
||||
<ActionBar class="action-bar">
|
||||
<NavigationButton text="tabTopBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
|
||||
@ -13,7 +13,8 @@
|
||||
<Button text="navigate to some page (flip transition)" tap="onNavigateFlip" />
|
||||
</StackLayout>
|
||||
|
||||
<TabView row="1" androidTabsPosition="top">
|
||||
<GridLayout row="1">
|
||||
<TabView androidTabsPosition="top">
|
||||
<TabViewItem title="Players">
|
||||
<Frame defaultPage="players/players-items-page" />
|
||||
</TabViewItem>
|
||||
@ -25,4 +26,5 @@
|
||||
</TabViewItem>
|
||||
</TabView>
|
||||
</GridLayout>
|
||||
</GridLayout>
|
||||
</Page>
|
@ -0,0 +1,5 @@
|
||||
import * as application from "tns-core-modules/application";
|
||||
|
||||
export function onReset() {
|
||||
application._resetRootView({ moduleName: "app-root" });
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
<TabView codeFile="~/tab-root/tab-root" androidTabsPosition="bottom">
|
||||
<TabView androidTabsPosition="bottom">
|
||||
<TabViewItem title="Players">
|
||||
<GridLayout rows="auto, auto, *">
|
||||
<Label text="tab root bottom home" />
|
5
e2e/nested-frame-navigation/app/tab-root/tab-top-root.ts
Normal file
5
e2e/nested-frame-navigation/app/tab-root/tab-top-root.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import * as application from "tns-core-modules/application";
|
||||
|
||||
export function onReset() {
|
||||
application._resetRootView({ moduleName: "app-root" });
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
<TabView codeFile="~/tab-root/tab-root" androidTabsPosition="top">
|
||||
<TabView androidTabsPosition="top">
|
||||
<TabViewItem title="Players">
|
||||
<GridLayout rows="auto, auto, *">
|
||||
<Label text="tab root top home" />
|
@ -38,14 +38,14 @@ export function onItemTap(args: ItemEventData) {
|
||||
case "slide":
|
||||
entry.transition = {
|
||||
name: "slide",
|
||||
duration: 380,
|
||||
duration: 300,
|
||||
curve: "easeIn"
|
||||
};
|
||||
break;
|
||||
case "flip":
|
||||
entry.transition = {
|
||||
name: "flip",
|
||||
duration: 380,
|
||||
duration: 300,
|
||||
curve: "easeIn"
|
||||
};
|
||||
break;
|
||||
|
@ -1,4 +1,5 @@
|
||||
export const suspendTime = 1;
|
||||
export const appSuspendResume = true;
|
||||
export const dontKeepActivities = true;
|
||||
export const transitions = ["Default", "None", "Slide", "Flip"];
|
||||
// TODO: restore "slide" when https://github.com/NativeScript/NativeScript/issues/6728 is fixed
|
||||
export const transitions = ["Default", "None", /*"Slide", */"Flip"];
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { AppiumDriver, createDriver } from "nativescript-dev-appium";
|
||||
|
||||
import { Screen, playersData, home, somePage, teamsData } from "./screen";
|
||||
import * as shared from "./shared.e2e-spec";
|
||||
import { suspendTime, appSuspendResume, dontKeepActivities, transitions } from "./config";
|
||||
@ -13,6 +14,8 @@ describe("frame-root:", () => {
|
||||
if (dontKeepActivities) {
|
||||
await driver.setDontKeepActivities(true);
|
||||
}
|
||||
|
||||
driver.defaultWaitTime = 8000;
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
@ -76,7 +79,12 @@ describe("frame-root:", () => {
|
||||
await driver.waitForElement(somePage); // wait for some page
|
||||
}
|
||||
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack(); // some page back navigation
|
||||
} else {
|
||||
await screen.goBackFromSomePage();
|
||||
}
|
||||
|
||||
await screen.loadedPlayersList();
|
||||
});
|
||||
|
||||
@ -95,7 +103,12 @@ describe("frame-root:", () => {
|
||||
await driver.waitForElement(somePage); // wait for some page
|
||||
}
|
||||
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack(); // some page back navigation
|
||||
} else {
|
||||
await screen.goBackFromSomePage();
|
||||
}
|
||||
|
||||
await screen.loadedPlayerDetails(playerTwo);
|
||||
|
||||
await screen.goBackToPlayersList();
|
||||
@ -152,7 +165,12 @@ describe("frame-root:", () => {
|
||||
await driver.waitForElement(somePage); // wait for some page
|
||||
}
|
||||
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack(); // some page back navigation
|
||||
} else {
|
||||
await screen.goBackFromSomePage();
|
||||
}
|
||||
|
||||
await screen.loadedPlayersList();
|
||||
});
|
||||
|
||||
@ -171,7 +189,12 @@ describe("frame-root:", () => {
|
||||
await driver.waitForElement(somePage); // wait for some page
|
||||
}
|
||||
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack(); // some page back navigation
|
||||
} else {
|
||||
await screen.goBackFromSomePage();
|
||||
}
|
||||
|
||||
await screen.loadedPlayerDetails(playerTwo);
|
||||
await screen.loadedTeamsList(); // assert visible & no changes
|
||||
|
||||
@ -206,7 +229,11 @@ describe("frame-root:", () => {
|
||||
await driver.waitForElement(somePage); // wait for some page
|
||||
}
|
||||
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack(); // some page back navigation
|
||||
} else {
|
||||
await screen.goBackFromSomePage();
|
||||
}
|
||||
|
||||
if (appSuspendResume) {
|
||||
await driver.backgroundApp(suspendTime);
|
||||
@ -230,7 +257,12 @@ describe("frame-root:", () => {
|
||||
await driver.waitForElement(somePage); // wait for some page
|
||||
}
|
||||
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack(); // some page back navigation
|
||||
} else {
|
||||
await screen.goBackFromSomePage();
|
||||
}
|
||||
|
||||
await screen.loadedPlayerDetails(playerTwo); // assert no changes after back navigation
|
||||
await screen.loadedTeamDetails(teamTwo);
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
import { AppiumDriver, createDriver } from "nativescript-dev-appium";
|
||||
|
||||
import { Screen, playersData, somePage, teamsData } from "./screen";
|
||||
import * as shared from "./shared.e2e-spec";
|
||||
import { suspendTime, appSuspendResume, dontKeepActivities, transitions } from "./config";
|
||||
|
||||
// NOTE: TabTop is Android only scenario (for iOS we will essentially execute 2x TabBottom)
|
||||
const roots = ["TabTop", "TabBottom"];
|
||||
|
||||
function hyphenate(s: string) {
|
||||
@ -19,6 +21,8 @@ describe("frame-tab-root:", () => {
|
||||
if (dontKeepActivities) {
|
||||
await driver.setDontKeepActivities(true);
|
||||
}
|
||||
|
||||
driver.defaultWaitTime = 8000;
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
@ -88,7 +92,12 @@ describe("frame-tab-root:", () => {
|
||||
await driver.waitForElement(somePage) // wait for some page
|
||||
}
|
||||
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack();
|
||||
} else {
|
||||
await screen.goBackFromSomePage();
|
||||
}
|
||||
|
||||
await screen.loadedPlayersList();
|
||||
});
|
||||
|
||||
@ -107,7 +116,12 @@ describe("frame-tab-root:", () => {
|
||||
await driver.waitForElement(somePage); // wait for some page
|
||||
}
|
||||
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack();
|
||||
} else {
|
||||
await screen.goBackFromSomePage();
|
||||
}
|
||||
|
||||
await screen.loadedPlayerDetails(playerTwo);
|
||||
|
||||
await screen.goBackToPlayersList();
|
||||
@ -151,7 +165,11 @@ describe("frame-tab-root:", () => {
|
||||
await driver.waitForElement(somePage); // wait for some page
|
||||
}
|
||||
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack();
|
||||
} else {
|
||||
await screen.goBackFromSomePage();
|
||||
}
|
||||
|
||||
if (appSuspendResume) {
|
||||
await driver.backgroundApp(suspendTime);
|
||||
@ -183,7 +201,11 @@ describe("frame-tab-root:", () => {
|
||||
await driver.waitForElement(somePage); // wait for some page
|
||||
}
|
||||
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack();
|
||||
} else {
|
||||
await screen.goBackFromSomePage();
|
||||
}
|
||||
|
||||
if (appSuspendResume) {
|
||||
await driver.backgroundApp(suspendTime);
|
||||
|
@ -14,6 +14,8 @@ describe("layout-root:", () => {
|
||||
if (dontKeepActivities) {
|
||||
await driver.setDontKeepActivities(true);
|
||||
}
|
||||
|
||||
driver.defaultWaitTime = 8000;
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
@ -77,7 +79,12 @@ describe("layout-root:", () => {
|
||||
await driver.waitForElement(somePage); // wait for some page
|
||||
}
|
||||
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack(); // some page back navigation
|
||||
} else {
|
||||
await screen.goBackFromSomePage();
|
||||
}
|
||||
|
||||
await screen.loadedPlayersList();
|
||||
});
|
||||
|
||||
@ -96,7 +103,12 @@ describe("layout-root:", () => {
|
||||
await driver.waitForElement(somePage); // wait for some page
|
||||
}
|
||||
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack(); // some page back navigation
|
||||
} else {
|
||||
await screen.goBackFromSomePage();
|
||||
}
|
||||
|
||||
await screen.loadedPlayerDetails(playerTwo);
|
||||
|
||||
await screen.goBackToPlayersList();
|
||||
@ -153,7 +165,12 @@ describe("layout-root:", () => {
|
||||
await driver.waitForElement(somePage); // wait for some page
|
||||
}
|
||||
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack(); // some page back navigation
|
||||
} else {
|
||||
await screen.goBackFromSomePage();
|
||||
}
|
||||
|
||||
await screen.loadedPlayersList();
|
||||
});
|
||||
|
||||
@ -172,7 +189,12 @@ describe("layout-root:", () => {
|
||||
await driver.waitForElement(somePage); // wait for some page
|
||||
}
|
||||
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack(); // some page back navigation
|
||||
} else {
|
||||
await screen.goBackFromSomePage();
|
||||
}
|
||||
|
||||
await screen.loadedPlayerDetails(playerTwo);
|
||||
|
||||
await screen.goBackToPlayersList();
|
||||
@ -208,7 +230,11 @@ describe("layout-root:", () => {
|
||||
|
||||
await screen.loadedPlayerDetails(playerTwo); // assert no changes in the sibling frame
|
||||
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack(); // other page back navigation
|
||||
} else {
|
||||
await screen.goBackFromOtherPage();
|
||||
}
|
||||
|
||||
if (appSuspendResume) {
|
||||
await driver.backgroundApp(suspendTime);
|
||||
@ -234,7 +260,12 @@ describe("layout-root:", () => {
|
||||
|
||||
await screen.loadedOtherPage(); // assert no changes in the sibling frame
|
||||
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack(); // some page back navigation
|
||||
} else {
|
||||
await screen.goBackFromSomePage();
|
||||
}
|
||||
|
||||
await screen.loadedPlayerDetails(playerTwo);
|
||||
|
||||
await screen.goBackToPlayersList();
|
||||
@ -262,6 +293,7 @@ describe("layout-root:", () => {
|
||||
});
|
||||
});
|
||||
|
||||
// TODO: uncomment when https://github.com/NativeScript/NativeScript/issues/6630 is fixed
|
||||
// describe("players list slide transition with parent frame default transition:", () => {
|
||||
// const playerOne = playersData["playerOneSlide"];
|
||||
// const playerTwo = playersData["playerTwoSlide"];
|
||||
@ -292,7 +324,11 @@ describe("layout-root:", () => {
|
||||
// await driver.waitForElement(somePage); // wait for some page
|
||||
// }
|
||||
|
||||
// if (driver.isAndroid) {
|
||||
// await driver.navBack(); // some page back navigation
|
||||
// } else {
|
||||
// await screen.goBackFromSomePage();
|
||||
// }
|
||||
|
||||
// if (appSuspendResume) {
|
||||
// await driver.backgroundApp(suspendTime);
|
||||
@ -347,7 +383,11 @@ describe("layout-root:", () => {
|
||||
// await driver.waitForElement(somePage); // wait for some page
|
||||
// }
|
||||
|
||||
// if (driver.isAndroid) {
|
||||
// await driver.navBack(); // some page back navigation
|
||||
// } else {
|
||||
// await screen.goBackFromSomePage();
|
||||
// }
|
||||
|
||||
// if (appSuspendResume) {
|
||||
// await driver.backgroundApp(suspendTime);
|
||||
@ -402,7 +442,11 @@ describe("layout-root:", () => {
|
||||
// await driver.waitForElement(somePage); // wait for some page
|
||||
// }
|
||||
|
||||
// if (driver.isAndroid) {
|
||||
// await driver.navBack(); // some page back navigation
|
||||
// } else {
|
||||
// await screen.goBackFromSomePage();
|
||||
// }
|
||||
|
||||
// if (appSuspendResume) {
|
||||
// await driver.backgroundApp(suspendTime);
|
||||
@ -457,7 +501,11 @@ describe("layout-root:", () => {
|
||||
// await driver.waitForElement(somePage); // wait for some page
|
||||
// }
|
||||
|
||||
// if (driver.isAndroid) {
|
||||
// await driver.navBack(); // some page back navigation
|
||||
// } else {
|
||||
// await screen.goBackFromSomePage();
|
||||
// }
|
||||
|
||||
// if (appSuspendResume) {
|
||||
// await driver.backgroundApp(suspendTime);
|
||||
|
@ -256,8 +256,8 @@ export class Screen {
|
||||
}
|
||||
|
||||
loadedHome = async () => {
|
||||
const lblHome = await this._driver.findElementByAutomationText(home);
|
||||
assert.isTrue(await lblHome.isDisplayed());
|
||||
const lblHome = await this._driver.waitForElement(home);
|
||||
assert.isNotNull(lblHome);
|
||||
console.log(home + " loaded!");
|
||||
};
|
||||
|
||||
@ -303,8 +303,8 @@ export class Screen {
|
||||
}
|
||||
|
||||
loadedPlayersList = async () => {
|
||||
const lblPlayerOne = await this._driver.findElementByAutomationText(playersData["playerOneDefault"].name);
|
||||
assert.isTrue(await lblPlayerOne.isDisplayed());
|
||||
const lblPlayerOne = await this._driver.waitForElement(playersData["playerOneDefault"].name);
|
||||
assert.isNotNull(lblPlayerOne);
|
||||
console.log(players + " loaded!");
|
||||
}
|
||||
|
||||
@ -313,8 +313,8 @@ export class Screen {
|
||||
}
|
||||
|
||||
loadedTeamsList = async () => {
|
||||
const lblTeamOne = await this._driver.findElementByAutomationText(teamsData["teamOneDefault"].name);
|
||||
assert.isTrue(await lblTeamOne.isDisplayed());
|
||||
const lblTeamOne = await this._driver.waitForElement(teamsData["teamOneDefault"].name);
|
||||
assert.isNotNull(lblTeamOne);
|
||||
console.log(teams + " loaded!");
|
||||
}
|
||||
|
||||
@ -328,8 +328,8 @@ export class Screen {
|
||||
};
|
||||
|
||||
private loadedPage = async (page: string) => {
|
||||
const lblPage = await this._driver.findElementByAutomationText(page);
|
||||
assert.isTrue(await lblPage.isDisplayed());
|
||||
const lblPage = await this._driver.waitForElement(page);
|
||||
assert.isNotNull(lblPage);
|
||||
console.log(page + " loaded!");
|
||||
};
|
||||
|
||||
@ -339,11 +339,11 @@ export class Screen {
|
||||
}
|
||||
|
||||
private loadedItem = async (item: Item) => {
|
||||
const lblItemName = await this._driver.findElementByAutomationText(item.name);
|
||||
assert.isTrue(await lblItemName.isDisplayed());
|
||||
const lblItemName = await this._driver.waitForElement(item.name);
|
||||
assert.isNotNull(lblItemName);
|
||||
|
||||
const lblItemDescription = await this._driver.findElementByAutomationText(item.description);
|
||||
assert.isTrue(await lblItemDescription.isDisplayed());
|
||||
const lblItemDescription = await this._driver.waitForElement(item.description);
|
||||
assert.isNotNull(lblItemDescription);
|
||||
|
||||
console.log(item.name + " loaded!");
|
||||
}
|
||||
|
@ -1,13 +1,19 @@
|
||||
import { Screen, Item } from "./screen";
|
||||
import { AppiumDriver } from "nativescript-dev-appium";
|
||||
|
||||
import { Screen, Item } from "./screen";
|
||||
|
||||
export async function testPlayerNavigated(player: Item, screen: Screen) {
|
||||
await screen.navigateToPlayerDetails(player);
|
||||
await screen.loadedPlayerDetails(player);
|
||||
}
|
||||
|
||||
export async function testPlayerNavigatedBack(screen: Screen, driver: AppiumDriver) {
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack();
|
||||
} else {
|
||||
await screen.goBackToPlayersList();
|
||||
}
|
||||
|
||||
await screen.loadedPlayersList();
|
||||
}
|
||||
|
||||
@ -37,7 +43,12 @@ export async function testTeamNavigated(team: Item, screen: Screen) {
|
||||
}
|
||||
|
||||
export async function testTeamNavigatedBack(screen: Screen, driver: AppiumDriver) {
|
||||
if (driver.isAndroid) {
|
||||
await driver.navBack();
|
||||
} else {
|
||||
await screen.goBackToTeamsList();
|
||||
}
|
||||
|
||||
await screen.loadedTeamsList();
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
import { AppiumDriver, createDriver } from "nativescript-dev-appium";
|
||||
|
||||
import { Screen, playersData, teamsData } from "./screen";
|
||||
import * as shared from "./shared.e2e-spec";
|
||||
import { suspendTime, appSuspendResume, dontKeepActivities, transitions } from "./config";
|
||||
|
||||
// NOTE: TabTop is Android only scenario (for iOS we will essentially execute 2x TabBottom)
|
||||
const roots = ["TabTop", "TabBottom"];
|
||||
|
||||
function hyphenate(s: string) {
|
||||
@ -19,6 +21,8 @@ describe("tab-root:", () => {
|
||||
if (dontKeepActivities) {
|
||||
await driver.setDontKeepActivities(true);
|
||||
}
|
||||
|
||||
driver.defaultWaitTime = 8000;
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
|
Reference in New Issue
Block a user