| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,3 @@ | |||
| 1 | 1 | import * as application from "tns-core-modules/application"; | |
| 2 | 2 | ||
| 3 | 3 | application.run({ moduleName: "app-root" }); | |
| 4 | - // application.run({ moduleName: "tab-root" }); | ||
| 5 | - // application.run({ moduleName: "layout-root" }); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | <Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page"> | |
| 2 | 2 | ||
| 3 | 3 | <ActionBar class="action-bar"> | |
| 4 | - <NavigationButton text="tabBottomBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" /> | ||
| 4 | + <NavigationButton text="bottomNavigationBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" /> | ||
| 5 | 5 | <Label class="action-bar-title" text="bottom navigation page" horizontalAlignment="center" /> | |
| 6 | 6 | </ActionBar> | |
| 7 | 7 | ||
@@ -16,9 +16,9 @@ | |||
| 16 | 16 | <GridLayout row="1"> | |
| 17 | 17 | <BottomNavigation> | |
| 18 | 18 | <TabStrip> | |
| 19 | - <TabStripItem title="Players"></TabStripItem> | ||
| 20 | - <TabStripItem title="Dummy"></TabStripItem> | ||
| 21 | - <TabStripItem title="Teams"></TabStripItem> | ||
| 19 | + <TabStripItem title="Players" automationText="playersTabNavigation"></TabStripItem> | ||
| 20 | + <TabStripItem title="Dummy" automationText="dummyTabNavigation"></TabStripItem> | ||
| 21 | + <TabStripItem title="Teams" automationText="teamsTabNavigation"></TabStripItem> | ||
| 22 | 22 | </TabStrip> | |
| 23 | 23 | ||
| 24 | 24 | <TabContentItem> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,14 +1,14 @@ | |||
| 1 | 1 | <BottomNavigation> | |
| 2 | 2 | <TabStrip> | |
| 3 | - <TabStripItem title="Players"></TabStripItem> | ||
| 3 | + <TabStripItem title="Players" automationText="playersTabNavigation"></TabStripItem> | ||
| 4 | 4 | <!-- this tab serves as dummy so the actual teams tab is not loaded by default --> | |
| 5 | - <TabStripItem title="Dummy"></TabStripItem> | ||
| 6 | - <TabStripItem title="Teams"></TabStripItem> | ||
| 5 | + <TabStripItem title="Dummy" automationText="dummyTabNavigation"></TabStripItem> | ||
| 6 | + <TabStripItem title="Teams" automationText="teamsTabNavigation"></TabStripItem> | ||
| 7 | 7 | </TabStrip> | |
| 8 | 8 | ||
| 9 | 9 | <TabContentItem> | |
| 10 | 10 | <GridLayout rows="auto, auto, *"> | |
| 11 | - <Label text="tabs root top home" /> | ||
| 11 | + <Label text="bottom navigation root home" /> | ||
| 12 | 12 | <Button row="1" text="reset app" tap="onReset" /> | |
| 13 | 13 | <GridLayout row="2"> | |
| 14 | 14 | <Frame defaultPage="players/players-items-page" /> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | <Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page"> | |
| 2 | 2 | ||
| 3 | 3 | <ActionBar class="action-bar"> | |
| 4 | - <NavigationButton text="tabBottomBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" /> | ||
| 4 | + <NavigationButton text="tabViewBottomBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" /> | ||
| 5 | 5 | <Label class="action-bar-title" text="tabview bottom page" horizontalAlignment="center" /> | |
| 6 | 6 | </ActionBar> | |
| 7 | 7 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | <Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page"> | |
| 2 | 2 | ||
| 3 | 3 | <ActionBar class="action-bar"> | |
| 4 | - <NavigationButton text="tabTopBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" /> | ||
| 4 | + <NavigationButton text="tabViewTopBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" /> | ||
| 5 | 5 | <Label class="action-bar-title" text="tabview top page" horizontalAlignment="center" /> | |
| 6 | 6 | </ActionBar> | |
| 7 | 7 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | <Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page"> | |
| 2 | 2 | ||
| 3 | 3 | <ActionBar class="action-bar"> | |
| 4 | - <NavigationButton text="tabBottomBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" /> | ||
| 4 | + <NavigationButton text="tabsBottomBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" /> | ||
| 5 | 5 | <Label class="action-bar-title" text="tabs bottom page" horizontalAlignment="center" /> | |
| 6 | 6 | </ActionBar> | |
| 7 | 7 | ||
@@ -16,9 +16,9 @@ | |||
| 16 | 16 | <GridLayout row="1"> | |
| 17 | 17 | <Tabs tabsPosition="bottom"> | |
| 18 | 18 | <TabStrip> | |
| 19 | - <TabStripItem title="Players"></TabStripItem> | ||
| 20 | - <TabStripItem title="Dummy"></TabStripItem> | ||
| 21 | - <TabStripItem title="Teams"></TabStripItem> | ||
| 19 | + <TabStripItem title="Players" automationText="playersTabNavigation"></TabStripItem> | ||
| 20 | + <TabStripItem title="Dummy" automationText="dummyTabNavigation"></TabStripItem> | ||
| 21 | + <TabStripItem title="Teams" automationText="teamsTabNavigation"></TabStripItem> | ||
| 22 | 22 | </TabStrip> | |
| 23 | 23 | ||
| 24 | 24 | <TabContentItem> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | <Page xmlns="http://schemas.nativescript.org/tns.xsd" class="page"> | |
| 2 | 2 | ||
| 3 | 3 | <ActionBar class="action-bar"> | |
| 4 | - <NavigationButton text="tabTopBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" /> | ||
| 4 | + <NavigationButton text="tabsTopBack" tap="onBackButtonTap" android.systemIcon="ic_menu_back" /> | ||
| 5 | 5 | <Label class="action-bar-title" text="tabs top page" horizontalAlignment="center" /> | |
| 6 | 6 | </ActionBar> | |
| 7 | 7 | ||
@@ -16,9 +16,9 @@ | |||
| 16 | 16 | <GridLayout row="1"> | |
| 17 | 17 | <Tabs tabsPosition="top"> | |
| 18 | 18 | <TabStrip> | |
| 19 | - <TabStripItem title="Players"></TabStripItem> | ||
| 20 | - <TabStripItem title="Dummy"></TabStripItem> | ||
| 21 | - <TabStripItem title="Teams"></TabStripItem> | ||
| 19 | + <TabStripItem title="Players" automationText="playersTabNavigation"></TabStripItem> | ||
| 20 | + <TabStripItem title="Dummy" automationText="dummyTabNavigation"></TabStripItem> | ||
| 21 | + <TabStripItem title="Teams" automationText="teamsTabNavigation"></TabStripItem> | ||
| 22 | 22 | </TabStrip> | |
| 23 | 23 | ||
| 24 | 24 | <TabContentItem> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,14 +1,14 @@ | |||
| 1 | 1 | <Tabs tabsPosition="bottom"> | |
| 2 | 2 | <TabStrip> | |
| 3 | - <TabStripItem title="Players"></TabStripItem> | ||
| 3 | + <TabStripItem title="Players" automationText="playersTabNavigation"></TabStripItem> | ||
| 4 | 4 | <!-- this tab serves as dummy so the actual teams tab is not loaded by default --> | |
| 5 | - <TabStripItem title="Dummy"></TabStripItem> | ||
| 6 | - <TabStripItem title="Teams"></TabStripItem> | ||
| 5 | + <TabStripItem title="Dummy" automationText="dummyTabNavigation"></TabStripItem> | ||
| 6 | + <TabStripItem title="Teams" automationText="teamsTabNavigation"></TabStripItem> | ||
| 7 | 7 | </TabStrip> | |
| 8 | 8 | ||
| 9 | 9 | <TabContentItem> | |
| 10 | 10 | <GridLayout rows="auto, auto, *"> | |
| 11 | - <Label text="tabs root top home" /> | ||
| 11 | + <Label text="tabs root bottom home" /> | ||
| 12 | 12 | <Button row="1" text="reset app" tap="onReset" /> | |
| 13 | 13 | <GridLayout row="2"> | |
| 14 | 14 | <Frame defaultPage="players/players-items-page" /> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,9 +1,9 @@ | |||
| 1 | - <Tabs tabsPosition="top"> | ||
| 1 | + <Tabs tabsPosition="top" automationText="tabNavigation"> | ||
| 2 | 2 | <TabStrip> | |
| 3 | - <TabStripItem title="Players"></TabStripItem> | ||
| 3 | + <TabStripItem title="Players" automationText="playersTabNavigation"></TabStripItem> | ||
| 4 | 4 | <!-- this tab serves as dummy so the actual teams tab is not loaded by default --> | |
| 5 | - <TabStripItem title="Dummy"></TabStripItem> | ||
| 6 | - <TabStripItem title="Teams"></TabStripItem> | ||
| 5 | + <TabStripItem title="Dummy" automationText="dummyTabNavigation"></TabStripItem> | ||
| 6 | + <TabStripItem title="Teams" automationText="teamsTabNavigation"></TabStripItem> | ||
| 7 | 7 | </TabStrip> | |
| 8 | 8 | ||
| 9 | 9 | <TabContentItem> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,180 @@ | |||
| 1 | + import { AppiumDriver, createDriver, logWarn, nsCapabilities } from "nativescript-dev-appium"; | ||
| 2 | + | ||
| 3 | + import { Screen, playersData, teamsData } from "./screen"; | ||
| 4 | + import * as shared from "./shared.e2e-spec"; | ||
| 5 | + import { suspendTime, appSuspendResume, dontKeepActivities, transitions } from "./config"; | ||
| 6 | + | ||
| 7 | + const roots = ["BottomNavigation"]; | ||
| 8 | + | ||
| 9 | + const rootType = "bottom-navigation-root"; | ||
| 10 | + describe(rootType, async function () { | ||
| 11 | + let driver: AppiumDriver; | ||
| 12 | + let screen: Screen; | ||
| 13 | + | ||
| 14 | + before(async function () { | ||
| 15 | + nsCapabilities.testReporter.context = this; | ||
| 16 | + logWarn(`====== ${rootType} ========`); | ||
| 17 | + driver = await createDriver(); | ||
| 18 | + screen = new Screen(driver); | ||
| 19 | + if (dontKeepActivities) { | ||
| 20 | + await driver.setDontKeepActivities(true); | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + driver.defaultWaitTime = 8000; | ||
| 24 | + }); | ||
| 25 | + | ||
| 26 | + after(async function () { | ||
| 27 | + if (dontKeepActivities) { | ||
| 28 | + await driver.setDontKeepActivities(false); | ||
| 29 | + } | ||
| 30 | + await driver.quit(); | ||
| 31 | + console.log("Quit driver!"); | ||
| 32 | + }); | ||
| 33 | + | ||
| 34 | + afterEach(async function () { | ||
| 35 | + if (this.currentTest.state === "failed") { | ||
| 36 | + await driver.logTestArtifacts(this.currentTest.title); | ||
| 37 | + } | ||
| 38 | + }); | ||
| 39 | + | ||
| 40 | + for (let index = 0; index < roots.length; index++) { | ||
| 41 | + const root = roots[index]; | ||
| 42 | + describe(`${rootType}-${root}-scenarios:`, async function () { | ||
| 43 | + | ||
| 44 | + before(async function () { | ||
| 45 | + nsCapabilities.testReporter.context = this; | ||
| 46 | + }); | ||
| 47 | + | ||
| 48 | + for (let index = 0; index < transitions.length; index++) { | ||
| 49 | + const transition = transitions[index]; | ||
| 50 | + | ||
| 51 | + const playerOne = playersData[`playerOne${transition}`]; | ||
| 52 | + const playerTwo = playersData[`playerTwo${transition}`]; | ||
| 53 | + const teamOne = teamsData[`teamOne${transition}`]; | ||
| 54 | + const teamTwo = teamsData[`teamTwo${transition}`]; | ||
| 55 | + | ||
| 56 | + describe(`${rootType}-${root}-transition-${transition}-scenarios:`, async function () { | ||
| 57 | + | ||
| 58 | + before(async function () { | ||
| 59 | + nsCapabilities.testReporter.context = this; | ||
| 60 | + | ||
| 61 | + if (transition === "Flip" && | ||
| 62 | + driver.isAndroid && parseInt(driver.platformVersion) === 19) { | ||
| 63 | + // TODO: known issue https://github.com/NativeScript/NativeScript/issues/6798 | ||
| 64 | + console.log("skipping flip transition tests on api level 19"); | ||
| 65 | + this.skip(); | ||
| 66 | + } | ||
| 67 | + }); | ||
| 68 | + | ||
| 69 | + it("loaded home page", async function () { | ||
| 70 | + await screen.loadedHome(); | ||
| 71 | + }); | ||
| 72 | + | ||
| 73 | + it(`loaded ${root} root with frames`, async function () { | ||
| 74 | + await screen[`navigateTo${root}RootWithFrames`](); | ||
| 75 | + await screen[`loaded${root}RootWithFrames`](); | ||
| 76 | + }); | ||
| 77 | + | ||
| 78 | + it("loaded players list", async function () { | ||
| 79 | + await screen.loadedPlayersList(); | ||
| 80 | + }); | ||
| 81 | + | ||
| 82 | + it("loaded player details and go back twice", async function () { | ||
| 83 | + await shared.testPlayerNavigated(playerTwo, screen); | ||
| 84 | + | ||
| 85 | + if (appSuspendResume) { | ||
| 86 | + await driver.backgroundApp(suspendTime); | ||
| 87 | + await driver.waitForElement(playerTwo.name); // wait for player | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + await shared.testPlayerNavigatedBack(screen, driver); | ||
| 91 | + | ||
| 92 | + if (appSuspendResume) { | ||
| 93 | + await driver.backgroundApp(suspendTime); | ||
| 94 | + await driver.waitForElement(playerOne.name); // wait for players list | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + await shared.testPlayerNavigated(playerTwo, screen); | ||
| 98 | + await shared.testPlayerNavigatedBack(screen, driver); | ||
| 99 | + }); | ||
| 100 | + | ||
| 101 | + it("toggle teams tab", async function () { | ||
| 102 | + await screen.toggleTeamsTab(); | ||
| 103 | + | ||
| 104 | + if (appSuspendResume) { | ||
| 105 | + await driver.backgroundApp(suspendTime); | ||
| 106 | + await driver.waitForElement(teamOne.name); // wait for teams list | ||
| 107 | + } | ||
| 108 | + }); | ||
| 109 | + | ||
| 110 | + it("loaded teams list", async function () { | ||
| 111 | + await screen.loadedTeamsList(); | ||
| 112 | + }); | ||
| 113 | + | ||
| 114 | + it("mix player and team list actions and go back", async function () { | ||
| 115 | + await screen.togglePlayersTab(); | ||
| 116 | + | ||
| 117 | + if (appSuspendResume) { | ||
| 118 | + await driver.backgroundApp(suspendTime); | ||
| 119 | + await driver.waitForElement(playerOne.name); // wait for players list | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + await screen.loadedPlayersList(); | ||
| 123 | + | ||
| 124 | + await shared.testPlayerNavigated(playerTwo, screen); | ||
| 125 | + | ||
| 126 | + if (driver.isIOS) { | ||
| 127 | + if (appSuspendResume) { | ||
| 128 | + await driver.backgroundApp(suspendTime); | ||
| 129 | + await driver.waitForElement(playerTwo.name); // wait for player | ||
| 130 | + } | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + await screen.toggleTeamsTab(); | ||
| 134 | + | ||
| 135 | + if (driver.isIOS) { | ||
| 136 | + // TODO: run in background from appium breaks the test. Investigate the issue, once with the app and with appium | ||
| 137 | + if (appSuspendResume) { | ||
| 138 | + await driver.backgroundApp(suspendTime); | ||
| 139 | + await driver.waitForElement(teamOne.name); // wait for teams list | ||
| 140 | + } | ||
| 141 | + } | ||
| 142 | + | ||
| 143 | + await screen.loadedTeamsList(); | ||
| 144 | + | ||
| 145 | + await shared.testTeamNavigated(teamTwo, screen); | ||
| 146 | + | ||
| 147 | + if (appSuspendResume) { | ||
| 148 | + await driver.backgroundApp(suspendTime); | ||
| 149 | + await driver.waitForElement(teamTwo.name); // wait for team | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + await screen.togglePlayersTab(); | ||
| 153 | + | ||
| 154 | + if (appSuspendResume) { | ||
| 155 | + await driver.backgroundApp(suspendTime); | ||
| 156 | + await driver.waitForElement(playerTwo.name); // wait for player | ||
| 157 | + } | ||
| 158 | + | ||
| 159 | + await screen.loadedPlayerDetails(playerTwo); | ||
| 160 | + | ||
| 161 | + await screen.toggleTeamsTab(); | ||
| 162 | + | ||
| 163 | + await screen.goBackToTeamsList(); | ||
| 164 | + await screen.loadedTeamsList(); | ||
| 165 | + | ||
| 166 | + await screen.togglePlayersTab(); | ||
| 167 | + | ||
| 168 | + await screen.goBackToPlayersList(); | ||
| 169 | + await screen.loadedPlayersList(); | ||
| 170 | + }); | ||
| 171 | + | ||
| 172 | + it("loaded home page again", async function () { | ||
| 173 | + await screen.resetToHome(); | ||
| 174 | + await screen.loadedHome(); | ||
| 175 | + }); | ||
| 176 | + }); | ||
| 177 | + } | ||
| 178 | + }); | ||
| 179 | + } | ||
| 180 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments