Merge pull request #7031 from NativeScript/svetoslavtsenov/update-nested-frames-tests

test: separate suites to optimize execute time on CI (#7017)
This commit is contained in:
Svetoslav
2019-03-14 19:34:13 +02:00
committed by GitHub
14 changed files with 261 additions and 159 deletions

View File

@ -4,6 +4,28 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "debug tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"-u",
"tdd",
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/e2e",
"--opts",
"../config/mocha.opts",
"-p",
"4723",
"-a",
"--grep",
"layout-root"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",

View File

@ -1,25 +1,20 @@
Button {
font-size: 8;
padding-left: 5;
padding-right: 5;
padding-top: 0;
padding-bottom: 0;
margin-top: 0;
margin-bottom: 0;
margin-right: 0;
height: 50px;
padding: 0;
margin: 0;
height: 30px;
color: blue;
}
TextView {
font-size: 10;
font-size: 8;
margin: 0;
padding: 0;
color: green;
}
Label {
font-size: 10;
font-size: 8;
margin: 0;
padding: 0;
}
@ -30,6 +25,6 @@ GridLayout {
}
ActionBar {
height: 30;
height: 20;
margin: 0;
}

View File

@ -1,7 +1,22 @@
Button{
color: blue;
font-size: 10;
height: 35px;
margin: 0;
}
TextView{
color: green;
font-size: 10;
}
Label{
margin: 0;
padding: 0;
font-size: 10;
}
ActionBar {
margin: 0;
padding: 0;
}

View File

@ -1,8 +1,8 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
<ActionBar class="action-bar">
<ActionBar>
<NavigationButton text="frameHomeBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<Label class="action-bar-title" text="multi frame home page" horizontalAlignment="center" />
<Label text="multi frame home page" horizontalAlignment="center" />
</ActionBar>
<GridLayout rows="auto, *, *">

View File

@ -1,7 +1,7 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="layout home page" horizontalAlignment="center" />
<ActionBar>
<Label text="layout home page" horizontalAlignment="center" />
</ActionBar>
<GridLayout rows="auto, *">

View File

@ -1,7 +1,7 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="layout home secondary page" horizontalAlignment="center" />
<ActionBar >
<Label text="layout home secondary page" horizontalAlignment="center" />
</ActionBar>
<GridLayout rows="auto, *">

View File

@ -1,12 +1,12 @@
<Page class="page" navigatingTo="onNavigatingTo" xmlns="http://schemas.nativescript.org/tns.xsd">
<ActionBar class="action-bar">
<ActionBar>
<NavigationButton text="playerBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back"/>
<Label class="action-bar-title" text="{{ name }}"></Label>
<Label text="{{ name }}"></Label>
</ActionBar>
<GridLayout>
<Label class="m-10 h3" verticalAlignment="top" text="{{ description }}"></Label>
<Label verticalAlignment="top" text="{{ description }}"></Label>
</GridLayout>
</Page>

View File

@ -1,7 +1,7 @@
<Page class="page" navigatingTo="onNavigatingTo" xmlns="http://schemas.nativescript.org/tns.xsd">
<ActionBar class="action-bar">
<Label class="action-bar-title" text="Players"></Label>
<ActionBar >
<Label text="Players"></Label>
</ActionBar>
<ListView items="{{ items }}" itemTap="onItemTap" class="list-group">

View File

@ -1,5 +1,4 @@
export const suspendTime = 1;
export const appSuspendResume = true;
export const dontKeepActivities = true;
// TODO: restore "slide" when https://github.com/NativeScript/NativeScript/issues/6728 is fixed
export const transitions = ["Default", "None", /*"Slide", */"Flip"];
export const transitions = ["Default", "None", "Slide", "Flip"];

View File

@ -1,10 +1,11 @@
import { AppiumDriver, createDriver } from "nativescript-dev-appium";
import { AppiumDriver, createDriver, logWarn } from "nativescript-dev-appium";
import { Screen, playersData, home, somePage, teamsData, driverDefaultWaitTime } from "./screen";
import * as shared from "./shared.e2e-spec";
import { Screen, playersData, teamsData, driverDefaultWaitTime, Item } from "./screen";
import { suspendTime, appSuspendResume, dontKeepActivities, transitions } from "./config";
import * as shared from "./shared.e2e-spec";
describe("frame-root:", () => {
const rootType = "frame-root";
describe(rootType, () => {
let driver: AppiumDriver;
let screen: Screen;
@ -32,13 +33,26 @@ describe("frame-root:", () => {
}
});
transitions.forEach(transition => {
const playerOne = playersData[`playerOne${transition}`];
const playerTwo = playersData[`playerTwo${transition}`];
const teamOne = teamsData[`teamOne${transition}`];
const teamTwo = teamsData[`teamTwo${transition}`];
for (let index = 0; index < transitions.length; index++) {
const transition = transitions[index];
const playerOne: Item = playersData[`playerOne${transition}`];
const playerTwo: Item = playersData[`playerTwo${transition}`];
const teamOne: Item = teamsData[`teamOne${transition}`];
const teamTwo: Item = teamsData[`teamTwo${transition}`];
describe(`${rootType}-transition-${transition}-scenarios:`, () => {
before(async function () {
logWarn(`==== Transition ${transition}`);
if (transition === "Flip" &&
driver.isAndroid && parseInt(driver.platformVersion) === 19) {
// TODO: known issue https://github.com/NativeScript/NativeScript/issues/6798
console.log("skipping flip transition tests on api level 19");
this.skip();
}
});
describe(`transition: ${transition} scenarios:`, () => {
it("loaded home page", async () => {
await screen.loadedHome();
});
@ -57,14 +71,14 @@ describe("frame-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerTwo.name) // wait for player
await screen.loadedElement(playerTwo.name);
}
await shared.testPlayerNavigatedBack(screen, driver);
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerOne.name) // wait for players list
await screen.loadedElement(playerOne.name);
}
await shared.testPlayerNavigated(playerTwo, screen);
@ -76,7 +90,7 @@ describe("frame-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(somePage); // wait for some page
await screen.loadedSomePage() // wait for some page
}
if (driver.isAndroid) {
@ -93,14 +107,14 @@ describe("frame-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerTwo.name); // wait for player
await screen.loadedElement(playerTwo.name);
}
await shared[`testSomePageNavigated${transition}`](screen);
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(somePage); // wait for some page
await screen.loadedSomePage() // wait for some page
}
if (driver.isAndroid) {
@ -121,7 +135,7 @@ describe("frame-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(home); // wait for home page
await screen.loadedHome();
}
});
@ -143,14 +157,14 @@ describe("frame-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerTwo.name) // wait for player
await screen.loadedElement(playerTwo.description);
}
await shared.testPlayerNavigatedBack(screen, driver);
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerOne.name) // wait for players list
await screen.loadedElement(playerOne.name) // wait for players list
}
await shared.testPlayerNavigated(playerTwo, screen);
@ -162,7 +176,7 @@ describe("frame-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(somePage); // wait for some page
await screen.loadedSomePage();
}
if (driver.isAndroid) {
@ -179,14 +193,14 @@ describe("frame-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerTwo.name); // wait for player
await screen.loadedElement(playerTwo.description);
}
await shared[`testSomePageNavigated${transition}`](screen);
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(somePage); // wait for some page
await screen.loadedSomePage();
}
if (driver.isAndroid) {
@ -214,19 +228,19 @@ describe("frame-root:", () => {
await screen.loadedTeamsList();
});
it ("mix player and team list actions and go back", async () => {
it("mix player and team list actions and go back", async () => {
await shared.testPlayerNavigated(playerTwo, screen);
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerTwo.name); // wait for player
await screen.loadedElement(playerTwo.name);
}
await shared[`testSomePageNavigated${transition}`](screen);
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(somePage); // wait for some page
await screen.loadedSomePage();
}
if (driver.isAndroid) {
@ -237,7 +251,7 @@ describe("frame-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(teamOne.name); // wait for teams list
await screen.loadedElement(teamOne.name);
}
await screen.loadedPlayerDetails(playerTwo); // assert no changes after back navigation
@ -247,14 +261,14 @@ describe("frame-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(teamTwo.name); // wait for team
await screen.loadedElement(teamTwo.name);
}
await shared[`testSomePageNavigated${transition}`](screen);
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(somePage); // wait for some page
await screen.loadedSomePage();
}
if (driver.isAndroid) {
@ -271,7 +285,7 @@ describe("frame-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerOne.name); // wait for players list
await screen.loadedElement(playerOne.name); // wait for players list
}
await screen.goBackToTeamsList();
@ -283,5 +297,5 @@ describe("frame-root:", () => {
await screen.loadedHome();
});
});
});
};
});

View File

@ -1,21 +1,19 @@
import { AppiumDriver, createDriver } from "nativescript-dev-appium";
import { AppiumDriver, createDriver, logWarn } from "nativescript-dev-appium";
import { Screen, playersData, somePage, teamsData, driverDefaultWaitTime } from "./screen";
import { Screen, playersData, somePage, teamsData, driverDefaultWaitTime, Item } 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) {
return s.replace(/([a-zA-Z])(?=[A-Z])/g, "$1-").toLowerCase();
}
describe("frame-tab-root:", () => {
const rootType = "frame-tab-root";
describe(rootType, () => {
let driver: AppiumDriver;
let screen: Screen;
before(async () => {
logWarn(`====== ${rootType} ========`);
driver = await createDriver();
screen = new Screen(driver);
if (dontKeepActivities) {
@ -39,24 +37,36 @@ describe("frame-tab-root:", () => {
}
});
roots.forEach(root => {
const rootWithHyphen = hyphenate(root);
for (let index = 0; index < roots.length; index++) {
const root = roots[index];
describe(`${rootWithHyphen} scenarios:`, () => {
describe(`${rootType}-${root} scenarios:`, () => {
logWarn(`===== Root: ${root}`);
for (let trIndex = 0; trIndex < transitions.length; trIndex++) {
const transition = transitions[trIndex];
const playerOne: Item = playersData[`playerOne${transition}`];
const playerTwo: Item = playersData[`playerTwo${transition}`];
const teamOne: Item = teamsData[`teamOne${transition}`];
const teamTwo: Item = teamsData[`teamTwo${transition}`];
transitions.forEach(transition => {
const playerOne = playersData[`playerOne${transition}`];
const playerTwo = playersData[`playerTwo${transition}`];
const teamOne = teamsData[`teamOne${transition}`];
const teamTwo = teamsData[`teamTwo${transition}`];
describe(`${rootType}-${root}-transition-${transition}-scenarios:`, () => {
describe(`transition: ${transition} scenarios:`, () => {
before(async function () {
logWarn(`========= ${root}-${transition} =========`);
if (transition === "Flip" &&
driver.isAndroid && parseInt(driver.platformVersion) === 19) {
// TODO: known issue https://github.com/NativeScript/NativeScript/issues/6798
console.log("skipping flip transition tests on api level 19");
this.skip();
}
});
it("loaded home page", async () => {
await screen.loadedHome();
});
it(`loaded frame ${rootWithHyphen} root with nested frames`, async () => {
it(`loaded frame ${root} root with nested frames`, async () => {
await screen[`navigateToPage${root}WithFrames`]();
await screen[`loadedPage${root}WithFrames`]();
});
@ -70,7 +80,7 @@ describe("frame-tab-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerTwo.name) // wait for player
await screen.loadedElement(playerTwo.name) // wait for player
}
await shared.testPlayerNavigatedBack(screen, driver);
@ -89,7 +99,7 @@ describe("frame-tab-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(somePage) // wait for some page
await screen.loadedElement(somePage) // wait for some page
}
if (driver.isAndroid) {
@ -106,14 +116,14 @@ describe("frame-tab-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerTwo.name); // wait for player
await screen.loadedElement(playerTwo.name); // wait for player
}
await shared[`testSomePageNavigated${transition}`](screen);
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(somePage); // wait for some page
await screen.loadedElement(somePage); // wait for some page
}
if (driver.isAndroid) {
@ -133,7 +143,7 @@ describe("frame-tab-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(teamOne.name); // wait for team
await screen.loadedElement(teamOne.name); // wait for team
}
});
@ -146,7 +156,7 @@ describe("frame-tab-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerOne.name); // wait for players list
await screen.loadedElement(playerOne.name); // wait for players list
}
await screen.loadedPlayersList();
@ -155,14 +165,16 @@ describe("frame-tab-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerTwo.name); // wait for player
await screen.loadedElement(playerTwo.name); // wait for player
}
await screen.loadedPlayerDetails(playerTwo);
await shared[`testSomePageNavigated${transition}`](screen);
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(somePage); // wait for some page
await screen.loadedElement(somePage); // wait for some page
}
if (driver.isAndroid) {
@ -172,8 +184,10 @@ describe("frame-tab-root:", () => {
}
if (appSuspendResume) {
// This sleeps prevent test to fail
await driver.sleep(1000);
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerTwo.name); // wait for player
await screen.loadedElement(playerTwo.name); // wait for player
}
await screen.loadedPlayerDetails(playerTwo);
@ -182,7 +196,7 @@ describe("frame-tab-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(teamOne.name); // wait for teams list
await screen.loadedElement(teamOne.name); // wait for teams list
}
await screen.loadedTeamsList();
@ -190,15 +204,18 @@ describe("frame-tab-root:", () => {
await shared.testTeamNavigated(teamTwo, screen);
if (appSuspendResume) {
await screen.loadedElement(teamTwo.name); // wait for team
await driver.backgroundApp(suspendTime);
await driver.waitForElement(teamTwo.name); // wait for team
await screen.loadedElement(teamTwo.name); // wait for team
}
await screen.loadedTeamDetails(teamTwo);
await shared[`testSomePageNavigated${transition}`](screen);
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(somePage); // wait for some page
await screen.loadedElement(somePage); // wait for some page
}
if (driver.isAndroid) {
@ -208,8 +225,9 @@ describe("frame-tab-root:", () => {
}
if (appSuspendResume) {
await screen.loadedElement(teamTwo.name); // wait for team
await driver.backgroundApp(suspendTime);
await driver.waitForElement(teamTwo.name); // wait for team
await screen.loadedElement(teamTwo.name); // wait for team
}
await screen.loadedTeamDetails(teamTwo);
@ -218,7 +236,7 @@ describe("frame-tab-root:", () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerTwo.name); // wait for player
await screen.loadedElement(playerTwo.name); // wait for player
}
await screen.loadedPlayerDetails(playerTwo);
@ -239,7 +257,7 @@ describe("frame-tab-root:", () => {
await screen.loadedHome();
});
});
});
};
});
});
}
});

View File

@ -1,16 +1,18 @@
import { AppiumDriver, createDriver } from "nativescript-dev-appium";
import { AppiumDriver, createDriver, logWarn } from "nativescript-dev-appium";
import { Screen, playersData, home, somePage, otherPage, teamsData, driverDefaultWaitTime } from "./screen";
import * as shared from "./shared.e2e-spec";
import { suspendTime, appSuspendResume, dontKeepActivities, transitions } from "./config";
describe("layout-root:", () => {
const rootType = "layout-root";
describe(rootType, () => {
let driver: AppiumDriver;
let screen: Screen;
before(async () => {
driver = await createDriver();
screen = new Screen(driver);
logWarn("====== layout-root ========")
if (dontKeepActivities) {
await driver.setDontKeepActivities(true);
}
@ -32,12 +34,23 @@ describe("layout-root:", () => {
}
});
transitions.forEach(transition => {
for (let index = 0; index < transitions.length; index++) {
const transition = transitions[index];
const playerOne = playersData[`playerOne${transition}`];
const playerTwo = playersData[`playerTwo${transition}`];
const teamOne = teamsData[`teamOne${transition}`];
describe(`transition: ${transition} scenarios:`, () => {
describe(`${rootType}-transition-${transition}-scenarios:`, () => {
before(async function () {
if (transition === "Flip" &&
driver.isAndroid && parseInt(driver.platformVersion) === 19) {
// TODO: known issue https://github.com/NativeScript/NativeScript/issues/6798
console.log("skipping flip transition tests on api level 19");
this.skip();
}
});
it("loaded home page", async () => {
await screen.loadedHome();
@ -291,9 +304,9 @@ describe("layout-root:", () => {
await screen.loadedHome();
});
});
});
};
describe("players list slide transition with parent frame default transition:", () => {
describe(`${rootType}-players-list-slide-transition with parent frame default transition:`, () => {
const playerOne = playersData["playerOneSlide"];
const playerTwo = playersData["playerTwoSlide"];
@ -352,7 +365,7 @@ describe("layout-root:", () => {
});
});
describe("players list slide transition with parent frame no transition:", () => {
describe(`${rootType}-players-list-slide-transition with parent frame no transition:`, () => {
const playerOne = playersData["playerOneSlide"];
const playerTwo = playersData["playerTwoSlide"];
@ -411,7 +424,7 @@ describe("layout-root:", () => {
});
});
describe("players list flip transition with parent frame default transition:", () => {
describe(`${rootType}-players-list-flip-transition with parent frame default transition:`, () => {
const playerOne = playersData["playerOneFlip"];
const playerTwo = playersData["playerTwoFlip"];
@ -470,7 +483,7 @@ describe("layout-root:", () => {
});
});
describe("players list flip transition with parent frame no transition:", () => {
describe(`${rootType}-players-list-flip-transition with parent frame no transition:`, () => {
const playerOne = playersData["playerOneFlip"];
const playerTwo = playersData["playerTwoFlip"];

View File

@ -1,4 +1,4 @@
import { AppiumDriver } from "nativescript-dev-appium";
import { AppiumDriver, logInfo } from "nativescript-dev-appium";
import { assert } from "chai";
const layoutWithFrame = "Layout w/ frame";
@ -215,6 +215,8 @@ export class Screen {
resetToHome = async () => {
const btnReset = await this._driver.waitForElement(resetApp);
console.info(`====== Reset home "${resetApp}"`)
await btnReset.tap();
};
@ -248,11 +250,13 @@ export class Screen {
togglePlayersTab = async () => {
const lblPlayers = await this._driver.waitForElement(players);
logInfo(`====== Navigate to "${players}"`);
await lblPlayers.tap();
}
toggleTeamsTab = async () => {
const lblTeams = await this._driver.waitForElement(teams);
logInfo(`====== Navigate to "${teams}"`);
await lblTeams.tap();
}
@ -323,8 +327,15 @@ export class Screen {
await this.loadedItem(team);
}
loadedElement = async (element: string) => {
const el = await this._driver.waitForElement(element);
assert.isNotNull(el);
console.log(`${element} loaded!`);
};
private navigateToPage = async (page: string) => {
const btnPage = await this._driver.waitForElement(page);
logInfo(`====== Navigate to "${page}"`);
await btnPage.tap();
};
@ -336,6 +347,7 @@ export class Screen {
private navigateToItem = async (item: Item) => {
const lblItem = await this._driver.waitForElement(item.name);
logInfo(`====== Navigate to "${item.name}"`);
await lblItem.tap();
}
@ -351,6 +363,7 @@ export class Screen {
private goBack = async (accessibilityId: string) => {
const btnBack = await this._driver.waitForElement(accessibilityId);
logInfo(`====== Go back with "${accessibilityId}"`);
await btnBack.tap();
}
}

View File

@ -1,4 +1,4 @@
import { AppiumDriver, createDriver } from "nativescript-dev-appium";
import { AppiumDriver, createDriver, logWarn } from "nativescript-dev-appium";
import { Screen, playersData, teamsData } from "./screen";
import * as shared from "./shared.e2e-spec";
@ -7,15 +7,13 @@ import { suspendTime, appSuspendResume, dontKeepActivities, transitions } from "
// NOTE: TabTop is Android only scenario (for iOS we will essentially execute 2x TabBottom)
const roots = ["TabTop", "TabBottom"];
function hyphenate(s: string) {
return s.replace(/([a-zA-Z])(?=[A-Z])/g, "$1-").toLowerCase();
}
describe("tab-root:", () => {
const rootType = "tab-root";
describe(rootType, () => {
let driver: AppiumDriver;
let screen: Screen;
before(async () => {
logWarn(`====== ${rootType} ========`)
driver = await createDriver();
screen = new Screen(driver);
if (dontKeepActivities) {
@ -39,24 +37,34 @@ describe("tab-root:", () => {
}
});
roots.forEach(root => {
const rootWithHyphen = hyphenate(root);
for (let index = 0; index < roots.length; index++) {
const root = roots[index];
describe(`${rootType}-${root}-scenarios:`, () => {
describe(`${rootWithHyphen} scenarios:`, () => {
for (let index = 0; index < transitions.length; index++) {
const transition = transitions[index];
transitions.forEach(transition => {
const playerOne = playersData[`playerOne${transition}`];
const playerTwo = playersData[`playerTwo${transition}`];
const teamOne = teamsData[`teamOne${transition}`];
const teamTwo = teamsData[`teamTwo${transition}`];
describe(`transition: ${transition} scenarios:`, () => {
describe(`${rootType}-${root}-transition-${transition}-scenarios:`, () => {
before(async function () {
if (transition === "Flip" &&
driver.isAndroid && parseInt(driver.platformVersion) === 19) {
// TODO: known issue https://github.com/NativeScript/NativeScript/issues/6798
console.log("skipping flip transition tests on api level 19");
this.skip();
}
});
it("loaded home page", async () => {
await screen.loadedHome();
});
it(`loaded ${rootWithHyphen} root with frames`, async () => {
it(`loaded ${root} root with frames`, async () => {
await screen[`navigateTo${root}RootWithFrames`]();
await screen[`loaded${root}RootWithFrames`]();
});
@ -109,16 +117,21 @@ describe("tab-root:", () => {
await shared.testPlayerNavigated(playerTwo, screen);
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerTwo.name) // wait for player
if (driver.isIOS) {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerTwo.name) // wait for player
}
}
await screen.toggleTeamsTab();
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(teamOne.name) // wait for teams list
if (driver.isIOS) {
// TODO: run in background from appium breaks the test. Investigate the issue, once with the app and with appium
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(teamOne.name) // wait for teams list
}
}
await screen.loadedTeamsList();
@ -155,7 +168,7 @@ describe("tab-root:", () => {
await screen.loadedHome();
});
});
});
};
});
});
}
});