Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tabs-ios): unable to return to tab after tab with nested frame vi…
…sited (#7574)
- Loading branch information
1 parent
4511c76
commit 490cab0
Showing
18 changed files
with
1,043 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
e2e/nested-frame-navigation/app/bottom-navigation-root/bottom-navigation-root.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
e2e/nested-frame-navigation/app/tabs-root/tabs-bottom-root.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
180 changes: 180 additions & 0 deletions
180
e2e/nested-frame-navigation/e2e/bottom-navigation-root.e2e-spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
}); | ||
}); | ||
} | ||
}); | ||
} | ||
}); |
Oops, something went wrong.