[Do Not Merge] chore(e2e): skip specific test suites with known issues on android / ios (#6797)

* Update README.md

* comment flip

* skip specific test suites with known issues

* restore skipped ios tests

* chore: update css for ios

* chore: update android css

* chore: tab-root tests remove suspend for android

* chore: frame-root tested on api23, api27 and ios11

* chore: fix tslint

* chore: frame-tab-root tests api27

* chore: lower font size
This commit is contained in:
Manol Donev
2019-03-04 11:35:07 +02:00
committed by SvetoslavTsenov
parent a31e75b129
commit 116c3a7a80
14 changed files with 204 additions and 116 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,4 +1,4 @@
import { AppiumDriver, createDriver } from "nativescript-dev-appium";
import { AppiumDriver, createDriver, logWarn } from "nativescript-dev-appium";
import { Screen, playersData, teamsData, driverDefaultWaitTime, Item } from "./screen";
import { suspendTime, appSuspendResume, dontKeepActivities, transitions } from "./config";
@ -33,11 +33,13 @@ describe(rootType, () => {
}
});
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 () {
@ -69,14 +71,14 @@ describe(rootType, () => {
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);
@ -88,7 +90,7 @@ describe(rootType, () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(somePage); // wait for some page
await screen.loadedSomePage() // wait for some page
}
if (driver.isAndroid) {
@ -105,14 +107,14 @@ describe(rootType, () => {
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) {
@ -133,7 +135,7 @@ describe(rootType, () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(home); // wait for home page
await screen.loadedHome();
}
});
@ -155,14 +157,14 @@ describe(rootType, () => {
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);
@ -174,7 +176,7 @@ describe(rootType, () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(somePage); // wait for some page
await screen.loadedSomePage();
}
if (driver.isAndroid) {
@ -191,14 +193,14 @@ describe(rootType, () => {
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) {
@ -231,14 +233,14 @@ describe(rootType, () => {
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) {
@ -249,7 +251,7 @@ describe(rootType, () => {
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
@ -259,14 +261,14 @@ describe(rootType, () => {
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) {
@ -283,7 +285,7 @@ describe(rootType, () => {
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();
@ -295,5 +297,5 @@ describe(rootType, () => {
await screen.loadedHome();
});
});
});
};
});

View File

@ -1,6 +1,6 @@
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";
@ -51,6 +51,17 @@ describe(rootType, () => {
describe(`${rootType}-${root}-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();
});
@ -69,7 +80,7 @@ describe(rootType, () => {
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);
@ -88,7 +99,7 @@ describe(rootType, () => {
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) {
@ -105,14 +116,14 @@ describe(rootType, () => {
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) {
@ -132,7 +143,7 @@ describe(rootType, () => {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(teamOne.name); // wait for team
await screen.loadedElement(teamOne.name); // wait for team
}
});
@ -145,7 +156,7 @@ describe(rootType, () => {
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();
@ -154,14 +165,16 @@ describe(rootType, () => {
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) {
@ -171,8 +184,10 @@ describe(rootType, () => {
}
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);
@ -181,7 +196,7 @@ describe(rootType, () => {
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();
@ -189,15 +204,18 @@ describe(rootType, () => {
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) {
@ -207,8 +225,9 @@ describe(rootType, () => {
}
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);
@ -217,7 +236,7 @@ describe(rootType, () => {
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);
@ -238,7 +257,7 @@ describe(rootType, () => {
await screen.loadedHome();
});
});
};
});
});
});
}
});

View File

@ -43,6 +43,15 @@ describe(rootType, () => {
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();
});

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

@ -51,6 +51,15 @@ describe(rootType, () => {
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();
});
@ -108,17 +117,22 @@ describe(rootType, () => {
await shared.testPlayerNavigated(playerTwo, screen);
if (driver.isIOS) {
if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerTwo.name) // wait for player
}
}
await screen.toggleTeamsTab();
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();