Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tabs-ios): unable to return to tab after tab with nested frame visited #7574

Merged
merged 26 commits into from Jul 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7823ecb
chore(tabs-bottom-nav): add e2e tests
manoldonev Jul 4, 2019
cbf88fa
fix(bottom-navigation-android): tabStripItem backgroundColor (#7504)
ADjenkov Jul 11, 2019
6afb40c
release: cut the 6.0.0 release (#7423)
SvetoslavTsenov Jul 15, 2019
f8a2d6c
fix(tabs-android): wrong tabStripItem selected (#7522)
ADjenkov Jul 16, 2019
8053756
chore: bump package veresions (#7525)
Jul 16, 2019
1806f1e
test: extend tab navigations tests
SvetoslavTsenov Jul 7, 2019
6c13600
chore: update imageHelper prop
SvetoslavTsenov Jul 8, 2019
568a853
chore: small fixes
SvetoslavTsenov Jul 9, 2019
b74a1ad
fixes
SvetoslavTsenov Jul 9, 2019
7b81810
chore: fixes
SvetoslavTsenov Jul 10, 2019
1463021
tests
SvetoslavTsenov Jul 10, 2019
0555aac
fixes
SvetoslavTsenov Jul 13, 2019
2b4cffc
chore: tslint errors
SvetoslavTsenov Jul 13, 2019
1d4db7f
chore: element stratagy location
SvetoslavTsenov Jul 17, 2019
6dae937
chore: add missing feature to changelog (#7535)
MartoYankov Jul 17, 2019
599983a
chore: update tests
SvetoslavTsenov Jul 18, 2019
81013fc
fix: tslint error
SvetoslavTsenov Jul 18, 2019
d397887
fixing docs build (#7538)
tsonevn Jul 17, 2019
90aeb36
chore: update package.json
SvetoslavTsenov Jul 19, 2019
2e25898
fix(bottom-navigation): crash when tab selected with no item (#7527)
ADjenkov Jul 19, 2019
9df9b88
fix(tabs-ios): crash when setting tabStripItems through items propert…
ADjenkov Jul 22, 2019
463a5e9
fix(tabs-ios): unable to return to tab after tab with nested frame vi…
ADjenkov Jul 24, 2019
4cb8041
chore(tests): modify e2e tests with automationText
ADjenkov Jul 24, 2019
4f20834
Merge branch 'release' into djenkov/preload-ios-tabs
ADjenkov Jul 24, 2019
5cb60ad
fix(tabs-ios): set canBelLoaded of prev and next tab item
ADjenkov Jul 25, 2019
aab696f
Merge branch 'djenkov/preload-ios-tabs' of github.com:NativeScript/Na…
ADjenkov Jul 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions e2e/nested-frame-navigation/app/app.ts
@@ -1,5 +1,3 @@
import * as application from "tns-core-modules/application";

application.run({ moduleName: "app-root" });
// application.run({ moduleName: "tab-root" });
// application.run({ moduleName: "layout-root" });
@@ -1,7 +1,7 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">

<ActionBar class="action-bar">
<NavigationButton text="tabBottomBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<NavigationButton text="bottomNavigationBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<Label class="action-bar-title" text="bottom navigation page" horizontalAlignment="center" />
</ActionBar>

Expand All @@ -16,9 +16,9 @@
<GridLayout row="1">
<BottomNavigation>
<TabStrip>
<TabStripItem title="Players"></TabStripItem>
<TabStripItem title="Dummy"></TabStripItem>
<TabStripItem title="Teams"></TabStripItem>
<TabStripItem title="Players" automationText="playersTabNavigation"></TabStripItem>
<TabStripItem title="Dummy" automationText="dummyTabNavigation"></TabStripItem>
<TabStripItem title="Teams" automationText="teamsTabNavigation"></TabStripItem>
</TabStrip>

<TabContentItem>
Expand Down
@@ -1,14 +1,14 @@
<BottomNavigation>
<TabStrip>
<TabStripItem title="Players"></TabStripItem>
<TabStripItem title="Players" automationText="playersTabNavigation"></TabStripItem>
<!-- this tab serves as dummy so the actual teams tab is not loaded by default -->
<TabStripItem title="Dummy"></TabStripItem>
<TabStripItem title="Teams"></TabStripItem>
<TabStripItem title="Dummy" automationText="dummyTabNavigation"></TabStripItem>
<TabStripItem title="Teams" automationText="teamsTabNavigation"></TabStripItem>
</TabStrip>

<TabContentItem>
<GridLayout rows="auto, auto, *">
<Label text="tabs root top home" />
<Label text="bottom navigation root home" />
<Button row="1" text="reset app" tap="onReset" />
<GridLayout row="2">
<Frame defaultPage="players/players-items-page" />
Expand Down
@@ -1,7 +1,7 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">

<ActionBar class="action-bar">
<NavigationButton text="tabBottomBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<NavigationButton text="tabViewBottomBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<Label class="action-bar-title" text="tabview bottom page" horizontalAlignment="center" />
</ActionBar>

Expand Down
2 changes: 1 addition & 1 deletion e2e/nested-frame-navigation/app/tab-page/tab-top-page.xml
@@ -1,7 +1,7 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">

<ActionBar class="action-bar">
<NavigationButton text="tabTopBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<NavigationButton text="tabViewTopBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<Label class="action-bar-title" text="tabview top page" horizontalAlignment="center" />
</ActionBar>

Expand Down
@@ -1,7 +1,7 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">

<ActionBar class="action-bar">
<NavigationButton text="tabBottomBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<NavigationButton text="tabsBottomBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<Label class="action-bar-title" text="tabs bottom page" horizontalAlignment="center" />
</ActionBar>

Expand All @@ -16,9 +16,9 @@
<GridLayout row="1">
<Tabs tabsPosition="bottom">
<TabStrip>
<TabStripItem title="Players"></TabStripItem>
<TabStripItem title="Dummy"></TabStripItem>
<TabStripItem title="Teams"></TabStripItem>
<TabStripItem title="Players" automationText="playersTabNavigation"></TabStripItem>
<TabStripItem title="Dummy" automationText="dummyTabNavigation"></TabStripItem>
<TabStripItem title="Teams" automationText="teamsTabNavigation"></TabStripItem>
</TabStrip>

<TabContentItem>
Expand Down
8 changes: 4 additions & 4 deletions e2e/nested-frame-navigation/app/tabs-page/tabs-top-page.xml
@@ -1,7 +1,7 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page">

<ActionBar class="action-bar">
<NavigationButton text="tabTopBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<NavigationButton text="tabsTopBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" />
<Label class="action-bar-title" text="tabs top page" horizontalAlignment="center" />
</ActionBar>

Expand All @@ -16,9 +16,9 @@
<GridLayout row="1">
<Tabs tabsPosition="top">
<TabStrip>
<TabStripItem title="Players"></TabStripItem>
<TabStripItem title="Dummy"></TabStripItem>
<TabStripItem title="Teams"></TabStripItem>
<TabStripItem title="Players" automationText="playersTabNavigation"></TabStripItem>
<TabStripItem title="Dummy" automationText="dummyTabNavigation"></TabStripItem>
<TabStripItem title="Teams" automationText="teamsTabNavigation"></TabStripItem>
</TabStrip>

<TabContentItem>
Expand Down
@@ -1,14 +1,14 @@
<Tabs tabsPosition="bottom">
<TabStrip>
<TabStripItem title="Players"></TabStripItem>
<TabStripItem title="Players" automationText="playersTabNavigation"></TabStripItem>
<!-- this tab serves as dummy so the actual teams tab is not loaded by default -->
<TabStripItem title="Dummy"></TabStripItem>
<TabStripItem title="Teams"></TabStripItem>
<TabStripItem title="Dummy" automationText="dummyTabNavigation"></TabStripItem>
<TabStripItem title="Teams" automationText="teamsTabNavigation"></TabStripItem>
</TabStrip>

<TabContentItem>
<GridLayout rows="auto, auto, *">
<Label text="tabs root top home" />
<Label text="tabs root bottom home" />
<Button row="1" text="reset app" tap="onReset" />
<GridLayout row="2">
<Frame defaultPage="players/players-items-page" />
Expand Down
8 changes: 4 additions & 4 deletions e2e/nested-frame-navigation/app/tabs-root/tabs-top-root.xml
@@ -1,9 +1,9 @@
<Tabs tabsPosition="top">
<Tabs tabsPosition="top" automationText="tabNavigation">
<TabStrip>
<TabStripItem title="Players"></TabStripItem>
<TabStripItem title="Players" automationText="playersTabNavigation"></TabStripItem>
<!-- this tab serves as dummy so the actual teams tab is not loaded by default -->
<TabStripItem title="Dummy"></TabStripItem>
<TabStripItem title="Teams"></TabStripItem>
<TabStripItem title="Dummy" automationText="dummyTabNavigation"></TabStripItem>
<TabStripItem title="Teams" automationText="teamsTabNavigation"></TabStripItem>
</TabStrip>

<TabContentItem>
Expand Down
180 changes: 180 additions & 0 deletions e2e/nested-frame-navigation/e2e/bottom-navigation-root.e2e-spec.ts
@@ -0,0 +1,180 @@
import { AppiumDriver, createDriver, logWarn, nsCapabilities } from "nativescript-dev-appium";

import { Screen, playersData, teamsData } from "./screen";
import * as shared from "./shared.e2e-spec";
import { suspendTime, appSuspendResume, dontKeepActivities, transitions } from "./config";

const roots = ["BottomNavigation"];

const rootType = "bottom-navigation-root";
describe(rootType, async function () {
let driver: AppiumDriver;
let screen: Screen;

before(async function () {
nsCapabilities.testReporter.context = this;
logWarn(`====== ${rootType} ========`);
driver = await createDriver();
screen = new Screen(driver);
if (dontKeepActivities) {
await driver.setDontKeepActivities(true);
}

driver.defaultWaitTime = 8000;
});

after(async function () {
if (dontKeepActivities) {
await driver.setDontKeepActivities(false);
}
await driver.quit();
console.log("Quit driver!");
});

afterEach(async function () {
if (this.currentTest.state === "failed") {
await driver.logTestArtifacts(this.currentTest.title);
}
});

for (let index = 0; index < roots.length; index++) {
const root = roots[index];
describe(`${rootType}-${root}-scenarios:`, async function () {

before(async function () {
nsCapabilities.testReporter.context = this;
});

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}`];
const teamTwo = teamsData[`teamTwo${transition}`];

describe(`${rootType}-${root}-transition-${transition}-scenarios:`, async function () {

before(async function () {
nsCapabilities.testReporter.context = this;

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 function () {
await screen.loadedHome();
});

it(`loaded ${root} root with frames`, async function () {
await screen[`navigateTo${root}RootWithFrames`]();
await screen[`loaded${root}RootWithFrames`]();
});

it("loaded players list", async function () {
await screen.loadedPlayersList();
});

it("loaded player details and go back twice", async function () {
await shared.testPlayerNavigated(playerTwo, screen);

if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerTwo.name); // wait for player
}

await shared.testPlayerNavigatedBack(screen, driver);

if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerOne.name); // wait for players list
}

await shared.testPlayerNavigated(playerTwo, screen);
await shared.testPlayerNavigatedBack(screen, driver);
});

it("toggle teams tab", async function () {
await screen.toggleTeamsTab();

if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(teamOne.name); // wait for teams list
}
});

it("loaded teams list", async function () {
await screen.loadedTeamsList();
});

it("mix player and team list actions and go back", async function () {
await screen.togglePlayersTab();

if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerOne.name); // wait for players list
}

await screen.loadedPlayersList();

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();

await shared.testTeamNavigated(teamTwo, screen);

if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(teamTwo.name); // wait for team
}

await screen.togglePlayersTab();

if (appSuspendResume) {
await driver.backgroundApp(suspendTime);
await driver.waitForElement(playerTwo.name); // wait for player
}

await screen.loadedPlayerDetails(playerTwo);

await screen.toggleTeamsTab();

await screen.goBackToTeamsList();
await screen.loadedTeamsList();

await screen.togglePlayersTab();

await screen.goBackToPlayersList();
await screen.loadedPlayersList();
});

it("loaded home page again", async function () {
await screen.resetToHome();
await screen.loadedHome();
});
});
}
});
}
});