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