diff --git a/e2e/animation-examples/e2e/smoke.e2e-spec.ts b/e2e/animation-examples/e2e/smoke.e2e-spec.ts index 199480a95..d3772f3ed 100644 --- a/e2e/animation-examples/e2e/smoke.e2e-spec.ts +++ b/e2e/animation-examples/e2e/smoke.e2e-spec.ts @@ -9,15 +9,30 @@ import { AnimationWithOptionsPage } from "./pages/animation-with-options-page"; import { AnimationsWithDefaultOptionsPage } from "./pages/animations-with-default-options-page"; import { AnimateChildPage } from "./pages/animate-child-page"; import { HeroPage } from "./pages/hero-page"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; + +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. +const isSauceRun = isSauceLab; describe("smoke-tests", async function () { let driver: AppiumDriver; before(async function () { + this.timeout(QUEUE_WAIT_TIME); nsCapabilities.testReporter.context = this; driver = await createDriver(); }); + after(async function () { + if (isSauceRun) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } + await driver.quit(); + console.log("Quit driver!"); + }); + afterEach(async function () { if (this.currentTest.state === "failed") { await driver.logTestArtifacts(this.currentTest.title); diff --git a/e2e/animation-examples/package.json b/e2e/animation-examples/package.json index 088616b84..66fcbe3d6 100644 --- a/e2e/animation-examples/package.json +++ b/e2e/animation-examples/package.json @@ -41,7 +41,7 @@ "mocha": "~5.2.0", "mochawesome": "~3.1.2", "nativescript-css-loader": "~0.26.0", - "nativescript-dev-appium": "next", + "nativescript-dev-appium": "^6.0.0", "nativescript-dev-webpack": "next", "typescript": "~3.5.3" }, diff --git a/e2e/modal-navigation-ng/e2e/modal-frame.e2e-spec.ts b/e2e/modal-navigation-ng/e2e/modal-frame.e2e-spec.ts index ff58c3843..9438bb3a9 100644 --- a/e2e/modal-navigation-ng/e2e/modal-frame.e2e-spec.ts +++ b/e2e/modal-navigation-ng/e2e/modal-frame.e2e-spec.ts @@ -1,5 +1,5 @@ import { AppiumDriver, createDriver, nsCapabilities } from "nativescript-dev-appium"; -import { Screen } from "./screens/screen" +import { Screen } from "./screens/screen"; import { roots, modalFrameBackground, @@ -8,7 +8,11 @@ import { testNestedModalFrameBackground, testNestedModalPageBackground, testDialogBackground -} from "./screens/shared-screen" +} from "./screens/shared-screen"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; + +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. +const isSauceRun = isSauceLab; describe("modal-frame:", async function () { @@ -16,11 +20,22 @@ describe("modal-frame:", async function () { let screen: Screen; before(async function () { + this.timeout(QUEUE_WAIT_TIME); nsCapabilities.testReporter.context = this; driver = await createDriver(); screen = new Screen(driver); }); + after(async function () { + if (isSauceRun) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } + await driver.quit(); + console.log("Quit driver!"); + }); + for (let index = 0; index < roots.length; index++) { const root = roots[index]; describe(`${root} modal frame background scenarios:`, async function () { @@ -30,9 +45,6 @@ describe("modal-frame:", async function () { await screen[root](); }); - beforeEach(async function () { - }); - afterEach(async function () { if (this.currentTest.state === "failed") { await driver.logTestArtifacts(this.currentTest.title); diff --git a/e2e/modal-navigation-ng/e2e/modal-layout.e2e-spec.ts b/e2e/modal-navigation-ng/e2e/modal-layout.e2e-spec.ts index 1cdcdf333..b660f4f44 100644 --- a/e2e/modal-navigation-ng/e2e/modal-layout.e2e-spec.ts +++ b/e2e/modal-navigation-ng/e2e/modal-layout.e2e-spec.ts @@ -4,17 +4,33 @@ import { roots, testNestedModalPageBackground, testDialogBackground, -} from "./screens/shared-screen" +} from "./screens/shared-screen"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; + +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. +const isSauceRun = isSauceLab; describe("modal-layout:", async function () { let driver: AppiumDriver; let screen: Screen; before(async function () { + this.timeout(QUEUE_WAIT_TIME); nsCapabilities.testReporter.context = this; driver = await createDriver(); screen = new Screen(driver); }); + + after(async function () { + if (isSauceRun) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } + await driver.quit(); + console.log("Quit driver!"); + }); + for (let index = 0; index < roots.length; index++) { const root = roots[index]; describe(`${root} modal no frame background scenarios:`, async function () { diff --git a/e2e/modal-navigation-ng/e2e/modal-on-init.e2e-spec.ts b/e2e/modal-navigation-ng/e2e/modal-on-init.e2e-spec.ts index 34f682b77..b72a326f1 100644 --- a/e2e/modal-navigation-ng/e2e/modal-on-init.e2e-spec.ts +++ b/e2e/modal-navigation-ng/e2e/modal-on-init.e2e-spec.ts @@ -1,161 +1,169 @@ import { AppiumDriver, createDriver, nsCapabilities } from "nativescript-dev-appium"; import { Screen, sharedModalView, homeComponent } from "./screens/screen"; import { - assertComponent, - goBack, - navigateToSecondComponent + assertComponent, + goBack, + navigateToSecondComponent } from "./screens/shared-screen"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; const roots = [ - "setTabRootViewModal", - "setFrameRootViewModal", - "setNamedFrameRootViewModal", + "setTabRootViewModal", + "setFrameRootViewModal", + "setNamedFrameRootViewModal", ]; +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. +const isSauceRun = isSauceLab; describe("modal-on-init:", async function () { - let driver: AppiumDriver; - let screen: Screen; + let driver: AppiumDriver; + let screen: Screen; - before(async function () { - nsCapabilities.testReporter.context = this; - - driver = await createDriver(); - screen = new Screen(driver); - }); - - after("modal-on-init after all hook", async function () { - await driver.logTestArtifacts("modal-on-init"); - }); - - for (let index = 0; index < roots.length; index++) { - const root = roots[index]; - describe("Shared Modal on Init", async function () { - before(async function () { - nsCapabilities.testReporter.context = this; - await screen[root](); - console.log(`Root: ${root}`); - }); - - beforeEach(async function () { }); - - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - await driver.resetApp(); - await screen[root](); - } - }); - - after("root after all hook", async function () { - await driver.logTestArtifacts(`${root}_root_after_all_hook`); - }); - - it("should shared modal view", async function () { - await assertComponent(driver, sharedModalView); - }); - - it("run in background", async function () { - await driver.backgroundApp(1); - await assertComponent(driver, sharedModalView); - }); - - it("should close shared modal ", async function () { - await screen.closeModal(); - await screen.loadedHome(); - }); - - it("should open/close shared modal", async function () { - await screen.loadSharedModal(true); - await screen.closeModal(); - await screen.loadedHome(); - }); - - it("should open/close shared modal again", async function () { - await screen.loadSharedModal(true); - if (driver.isAndroid) { - await driver.navBack(); - } else { - await screen.closeModal(); - } - await screen.loadedHome(); - }); - - it("should open/close modal with frame", async function () { - await screen.loadModalFrame(true); - await screen.closeModal(); - }); - - it("should open/close shared modal again", async function () { - await screen.loadSharedModal(true); - await screen.closeModal(); - }); - - it("run in background again", async function () { - await driver.backgroundApp(1); - await screen.loadedHome(); - }); - - it("should open/close shared modal second", async function () { - await screen.loadModalFrame(true); - await screen.closeModal(); - }); - }); - }; - - describe("Shared Modal on Init", async function () { - const root = "setLayoutRootViewModal"; before(async function () { - nsCapabilities.testReporter.context = this; - await screen[root](); - console.log(`Root: ${root}`); - }); - - beforeEach(async function () { }); - - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - await driver.resetApp(); - await screen[root](); - } - }); - - after("root after all hook", async function () { - await driver.logTestArtifacts(`${root}_root_after_all_hook`); - }); - - it("should shared modal view", async function () { - await assertComponent(driver, sharedModalView); - }); - - it("run in background", async function () { - await driver.backgroundApp(1); - await assertComponent(driver, sharedModalView); - }); - - it("should close shared modal ", async function () { - await screen.closeModal(); - await screen.loadedHome(); - }); + this.timeout(QUEUE_WAIT_TIME); + nsCapabilities.testReporter.context = this; - it("should open/close shared modal", async function () { - await screen.loadModalFrame(true); - await screen.closeModal(); + driver = await createDriver(); + screen = new Screen(driver); }); - it("run in background again", async function () { - await driver.backgroundApp(1); - await screen.loadedHome(); + after(async function () { + if (isSauceRun) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } + await driver.quit(); + console.log("Quit driver!"); }); - it("should open/close shared modal second", async function () { - await screen.loadModalFrame(true); - await screen.closeModal(); - }); + for (let index = 0; index < roots.length; index++) { + const root = roots[index]; + describe("Shared Modal on Init", async function () { + before(async function () { + nsCapabilities.testReporter.context = this; + await screen[root](); + console.log(`Root: ${root}`); + }); + + beforeEach(async function () { }); + + afterEach(async function () { + if (this.currentTest.state === "failed") { + await driver.logTestArtifacts(this.currentTest.title); + await driver.resetApp(); + await screen[root](); + } + }); + + after("root after all hook", async function () { + await driver.logTestArtifacts(`${root}_root_after_all_hook`); + }); + + it("should shared modal view", async function () { + await assertComponent(driver, sharedModalView); + }); + + it("run in background", async function () { + await driver.backgroundApp(1); + await assertComponent(driver, sharedModalView); + }); + + it("should close shared modal ", async function () { + await screen.closeModal(); + await screen.loadedHome(); + }); + + it("should open\\close shared modal", async function () { + await screen.loadSharedModal(true); + await screen.closeModal(); + await screen.loadedHome(); + }); + + it("should open\\close shared modal again", async function () { + await screen.loadSharedModal(true); + if (driver.isAndroid) { + await driver.navBack(); + } else { + await screen.closeModal(); + } + await screen.loadedHome(); + }); + + it("should open\\close modal with frame", async function () { + await screen.loadModalFrame(true); + await screen.closeModal(); + }); + + it("should open\\close shared modal again", async function () { + await screen.loadSharedModal(true); + await screen.closeModal(); + }); + + it("run in background again", async function () { + await driver.backgroundApp(1); + await screen.loadedHome(); + }); + + it("should open\\close shared modal second", async function () { + await screen.loadModalFrame(true); + await screen.closeModal(); + }); + }); + }; - it("should open/close shared modal", async function () { - await screen.loadSharedModal(true); - await screen.closeModal(); + describe("Shared Modal on Init", async function () { + const root = "setLayoutRootViewModal"; + before(async function () { + nsCapabilities.testReporter.context = this; + await screen[root](); + console.log(`Root: ${root}`); + }); + + afterEach(async function () { + if (this.currentTest.state === "failed") { + await driver.logTestArtifacts(this.currentTest.title); + await driver.resetApp(); + await screen[root](); + } + }); + + after("root after all hook", async function () { + await driver.logTestArtifacts(`${root}_root_after_all_hook`); + }); + + it("should shared modal view", async function () { + await assertComponent(driver, sharedModalView); + }); + + it("run in background", async function () { + await driver.backgroundApp(1); + await assertComponent(driver, sharedModalView); + }); + + it("should close shared modal ", async function () { + await screen.closeModal(); + await screen.loadedHome(); + }); + + it("should open\\close shared modal", async function () { + await screen.loadModalFrame(true); + await screen.closeModal(); + }); + + it("run in background again", async function () { + await driver.backgroundApp(1); + await screen.loadedHome(); + }); + + it("should open\\close shared modal second", async function () { + await screen.loadModalFrame(true); + await screen.closeModal(); + }); + + it("should open\\close shared modal", async function () { + await screen.loadSharedModal(true); + await screen.closeModal(); + }); }); - }); }); diff --git a/e2e/modal-navigation-ng/e2e/modal.shared.e2e-spec.ts b/e2e/modal-navigation-ng/e2e/modal.shared.e2e-spec.ts index 97170ff88..e68cc84d6 100644 --- a/e2e/modal-navigation-ng/e2e/modal.shared.e2e-spec.ts +++ b/e2e/modal-navigation-ng/e2e/modal.shared.e2e-spec.ts @@ -1,20 +1,34 @@ import { AppiumDriver, createDriver, nsCapabilities } from "nativescript-dev-appium"; -import { Screen } from "./screens/screen" +import { Screen } from "./screens/screen"; import { assertComponent, goBack, navigateToSecondComponent } from "./screens/shared-screen"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; const homeComponent = "Home Component"; const roots = ["setFrameRootView", "setTabRootView"]; +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. +const isSauceRun = isSauceLab; describe("modal-shared:", async function () { let driver: AppiumDriver; let screen: Screen; before(async function () { + this.timeout(QUEUE_WAIT_TIME); nsCapabilities.testReporter.context = this; driver = await createDriver(); screen = new Screen(driver); }); + after(async function () { + if (isSauceRun) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } + await driver.quit(); + console.log("Quit driver!"); + }); + for (let index = 0; index < roots.length; index++) { const root = roots[index]; describe("Shared modal from home component and back", async function () { @@ -36,17 +50,17 @@ describe("modal-shared:", async function () { await assertComponent(driver, homeComponent); }); - it("should open/close shared modal from home component", async function () { + it("should open\\close shared modal from home component", async function () { await screen.loadSharedModal(true); await screen.closeModal(); }); - it("should open/close shared modal from home component again", async function () { + it("should open\\close shared modal from home component again", async function () { await screen.loadSharedModal(true); await screen.closeModal(); }); - it("should open/close shared modal with presentation style from home component", async function () { + it("should open\\close shared modal with presentation style from home component", async function () { await screen.loadSharedModalWithPresentationStyle(true); await screen.closeModal(); }); @@ -63,7 +77,7 @@ describe("modal-shared:", async function () { await assertComponent(driver, "second component"); }); - it("should open/close shared modal from second component", async function () { + it("should open\\close shared modal from second component", async function () { await screen.loadSharedModal(true); await screen.closeModal(); }); @@ -80,40 +94,29 @@ describe("modal-shared:", async function () { }; describe("modal-shared-different-component:", async function () { - let driver: AppiumDriver; - let screen: Screen; before(async function () { nsCapabilities.testReporter.context = this; - driver = await createDriver(); - screen = new Screen(driver); + }); + + afterEach(async function () { + if (this.currentTest.state && this.currentTest.state === "failed") { + await driver.logTestArtifacts(this.currentTest.title); + } }); for (let index = 0; index < roots.length; index++) { - const root = roots[index]; describe("Shared modal from different components", async function () { before(async function () { nsCapabilities.testReporter.context = this; - driver = await createDriver(); await driver.resetApp(); }); - after(async function () { - await driver.quit(); - console.log("Quit driver!"); - }); - - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); - it("should find home component", async function () { await screen.loadedHome(); }); - it("should open/close shared modal from home component", async function () { + it("should open\\close shared modal from home component", async function () { await screen.loadSharedModal(true); await screen.closeModal(); }); @@ -130,7 +133,7 @@ describe("modal-shared:", async function () { await assertComponent(driver, "second component"); }); - it("should open/close shared modal from second component", async function () { + it("should open\\close shared modal from second component", async function () { await screen.loadSharedModal(true); await screen.closeModal(); }); @@ -144,7 +147,7 @@ describe("modal-shared:", async function () { await screen.loadedHome(); }); - it("should open/close shared modal from home component after manipulations with second", async function () { + it("should open\\close shared modal from home component after manipulations with second", async function () { await screen.loadSharedModal(true); await screen.closeModal(); }); diff --git a/e2e/modal-navigation-ng/package.json b/e2e/modal-navigation-ng/package.json index fc6d57e7f..21a2a6c7a 100644 --- a/e2e/modal-navigation-ng/package.json +++ b/e2e/modal-navigation-ng/package.json @@ -40,7 +40,7 @@ "lazy": "1.0.11", "mocha": "~5.2.0", "mochawesome": "~3.1.2", - "nativescript-dev-appium": "next", + "nativescript-dev-appium": "^6.0.0", "nativescript-dev-webpack": "next", "tns-platform-declarations": "next", "typescript": "~3.5.3" diff --git a/e2e/nested-router-tab-view/e2e/custom-tabs.e2e-spec.ts b/e2e/nested-router-tab-view/e2e/custom-tabs.e2e-spec.ts index 654e2a3ff..505bbe6e0 100644 --- a/e2e/nested-router-tab-view/e2e/custom-tabs.e2e-spec.ts +++ b/e2e/nested-router-tab-view/e2e/custom-tabs.e2e-spec.ts @@ -2,22 +2,30 @@ import { AppiumDriver, createDriver, nsCapabilities } from "nativescript-dev-app import { Screen } from "./screen" import { testPlayerNavigated, - testTeamNavigated, - testPlayerNextNavigated, - testTeamNextNavigated, -} from "./shared.e2e-spec" + testTeamNavigated +} from "./shared.e2e-spec"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; + +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. +const isSauceRun = isSauceLab; describe("custom-tabs:", async function () { let driver: AppiumDriver; let screen: Screen; before(async function () { + this.timeout(QUEUE_WAIT_TIME); nsCapabilities.testReporter.context = this; driver = await createDriver(); screen = new Screen(driver); }); after(async function () { + if (isSauceRun) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } await driver.quit(); console.log("Quit driver!"); }); @@ -46,7 +54,7 @@ describe("custom-tabs:", async function () { await screen.loadedTeamList(); }); - it("navigate back to login and again to custom tabs", async function () { + it("navigate to custom tabs player and team details", async function () { await gotoPlayersTab(driver); await testPlayerNavigated(screen, screen.playerOne); await gotoTeamsTab(driver); diff --git a/e2e/nested-router-tab-view/e2e/home-tabs.e2e-spec.ts b/e2e/nested-router-tab-view/e2e/home-tabs.e2e-spec.ts index 9444c7177..22aacd338 100644 --- a/e2e/nested-router-tab-view/e2e/home-tabs.e2e-spec.ts +++ b/e2e/nested-router-tab-view/e2e/home-tabs.e2e-spec.ts @@ -3,12 +3,12 @@ import { Screen } from "./screen" import { testPlayerNavigated, testTeamNavigated, - testPlayerNextNavigated, - testTeamNextNavigated, - testPlayersNavigated, - canGoBack, - testTeamsNavigated -} from "./shared.e2e-spec" + testPlayerNextNavigated +} from "./shared.e2e-spec"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; + +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. +const isSauceRun = isSauceLab; const pages = ["Go To Home Page", "Go To Lazy Home Page"]; @@ -17,12 +17,18 @@ describe("home-tabs:", async function () { let screen: Screen; before(async function () { + this.timeout(QUEUE_WAIT_TIME); nsCapabilities.testReporter.context = this; driver = await createDriver(); screen = new Screen(driver); }); after(async function () { + if (isSauceRun) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } await driver.quit(); console.log("Quit driver!"); }); @@ -67,7 +73,7 @@ describe("home-tabs:", async function () { await screen.loadedTeamList(); }); - it("should navigate to Tabs without Players/Teams navigation", async function () { + it("should navigate to Tabs without Players\\Teams navigation", async function () { await screen.navigateToTabsPage(); await screen.loadedTabs(); await screen.loadedPlayersList(); @@ -77,7 +83,7 @@ describe("home-tabs:", async function () { await screen.loadedTeamList(); }); - it("should navigate Player One/Team One then go to Tabs and back", async function () { + it("should navigate Player One\\Team One then go to Tabs and back", async function () { await testPlayerNavigated(screen, screen.playerOne); await testTeamNavigated(screen, screen.teamOne); await screen.navigateToTabsPage(); diff --git a/e2e/nested-router-tab-view/e2e/split-view.e2e-spec.ts b/e2e/nested-router-tab-view/e2e/split-view.e2e-spec.ts index 6b7710ebb..3145a70c7 100644 --- a/e2e/nested-router-tab-view/e2e/split-view.e2e-spec.ts +++ b/e2e/nested-router-tab-view/e2e/split-view.e2e-spec.ts @@ -7,7 +7,11 @@ import { testTeamNextNavigated, testPlayersNavigated, canGoBack -} from "./shared.e2e-spec" +} from "./shared.e2e-spec"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; + +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. +const isSauceRun = isSauceLab; const pages = ["Go To Home Page", "Go To Lazy Home Page"]; @@ -16,17 +20,22 @@ describe("split-view:", async function () { let screen: Screen; before(async function () { + this.timeout(QUEUE_WAIT_TIME); nsCapabilities.testReporter.context = this; driver = await createDriver(); screen = new Screen(driver); }); after(async function () { + if (isSauceRun) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } await driver.quit(); console.log("Quit driver!"); }); - for (let index = 0; index < pages.length; index++) { const page = pages[index]; describe(`${page} split-view:`, async function () { @@ -49,7 +58,7 @@ describe("split-view:", async function () { await canGoBack(screen, screen.canGoBackActivatedRoute, true); }); - it("should navigate Player One/Team One then back separately", async function () { + it("should navigate Player One\\Team One then back separately", async function () { await testPlayerNavigated(screen, screen.playerOne); await testTeamNavigated(screen, screen.teamOne); await canGoBack(screen, screen.canGoBackPlayers, true); @@ -61,7 +70,7 @@ describe("split-view:", async function () { await screen.loadedTeamList(); }); - it("should navigate Player One/Team One then back separately (keep order)", async function () { + it("should navigate Player One\\Team One then back separately (keep order)", async function () { await testPlayerNavigated(screen, screen.playerOne); await testTeamNavigated(screen, screen.teamOne); await backTeams(driver); @@ -70,7 +79,7 @@ describe("split-view:", async function () { await screen.loadedPlayersList(); }); - it("should navigate Player One/Team One then back simultaneously", async function () { + it("should navigate Player One\\Team One then back simultaneously", async function () { await testPlayerNavigated(screen, screen.playerOne); await testTeamNavigated(screen, screen.teamOne); await canGoBack(screen, screen.canGoBackBoth, true); @@ -80,7 +89,7 @@ describe("split-view:", async function () { await screen.loadedPlayersList(); }); - it("should navigate Player One/Team One then next Player/Team then back separately", async function () { + it("should navigate Player One\\Team One then next Player/Team then back separately", async function () { await testPlayerNavigated(screen, screen.playerOne); await testTeamNavigated(screen, screen.teamOne); await testPlayerNextNavigated(screen, screen.playerTwo); @@ -95,7 +104,7 @@ describe("split-view:", async function () { await screen.loadedPlayersList(); }); - it("should navigate Player One/Team One then back", async function () { + it("should navigate Player One\\Team One then back", async function () { await testPlayerNavigated(screen, screen.playerOne); await testTeamNavigated(screen, screen.teamOne); await back(driver); @@ -118,7 +127,7 @@ describe("split-view:", async function () { await screen.loadedPlayersList(); }); - it("should navigate Player One/Team One then Android back button", async function () { + it("should navigate Player One\\Team One then Android back button", async function () { if (driver.isAndroid) { await testPlayerNavigated(screen, screen.playerOne); await testTeamNavigated(screen, screen.teamOne); diff --git a/e2e/nested-router-tab-view/e2e/tab-view.e2e-spec.ts b/e2e/nested-router-tab-view/e2e/tab-view.e2e-spec.ts index 6a2899a37..5cb9e884e 100644 --- a/e2e/nested-router-tab-view/e2e/tab-view.e2e-spec.ts +++ b/e2e/nested-router-tab-view/e2e/tab-view.e2e-spec.ts @@ -5,19 +5,29 @@ import { testTeamNavigated, testPlayerNextNavigated, testTeamNextNavigated, -} from "./shared.e2e-spec" +} from "./shared.e2e-spec"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; + +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. +const isSauceRun = isSauceLab; describe("tab-view:", async function () { let driver: AppiumDriver; let screen: Screen; before(async function () { + this.timeout(QUEUE_WAIT_TIME); nsCapabilities.testReporter.context = this; driver = await createDriver(); screen = new Screen(driver); }); after(async function () { + if (isSauceRun) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } await driver.quit(); console.log("Quit driver!"); }); @@ -45,7 +55,7 @@ describe("tab-view:", async function () { await screen.loadedPlayersList(); }); - it("should navigate Player One/Team One then back separately", async function () { + it("should navigate Player One\\Team One then back separately", async function () { this.retries(2); await testPlayerNavigated(screen, screen.playerOne); await gotoTeamsTab(driver); @@ -57,7 +67,7 @@ describe("tab-view:", async function () { await screen.loadedPlayersList(); }); - it("should navigate Player One/Team One then next Player/Team then back", async function () { + it("should navigate Player One\\Team One then next Player\\Team then back", async function () { await testPlayerNavigated(screen, screen.playerOne); await testPlayerNextNavigated(screen, screen.playerTwo); await gotoTeamsTab(driver); diff --git a/e2e/nested-router-tab-view/package.json b/e2e/nested-router-tab-view/package.json index 22cf2c490..d0771bc08 100644 --- a/e2e/nested-router-tab-view/package.json +++ b/e2e/nested-router-tab-view/package.json @@ -34,7 +34,7 @@ "lazy": "1.0.11", "mocha": "~5.2.0", "mochawesome": "~3.1.2", - "nativescript-dev-appium": "next", + "nativescript-dev-appium": "^6.0.0", "nativescript-dev-webpack": "next", "typescript": "~3.5.3" }, diff --git a/e2e/renderer/e2e/action-bar.e2e-spec.ts b/e2e/renderer/e2e/action-bar.e2e-spec.ts index b03dad5da..11834ec4c 100644 --- a/e2e/renderer/e2e/action-bar.e2e-spec.ts +++ b/e2e/renderer/e2e/action-bar.e2e-spec.ts @@ -5,6 +5,10 @@ import { UIElement, nsCapabilities } from "nativescript-dev-appium"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; + +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. +const isSauceRun = isSauceLab; import { isOnTheLeft } from "./helpers/location"; import { assert } from "chai"; @@ -12,7 +16,31 @@ import { assert } from "chai"; describe("Action Bar scenario", async function () { let driver: AppiumDriver; - describe("dynamically add/remove ActionItems", async function () { + before(async function () { + this.timeout(QUEUE_WAIT_TIME); + nsCapabilities.testReporter.context = this; + driver = await createDriver(); + await driver.driver.resetApp(); + }); + + after(async function () { + if (isSauceRun) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } + await driver.quit(); + console.log("Quit driver!"); + }); + + afterEach(async function () { + if (this.currentTest.state === "failed") { + await driver.logTestArtifacts(this.currentTest.title); + } + }); + + + describe("dynamically add\\remove ActionItems", async function () { let firstActionItem: UIElement; let secondActionItem: UIElement; let toggleFirstButton: UIElement; @@ -20,14 +48,6 @@ describe("Action Bar scenario", async function () { before(async function () { nsCapabilities.testReporter.context = this; - driver = await createDriver(); - await driver.driver.resetApp(); - }); - - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } }); it("should navigate to page", async function () { @@ -115,16 +135,9 @@ describe("Action Bar scenario", async function () { before(async function () { nsCapabilities.testReporter.context = this; - driver = await createDriver(); await driver.driver.resetApp(); }); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); - it("should navigate to page", async function () { const navigationButton = await driver.findElementByAutomationText("ActionBarExtension"); diff --git a/e2e/renderer/e2e/ngfor.e2e-spec.ts b/e2e/renderer/e2e/ngfor.e2e-spec.ts index e51c467b4..66ce292ee 100644 --- a/e2e/renderer/e2e/ngfor.e2e-spec.ts +++ b/e2e/renderer/e2e/ngfor.e2e-spec.ts @@ -7,6 +7,10 @@ import { } from "nativescript-dev-appium"; import { isAbove } from "./helpers/location"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; + +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. +const isSauceRun = isSauceLab; describe("ngFor scenario", async function () { let driver: AppiumDriver; @@ -16,11 +20,22 @@ describe("ngFor scenario", async function () { let lastAddedElementId = 0; before(async function () { + this.timeout(QUEUE_WAIT_TIME); nsCapabilities.testReporter.context = this; driver = await createDriver(); await driver.driver.resetApp(); }); + after(async function () { + if (isSauceRun) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } + await driver.quit(); + console.log("Quit driver!"); + }); + afterEach(async function () { if (this.currentTest.state === "failed") { await driver.logTestArtifacts(this.currentTest.title); diff --git a/e2e/renderer/e2e/ngforof.e2e-spec.ts b/e2e/renderer/e2e/ngforof.e2e-spec.ts index 57b844d62..ef0d88004 100644 --- a/e2e/renderer/e2e/ngforof.e2e-spec.ts +++ b/e2e/renderer/e2e/ngforof.e2e-spec.ts @@ -7,6 +7,9 @@ import { } from "nativescript-dev-appium"; import { isAbove } from "./helpers/location"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; + +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. interface ElementTuple { label: UIElement, @@ -22,11 +25,22 @@ describe("ngForOf scenario", function () { let lastAddedElementId = 0; before(async function () { + this.timeout(QUEUE_WAIT_TIME); nsCapabilities.testReporter.context = this; driver = await createDriver(); await driver.driver.resetApp(); }); + after(async function () { + if (isSauceLab) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } + await driver.quit(); + console.log("Quit driver!"); + }); + afterEach(async function () { if (this.currentTest.state === "failed") { await driver.logTestArtifacts(this.currentTest.title); diff --git a/e2e/renderer/e2e/ngif.e2e-spec.ts b/e2e/renderer/e2e/ngif.e2e-spec.ts index 128dc2b74..af8737c72 100644 --- a/e2e/renderer/e2e/ngif.e2e-spec.ts +++ b/e2e/renderer/e2e/ngif.e2e-spec.ts @@ -9,24 +9,39 @@ import { import { isAbove } from "./helpers/location"; import { assert } from "chai"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; + +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. + describe("ngIf scenario", async function () { let driver: AppiumDriver; let toggleButton: UIElement; - describe("without layout", async function () { - before(async function () { - nsCapabilities.testReporter.context = this; - driver = await createDriver(); - await driver.driver.resetApp(); - }); + before(async function () { + this.timeout(QUEUE_WAIT_TIME); + nsCapabilities.testReporter.context = this; + driver = await createDriver(); + await driver.driver.resetApp(); + }); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); + after(async function () { + if (isSauceLab) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } + await driver.quit(); + console.log("Quit driver!"); + }); + + afterEach(async function () { + if (this.currentTest.state === "failed") { + await driver.logTestArtifacts(this.currentTest.title); + } + }); + describe("without layout", async function () { it("should navigate to page", async function () { const navigationButton = await driver.findElementByAutomationText("NgIf no layout"); @@ -56,16 +71,9 @@ describe("ngIf scenario", async function () { before(async function () { nsCapabilities.testReporter.context = this; - driver = await createDriver(); await driver.driver.resetApp(); }); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); - it("should navigate to page", async function () { const navigationButton = await driver.findElementByAutomationText("NgIf inbetween"); @@ -105,16 +113,9 @@ describe("ngIf scenario", async function () { before(async function () { nsCapabilities.testReporter.context = this; - driver = await createDriver(); await driver.driver.resetApp(); }); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); - it("should navigate to page", async function () { const navigationButton = await driver.findElementByAutomationText("NgIfElse"); @@ -167,16 +168,9 @@ describe("ngIf scenario", async function () { before(async function () { nsCapabilities.testReporter.context = this; - driver = await createDriver(); await driver.driver.resetApp(); }); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); - it("should navigate to page", async function () { const navigationButton = await driver.findElementByAutomationText("NgIf Then Else"); @@ -229,16 +223,9 @@ describe("ngIf scenario", async function () { before(async function () { nsCapabilities.testReporter.context = this; - driver = await createDriver(); await driver.driver.resetApp(); }); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); - it("should navigate to page", async function () { const navigationButton = await driver.findElementByAutomationText("Content view"); @@ -292,16 +279,9 @@ describe("ngIf scenario", async function () { before(async function () { nsCapabilities.testReporter.context = this; - driver = await createDriver(); await driver.driver.resetApp(); }); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); - it("should navigate to page", async function () { const navigationButton = await driver.findElementByAutomationText("NgIf Subsequent Ifs"); diff --git a/e2e/renderer/e2e/page-router-outlet.e2e-spec.ts b/e2e/renderer/e2e/page-router-outlet.e2e-spec.ts index c904603c7..9b729ca27 100644 --- a/e2e/renderer/e2e/page-router-outlet.e2e-spec.ts +++ b/e2e/renderer/e2e/page-router-outlet.e2e-spec.ts @@ -6,23 +6,40 @@ import { nsCapabilities } from "nativescript-dev-appium"; import { assert } from "chai"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; + +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. describe("page-router-outlet-scenario", async function () { let driver: AppiumDriver; + before(async function () { + this.timeout(QUEUE_WAIT_TIME); + nsCapabilities.testReporter.context = this; + driver = await createDriver(); + await driver.driver.resetApp(); + }); + + after(async function () { + if (isSauceLab) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } + await driver.quit(); + console.log("Quit driver!"); + }); + + afterEach(async function () { + if (this.currentTest.state === "failed") { + await driver.logTestArtifacts(this.currentTest.title); + } + }); + describe("actionBarVisibility 'always' shows action bars", async function () { before(async function () { nsCapabilities.testReporter.context = this; - driver = await createDriver(); - await driver.driver.resetApp(); - }); - - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } }); - it("should navigate to page", async function () { const navigationButton = await driver.findElementByAutomationText("ActionBarVisibility Always"); @@ -56,7 +73,6 @@ describe("page-router-outlet-scenario", async function () { describe("actionBarVisibility 'never' doesn't show action bars", async function () { before(async function () { nsCapabilities.testReporter.context = this; - driver = await createDriver(); await driver.driver.resetApp(); }); @@ -100,19 +116,12 @@ describe("page-router-outlet-scenario", async function () { let imagePostFix = ""; before(async function () { nsCapabilities.testReporter.context = this; - driver = await createDriver(); await driver.driver.resetApp(); if (driver.isIOS && driver.nsCapabilities.device.name.toLowerCase().includes("x")) { imagePostFix = "-lazy"; } }); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); - it("should navigate to page", async function () { const navigationButton = await driver.findElementByAutomationText("ActionBarVisibility Never Lazy"); @@ -146,16 +155,9 @@ describe("page-router-outlet-scenario", async function () { describe("actionBarVisibility 'auto' shows action bars based on page", async function () { before(async function () { nsCapabilities.testReporter.context = this; - driver = await createDriver(); await driver.driver.resetApp(); }); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); - it("should navigate to page", async function () { const navigationButton = await driver.findElementByAutomationText("ActionBarVisibility Auto"); diff --git a/e2e/renderer/e2e/tab-view.e2e-spec.ts b/e2e/renderer/e2e/tab-view.e2e-spec.ts index 82f3b6f58..7cce1b36e 100644 --- a/e2e/renderer/e2e/tab-view.e2e-spec.ts +++ b/e2e/renderer/e2e/tab-view.e2e-spec.ts @@ -6,27 +6,41 @@ import { nsCapabilities } from "nativescript-dev-appium"; import { assert } from "chai"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; + +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. describe("TabView-scenario", async function(){ let driver: AppiumDriver; + before(async function(){ + this.timeout(QUEUE_WAIT_TIME); + nsCapabilities.testReporter.context = this; + driver = await createDriver(); + await driver.driver.resetApp(); + }); + + after(async function () { + if (isSauceLab) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } + await driver.quit(); + console.log("Quit driver!"); + }); + + afterEach(async function () { + if (this.currentTest.state === "failed") { + await driver.logTestArtifacts(this.currentTest.title); + } + }); + describe("dynamically change TabView item title, icon and textTransform", async function(){ let firstTabItem: UIElement; let secondTabItem: UIElement; let thirdTabItem: UIElement; - before(async function(){ - nsCapabilities.testReporter.context = this; - driver = await createDriver(); - await driver.driver.resetApp(); - }); - - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); - it("should navigate to page", async function(){ const navigationButton = await driver.findElementByAutomationText("TabItem Binding"); diff --git a/e2e/renderer/package.json b/e2e/renderer/package.json index b2deb6d97..61c360d37 100644 --- a/e2e/renderer/package.json +++ b/e2e/renderer/package.json @@ -34,7 +34,7 @@ "lazy": "1.0.11", "mocha": "~5.2.0", "mochawesome": "~3.1.2", - "nativescript-dev-appium": "^5.3.0", + "nativescript-dev-appium": "^6.0.0", "nativescript-dev-webpack": "next", "typescript": "~3.5.3" }, diff --git a/e2e/routable-animations/e2e/tests.e2e.ts b/e2e/routable-animations/e2e/tests.e2e.ts index 7b4011b21..0360271f5 100644 --- a/e2e/routable-animations/e2e/tests.e2e.ts +++ b/e2e/routable-animations/e2e/tests.e2e.ts @@ -1,16 +1,25 @@ import { AppiumDriver, createDriver, SearchOptions, nsCapabilities } from "nativescript-dev-appium"; import { assert } from "chai"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; -describe("sample scenario", () => { +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. + +describe("sample scenario", function () { const defaultWaitTime = 5000; let driver: AppiumDriver; before(async function () { + this.timeout(QUEUE_WAIT_TIME); nsCapabilities.testReporter.context = this; driver = await createDriver(); }); after(async function () { + if (isSauceLab) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } await driver.quit(); console.log("Quit driver!"); }); diff --git a/e2e/routable-animations/package.json b/e2e/routable-animations/package.json index 6bdb89c01..8024d5cec 100644 --- a/e2e/routable-animations/package.json +++ b/e2e/routable-animations/package.json @@ -36,7 +36,7 @@ "mocha": "~5.2.0", "mochawesome": "~3.1.2", "nativescript-css-loader": "~0.26.0", - "nativescript-dev-appium": "next", + "nativescript-dev-appium": "^6.0.0", "nativescript-dev-webpack": "next", "typescript": "~3.5.3" }, diff --git a/e2e/router-tab-view/e2e/tab-view-navigation.e2e-spec.ts b/e2e/router-tab-view/e2e/tab-view-navigation.e2e-spec.ts index f0ead8efa..9634d032b 100644 --- a/e2e/router-tab-view/e2e/tab-view-navigation.e2e-spec.ts +++ b/e2e/router-tab-view/e2e/tab-view-navigation.e2e-spec.ts @@ -1,14 +1,28 @@ import { AppiumDriver, createDriver, SearchOptions, nsCapabilities } from "nativescript-dev-appium"; import { assert } from "chai"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; + +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. describe("TabView with page-router-outlet in each tab", async function () { let driver: AppiumDriver; before(async function () { + this.timeout(QUEUE_WAIT_TIME); nsCapabilities.testReporter.context = this; driver = await createDriver(); }); + after(async function () { + if (isSauceLab) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } + await driver.quit(); + console.log("Quit driver!"); + }); + afterEach(async function () { if (this.currentTest.state === "failed") { await driver.logTestArtifacts(this.currentTest.title); @@ -31,8 +45,17 @@ describe("TabView with page-router-outlet in each tab", async function () { it("should go forward and go back on first(player) tab", async function () { await driver.findElementByAutomationText("Player List"); - - await navigateToPlayerItem(driver, "Player One", "1"); + let player = await driver.findElementByAutomationText("Player One"); + await player.click(); + await driver.wait(1000); + player = await driver.findElementByAutomationText("Player One"); + if (player) { + await player.click(); // First click does not open the details page + await driver.wait(2000); // Even its clicked twice it takes time to open the view + } + await driver.findElementByAutomationText("Player Details"); + await driver.findElementByAutomationText("1"); + await driver.findElementByAutomationText("Player One"); await driver.navBack(); await driver.findElementByAutomationText("Player List"); diff --git a/e2e/router-tab-view/package.json b/e2e/router-tab-view/package.json index fd6e2df60..4637596b4 100644 --- a/e2e/router-tab-view/package.json +++ b/e2e/router-tab-view/package.json @@ -32,7 +32,7 @@ "lazy": "1.0.11", "mocha": "~5.2.0", "mochawesome": "~3.1.2", - "nativescript-dev-appium": "next", + "nativescript-dev-appium": "^6.0.0", "nativescript-dev-webpack": "next", "typescript": "~3.5.3", "@angular/compiler-cli": "~8.2.0", diff --git a/e2e/router/e2e/router.e2e-spec.ts b/e2e/router/e2e/router.e2e-spec.ts index 010d282fa..9d600f8ab 100644 --- a/e2e/router/e2e/router.e2e-spec.ts +++ b/e2e/router/e2e/router.e2e-spec.ts @@ -5,46 +5,28 @@ import { SearchOptions, nsCapabilities, } from "nativescript-dev-appium"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; -describe("Simple navigate and back", async function(){ +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. + +describe("Router", async function(){ let driver: AppiumDriver; before(async function(){ + this.timeout(QUEUE_WAIT_TIME); nsCapabilities.testReporter.context = this; driver = await createDriver(); await driver.resetApp(); }); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); + after(async function () { + if (isSauceLab) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); } - }); - - it("should find First", async function(){ - await assureFirstComponent(driver); - }); - - it("should navigate to Second(1)/master", async function(){ - await findAndClick(driver, "GO TO SECOND"); - - await assureSecondComponent(driver, 1); - await assureNestedMasterComponent(driver); - }); - - it("should navigate back to First", async function(){ - await goBack(driver); - await assureFirstComponent(driver); - }); -}); - -describe("Navigate inside nested outlet", async function(){ - let driver: AppiumDriver; - - before(async function(){ - nsCapabilities.testReporter.context = this; - driver = await createDriver(); - await driver.resetApp(); + await driver.quit(); + console.log("Quit driver!"); }); afterEach(async function () { @@ -53,514 +35,461 @@ describe("Navigate inside nested outlet", async function(){ } }); - it("should find First", async function(){ - await assureFirstComponent(driver); - }); + describe("Simple navigate and back", async function(){ - it("should navigate to Second(1)/master", async function(){ - await findAndClick(driver, "GO TO SECOND"); + it("should find First", async function(){ + await assureFirstComponent(driver); + }); - await assureSecondComponent(driver, 1) - await assureNestedMasterComponent(driver); - }); + it("should navigate to Second(1)\\master", async function(){ + await findAndClick(driver, "GO TO SECOND"); - it("should navigate to Second(1)/detail(1) and back", async function(){ - const detailBtn = await driver.findElementByAutomationText("DETAIL 1"); - detailBtn.click(); - await assureSecondComponent(driver, 1) - await assureNestedDetailComponent(driver, 1); + await assureSecondComponent(driver, 1); + await assureNestedMasterComponent(driver); + }); - await goBack(driver); - await assureSecondComponent(driver, 1) - await assureNestedMasterComponent(driver); + it("should navigate back to First", async function(){ + await goBack(driver); + await assureFirstComponent(driver); + }); }); - it("should navigate to Second(1)/detail(2) and back", async function(){ - const detailBtn = await driver.findElementByAutomationText("DETAIL 2"); - detailBtn.click(); - await assureSecondComponent(driver, 1) - await assureNestedDetailComponent(driver, 2); - - await goBack(driver); - await assureSecondComponent(driver, 1) - await assureNestedMasterComponent(driver); - }); + describe("Navigate inside nested outlet", async function(){ - it("should navigate back to First", async function(){ - await goBack(driver); - await assureFirstComponent(driver); - }); -}); + before(async function(){ + nsCapabilities.testReporter.context = this; + await driver.resetApp(); + }); -describe("Navigate to same component with different param", async function(){ - let driver: AppiumDriver; + it("should find First", async function(){ + await assureFirstComponent(driver); + }); - before(async function(){ - nsCapabilities.testReporter.context = this; - driver = await createDriver(); - await driver.resetApp(); - }); + it("should navigate to Second(1)\\master", async function(){ + await findAndClick(driver, "GO TO SECOND"); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); + await assureSecondComponent(driver, 1) + await assureNestedMasterComponent(driver); + }); - it("should find First", async function(){ - await assureFirstComponent(driver); - }); + it("should navigate to Second(1)\\detail(1) and back", async function(){ + const detailBtn = await driver.findElementByAutomationText("DETAIL 1"); + detailBtn.click(); + await assureSecondComponent(driver, 1) + await assureNestedDetailComponent(driver, 1); - it("should navigate to Second(1)/master", async function(){ - await findAndClick(driver, "GO TO SECOND"); + await goBack(driver); + await assureSecondComponent(driver, 1) + await assureNestedMasterComponent(driver); + }); - await assureSecondComponent(driver, 1) - await assureNestedMasterComponent(driver); - }); + it("should navigate to Second(1)\\detail(2) and back", async function(){ + const detailBtn = await driver.findElementByAutomationText("DETAIL 2"); + detailBtn.click(); + await assureSecondComponent(driver, 1) + await assureNestedDetailComponent(driver, 2); - it("should navigate to Second(2)/master", async function(){ - const navigationButton = - await driver.findElementByAutomationText("GO TO NEXT SECOND"); - navigationButton.click(); + await goBack(driver); + await assureSecondComponent(driver, 1) + await assureNestedMasterComponent(driver); + }); - await assureSecondComponent(driver, 2) - await assureNestedMasterComponent(driver); + it("should navigate back to First", async function(){ + await goBack(driver); + await assureFirstComponent(driver); + }); }); - it("should navigate back to Second(1)/master", async function(){ - await goBack(driver); + describe("Navigate to same component with different param", async function(){ - await assureSecondComponent(driver, 1) - await assureNestedMasterComponent(driver); - }); + before(async function(){ + nsCapabilities.testReporter.context = this; + await driver.resetApp(); + }); - it("should navigate back to First", async function(){ - await goBack(driver); - await assureFirstComponent(driver); - }); -}); - -describe("Nested navigation + page navigation", async function(){ - let driver: AppiumDriver; + it("should find First", async function(){ + await assureFirstComponent(driver); + }); - before(async function(){ - nsCapabilities.testReporter.context = this; - driver = await createDriver(); - await driver.resetApp(); - }); + it("should navigate to Second(1)\\master", async function(){ + await findAndClick(driver, "GO TO SECOND"); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); + await assureSecondComponent(driver, 1) + await assureNestedMasterComponent(driver); + }); - it("should find First", async function(){ - await assureFirstComponent(driver); - }); + it("should navigate to Second(2)\\master", async function(){ + const navigationButton = + await driver.findElementByAutomationText("GO TO NEXT SECOND"); + navigationButton.click(); - it("should navigate to Second(1)/master", async function(){ - await findAndClick(driver, "GO TO SECOND"); + await assureSecondComponent(driver, 2) + await assureNestedMasterComponent(driver); + }); - await assureSecondComponent(driver, 1) - await assureNestedMasterComponent(driver); - }); + it("should navigate back to Second(1)\\master", async function(){ + await goBack(driver); - it("should navigate to Second(1)/detail(1)", async function(){ - const detailBtn = await driver.findElementByAutomationText("DETAIL 1"); - detailBtn.click(); + await assureSecondComponent(driver, 1) + await assureNestedMasterComponent(driver); + }); - await assureSecondComponent(driver, 1) - await assureNestedDetailComponent(driver, 1); + it("should navigate back to First", async function(){ + await goBack(driver); + await assureFirstComponent(driver); + }); }); - it("should navigate to Second(2)/master", async function(){ - const navigationButton = - await driver.findElementByAutomationText("GO TO NEXT SECOND"); - navigationButton.click(); + describe("Nested navigation + page navigation", async function(){ - await assureSecondComponent(driver, 2) - await assureNestedMasterComponent(driver); - }); + before(async function(){ + nsCapabilities.testReporter.context = this; + await driver.resetApp(); + }); - it("should navigate to Second(2)/detail(2)", async function(){ - const detailBtn = await driver.findElementByAutomationText("DETAIL 2"); - detailBtn.click(); + it("should find First", async function(){ + await assureFirstComponent(driver); + }); - await assureSecondComponent(driver, 2) - await assureNestedDetailComponent(driver, 2); - }); + it("should navigate to Second(1)\\master", async function(){ + await findAndClick(driver, "GO TO SECOND"); - it("should navigate to First", async function(){ - await findAndClick(driver, "GO TO FIRST"); + await assureSecondComponent(driver, 1) + await assureNestedMasterComponent(driver); + }); - await assureFirstComponent(driver); - }); + it("should navigate to Second(1)\\detail(1)", async function(){ + const detailBtn = await driver.findElementByAutomationText("DETAIL 1"); + detailBtn.click(); - it("should navigate the whole stack", async function(){ - await goBack(driver); - await assureSecondComponent(driver, 2) - await assureNestedDetailComponent(driver, 2); + await assureSecondComponent(driver, 1) + await assureNestedDetailComponent(driver, 1); + }); - await goBack(driver); - await assureSecondComponent(driver, 2) - await assureNestedMasterComponent(driver); + it("should navigate to Second(2)\\master", async function(){ + const navigationButton = + await driver.findElementByAutomationText("GO TO NEXT SECOND"); + navigationButton.click(); - await goBack(driver); - await assureSecondComponent(driver, 1) - await assureNestedDetailComponent(driver, 1); + await assureSecondComponent(driver, 2) + await assureNestedMasterComponent(driver); + }); - await goBack(driver); - await assureSecondComponent(driver, 1) - await assureNestedMasterComponent(driver); + it("should navigate to Second(2)\\detail(2)", async function(){ + const detailBtn = await driver.findElementByAutomationText("DETAIL 2"); + detailBtn.click(); - await goBack(driver); - await assureFirstComponent(driver); - }); -}); + await assureSecondComponent(driver, 2) + await assureNestedDetailComponent(driver, 2); + }); -describe("Nested name navigation + page navigation", async function(){ - let driver: AppiumDriver; + it("should navigate to First", async function(){ + await findAndClick(driver, "GO TO FIRST"); - before(async function(){ - nsCapabilities.testReporter.context = this; - driver = await createDriver(); - await driver.resetApp(); - }); + await assureFirstComponent(driver); + }); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); + it("should navigate the whole stack", async function(){ + await goBack(driver); + await assureSecondComponent(driver, 2) + await assureNestedDetailComponent(driver, 2); - it("should find First", async function(){ - await assureFirstComponent(driver); - }); + await goBack(driver); + await assureSecondComponent(driver, 2) + await assureNestedMasterComponent(driver); - it("should navigate to Second(1)/master", async function(){ - await findAndClick(driver, "GO TO SECOND"); + await goBack(driver); + await assureSecondComponent(driver, 1) + await assureNestedDetailComponent(driver, 1); - await assureSecondComponent(driver, 1) - await assureNestedMasterComponent(driver); - }); + await goBack(driver); + await assureSecondComponent(driver, 1) + await assureNestedMasterComponent(driver); - it("should load nested named Master", async function(){ - await findAndClick(driver, "LOAD NESTED NAMED OUTLET"); - await assureNamedNestedMasterComponent(driver); + await goBack(driver); + await assureFirstComponent(driver); + }); }); - it("should navigate to nested named Master Detail/1", async function(){ - const navigationButton = - await driver.findElementByAutomationText("DETAIL-NAMED 1"); - navigationButton.click(); + describe("Nested name navigation + page navigation", async function(){ - await assureNamedNestedDetailComponent(driver, 1); - }); + before(async function(){ + nsCapabilities.testReporter.context = this; + await driver.resetApp(); + }); - it("should navigate back to Master and navigate to Detail/2", async function(){ - let navigationButton = - await driver.findElementByAutomationText("BACK-NESTED"); - navigationButton.click(); + it("should find First", async function(){ + await assureFirstComponent(driver); + }); - await assureNamedNestedMasterComponent(driver); + it("should navigate to Second(1)\\master", async function(){ + await findAndClick(driver, "GO TO SECOND"); - navigationButton = - await driver.findElementByAutomationText("DETAIL-NAMED 2"); - navigationButton.click(); + await assureSecondComponent(driver, 1) + await assureNestedMasterComponent(driver); + }); - await assureNamedNestedDetailComponent(driver, 2); - }); -}); + it("should load nested named Master", async function(){ + await findAndClick(driver, "LOAD NESTED NAMED OUTLET"); + await assureNamedNestedMasterComponent(driver); + }); -describe("Shouldn't be able to navigate back on startup", async function(){ - let driver: AppiumDriver; + it("should navigate to nested named Master Detail\\1", async function(){ + const navigationButton = + await driver.findElementByAutomationText("DETAIL-NAMED 1"); + navigationButton.click(); - before(async function(){ - nsCapabilities.testReporter.context = this; - driver = await createDriver(); - await driver.resetApp(); - }); + await assureNamedNestedDetailComponent(driver, 1); + }); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); - - it("should find First", async function(){ - await assureFirstComponent(driver); - }); + it("should navigate back to Master and navigate to Detail\\2", async function(){ + let navigationButton = + await driver.findElementByAutomationText("BACK-NESTED"); + navigationButton.click(); - it("shouldn't be able to go back", async function(){ - await goBack(driver); - await driver.findElementByAutomationText("canGoBack() - false"); - }); -}); + await assureNamedNestedMasterComponent(driver); -describe("Shouldn't be able to navigate back after cleared history", async function(){ - let driver: AppiumDriver; + navigationButton = + await driver.findElementByAutomationText("DETAIL-NAMED 2"); + navigationButton.click(); - before(async function(){ - nsCapabilities.testReporter.context = this; - driver = await createDriver(); - await driver.resetApp(); + await assureNamedNestedDetailComponent(driver, 2); + }); }); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); + describe("Shouldn't be able to navigate back on startup", async function(){ - it("should find First", async function(){ - await assureFirstComponent(driver); - }); + before(async function(){ + nsCapabilities.testReporter.context = this; + await driver.resetApp(); + }); - it("should navigate to Second(1)/master", async function(){ - await findAndClick(driver, "GO TO SECOND"); + it("should find First", async function(){ + await assureFirstComponent(driver); + }); - await assureSecondComponent(driver, 1) - await assureNestedMasterComponent(driver); + it("shouldn't be able to go back", async function(){ + await goBack(driver); + await driver.findElementByAutomationText("canGoBack() - false"); + }); }); - it("should navigate to Second(1)/master", async function(){ - await findAndClick(driver, "GO TO FIRST(CLEAR)"); + describe("Shouldn't be able to navigate back after cleared history", async function(){ - await assureFirstComponent(driver); - }); + before(async function(){ + nsCapabilities.testReporter.context = this; + await driver.resetApp(); + }); - it("shouldn't be able to go back", async function(){ - await goBack(driver); - await driver.findElementByAutomationText("canGoBack() - false"); - }); -}); + it("should find First", async function(){ + await assureFirstComponent(driver); + }); -describe("Navigate to componentless route", async function(){ - let driver: AppiumDriver; + it("should navigate to Second(1)\\master", async function(){ + await findAndClick(driver, "GO TO SECOND"); - before(async function(){ - nsCapabilities.testReporter.context = this; - driver = await createDriver(); - await driver.resetApp(); - }); - - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); + await assureSecondComponent(driver, 1) + await assureNestedMasterComponent(driver); + }); - it("should find First", async function(){ - await assureFirstComponent(driver); - }); + it("should navigate to Second(1)\\master", async function(){ + await findAndClick(driver, "GO TO FIRST(CLEAR)"); - it("should navigate to ComponentlessSecond(100)/detail(200)", async function(){ - const navigationButton = - await driver.findElementByAutomationText("GO TO C-LESS SECOND"); - navigationButton.click(); + await assureFirstComponent(driver); + }); - await assureSecondComponent(driver, 100) - await assureNestedDetailComponent(driver, 200); + it("shouldn't be able to go back", async function(){ + await goBack(driver); + await driver.findElementByAutomationText("canGoBack() - false"); + }); }); - it("should navigate to First", async function(){ - await findAndClick(driver, "GO TO FIRST"); + describe("Navigate to componentless route", async function(){ - await assureFirstComponent(driver); - }); + before(async function(){ + nsCapabilities.testReporter.context = this; + await driver.resetApp(); + }); - it("should navigate the whole stack", async function(){ - await goBack(driver); - await assureSecondComponent(driver, 100) - await assureNestedDetailComponent(driver, 200); + it("should find First", async function(){ + await assureFirstComponent(driver); + }); - await goBack(driver); - await assureFirstComponent(driver); - }); -}); + it("should navigate to ComponentlessSecond(100)/detail(200)", async function(){ + const navigationButton = + await driver.findElementByAutomationText("GO TO C-LESS SECOND"); + navigationButton.click(); -describe("Navigate to lazy module", async function(){ - let driver: AppiumDriver; + await assureSecondComponent(driver, 100) + await assureNestedDetailComponent(driver, 200); + }); - before(async function(){ - nsCapabilities.testReporter.context = this; - driver = await createDriver(); - await driver.resetApp(); - }); + it("should navigate to First", async function(){ + await findAndClick(driver, "GO TO FIRST"); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); + await assureFirstComponent(driver); + }); - it("should find First", async function(){ - await assureFirstComponent(driver); - }); + it("should navigate the whole stack", async function(){ + await goBack(driver); + await assureSecondComponent(driver, 100) + await assureNestedDetailComponent(driver, 200); - it("should navigate to lazy/home", async function(){ - await findAndClick(driver, "GO TO LAZY HOME"); - await assureLazyComponent(driver); + await goBack(driver); + await assureFirstComponent(driver); + }); }); - it("should navigate to First", async function(){ - await findAndClick(driver, "GO TO FIRST"); - await assureFirstComponent(driver); - }); + describe("Navigate to lazy module", async function(){ - it("should navigate back to lazy/home", async function(){ - await goBack(driver); - await assureLazyComponent(driver); - }); + before(async function(){ + nsCapabilities.testReporter.context = this; + await driver.resetApp(); + }); - it("should navigate to First again", async function(){ - await findAndClick(driver, "GO TO FIRST"); - await assureFirstComponent(driver); - }); + it("should find First", async function(){ + await assureFirstComponent(driver); + }); - it("should navigate the whole stack", async function(){ - await goBack(driver); - await assureLazyComponent(driver); + it("should navigate to lazy\\home", async function(){ + await findAndClick(driver, "GO TO LAZY HOME"); + await assureLazyComponent(driver); + }); - await goBack(driver); - await assureFirstComponent(driver); - }); -}); + it("should navigate to First", async function(){ + await findAndClick(driver, "GO TO FIRST"); + await assureFirstComponent(driver); + }); -describe("Navigate to componentless lazy module route", async function(){ - let driver: AppiumDriver; + it("should navigate back to lazy\\home", async function(){ + await goBack(driver); + await assureLazyComponent(driver); + }); - before(async function(){ - nsCapabilities.testReporter.context = this; - driver = await createDriver(); - await driver.resetApp(); - }); + it("should navigate to First again", async function(){ + await findAndClick(driver, "GO TO FIRST"); + await assureFirstComponent(driver); + }); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); + it("should navigate the whole stack", async function(){ + await goBack(driver); + await assureLazyComponent(driver); - it("should find First", async function(){ - await assureFirstComponent(driver); + await goBack(driver); + await assureFirstComponent(driver); + }); }); - it("should navigate to nest/more (componentless lazy route)", async function(){ - await findAndClick(driver, "GO TO C-LESS LAZY"); + describe("Navigate to componentless lazy module route", async function(){ - await assureComponentlessLazyComponent(driver); - }); + before(async function(){ + nsCapabilities.testReporter.context = this; + await driver.resetApp(); + }); - it("should navigate to lazy/home", async function(){ - await findAndClick(driver, "GO TO LAZY HOME"); + it("should find First", async function(){ + await assureFirstComponent(driver); + }); - await assureLazyComponent(driver); - }); + it("should navigate to nest\\more (componentless lazy route)", async function(){ + await findAndClick(driver, "GO TO C-LESS LAZY"); - it("should navigate to First", async function(){ - await findAndClick(driver, "GO TO FIRST"); + await assureComponentlessLazyComponent(driver); + }); - await assureFirstComponent(driver); - }); + it("should navigate to lazy\\home", async function(){ + await findAndClick(driver, "GO TO LAZY HOME"); - it("should navigate the whole stack", async function(){ - await goBack(driver); - await assureLazyComponent(driver); + await assureLazyComponent(driver); + }); - await goBack(driver); - await assureComponentlessLazyComponent(driver); + it("should navigate to First", async function(){ + await findAndClick(driver, "GO TO FIRST"); - await goBack(driver); - await assureFirstComponent(driver); - }); -}); + await assureFirstComponent(driver); + }); -describe("Simple navigate and back should trigger only one CD on FirstComponent", async function(){ - let driver: AppiumDriver; + it("should navigate the whole stack", async function(){ + await goBack(driver); + await assureLazyComponent(driver); - before(async function(){ - nsCapabilities.testReporter.context = this; - driver = await createDriver(); - await driver.resetApp(); - }); + await goBack(driver); + await assureComponentlessLazyComponent(driver); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } + await goBack(driver); + await assureFirstComponent(driver); + }); }); - it("should find First", async function(){ - await assureFirstComponent(driver); - }); + describe("Simple navigate and back should trigger only one CD on FirstComponent", async function(){ - it("should reset counter", async function(){ - await findAndClick(driver, "RESET"); - await driver.waitForElement("CHECK: 1"); - }); + before(async function(){ + nsCapabilities.testReporter.context = this; + await driver.resetApp(); + }); - it("should navigate to Second(1)/master", async function(){ - await findAndClick(driver, "GO TO SECOND"); + it("should find First", async function(){ + await assureFirstComponent(driver); + }); - await assureSecondComponent(driver, 1); - await assureNestedMasterComponent(driver); - }); + it("should reset counter", async function(){ + await findAndClick(driver, "RESET"); + await driver.waitForElement("CHECK: 1"); + }); - it("should navigate back to First", async function(){ - await goBack(driver); - await assureFirstComponent(driver); - await driver.waitForElement("CHECK: 2"); - }); -}); + it("should navigate to Second(1)\\master", async function(){ + await findAndClick(driver, "GO TO SECOND"); -describe("Simple navigate and back should trigger only one CD on FirstComponent even with 3 changes in service", () => { - let driver: AppiumDriver; + await assureSecondComponent(driver, 1); + await assureNestedMasterComponent(driver); + }); - before(async function () { - driver = await createDriver(); - await driver.resetApp(); + it("should navigate back to First", async function(){ + await goBack(driver); + await assureFirstComponent(driver); + await driver.waitForElement("CHECK: 2"); + }); }); - afterEach(async function () { - if (this.currentTest.state === "failed") { - await driver.logTestArtifacts(this.currentTest.title); - } - }); - - it("should find First", async function () { - await assureFirstComponent(driver); - }); + describe("Simple navigate and back should trigger only one CD on FirstComponent even with 3 changes in service", function () { - it("should reset counter", async function () { - await findAndClick(driver, "RESET"); - await driver.waitForElement("CHECK: 1"); - await driver.waitForElement("COUNTER: 0"); - }); + before(async function () { + driver = await createDriver(); + await driver.resetApp(); + }); + + it("should find First", async function () { + await assureFirstComponent(driver); + }); - it("should navigate to Second(1)/master", async function () { - await findAndClick(driver, "GO TO SECOND"); + it("should reset counter", async function () { + await findAndClick(driver, "RESET"); + await driver.waitForElement("CHECK: 1"); + await driver.waitForElement("COUNTER: 0"); + }); - await assureSecondComponent(driver, 1); - await assureNestedMasterComponent(driver); - }); + it("should navigate to Second(1)\\master", async function () { + await findAndClick(driver, "GO TO SECOND"); - it("should increase counter", async function () { - await findAndClick(driver, "TICK"); - await findAndClick(driver, "TICK"); - await findAndClick(driver, "TICK"); - }); + await assureSecondComponent(driver, 1); + await assureNestedMasterComponent(driver); + }); - it("should navigate back to First", async function () { - await goBack(driver); - await assureFirstComponent(driver); - await driver.waitForElement("CHECK: 2"); - await driver.waitForElement("COUNTER: 3"); + it("should increase counter", async function () { + await findAndClick(driver, "TICK"); + await findAndClick(driver, "TICK"); + await findAndClick(driver, "TICK"); + }); + + it("should navigate back to First", async function () { + await goBack(driver); + await assureFirstComponent(driver); + await driver.waitForElement("CHECK: 2"); + await driver.waitForElement("COUNTER: 3"); + }); }); }); - async function assureFirstComponent(driver: AppiumDriver) { await driver.findElementByAutomationText("FirstComponent"); } diff --git a/e2e/router/package.json b/e2e/router/package.json index d9e3b1c91..65d8c663c 100644 --- a/e2e/router/package.json +++ b/e2e/router/package.json @@ -36,7 +36,7 @@ "lazy": "1.0.11", "mocha": "~5.2.0", "mochawesome": "~3.1.2", - "nativescript-dev-appium": "next", + "nativescript-dev-appium": "^6.0.0", "nativescript-dev-webpack": "next", "tslib": "^1.7.1", "typescript": "~3.5.3" diff --git a/e2e/single-page/e2e/tests.e2e-spec.ts b/e2e/single-page/e2e/tests.e2e-spec.ts index cf06732f1..def70f38b 100644 --- a/e2e/single-page/e2e/tests.e2e-spec.ts +++ b/e2e/single-page/e2e/tests.e2e-spec.ts @@ -3,15 +3,29 @@ import { createDriver, nsCapabilities, } from "nativescript-dev-appium"; +import { isSauceLab } from "nativescript-dev-appium/lib/parser"; + +const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. describe("Single page app", async function () { let driver: AppiumDriver; before(async function () { + this.timeout(QUEUE_WAIT_TIME); nsCapabilities.testReporter.context = this; driver = await createDriver(); }); + after(async function () { + if (isSauceLab) { + driver.sessionId().then(function (sessionId) { + console.log("Report https://saucelabs.com/beta/tests/" + sessionId); + }); + } + await driver.quit(); + console.log("Quit driver!"); + }); + afterEach(async function () { if (this.currentTest.state === "failed") { await driver.logTestArtifacts(this.currentTest.title); diff --git a/e2e/single-page/package.json b/e2e/single-page/package.json index 42927eeeb..001d8b0a6 100644 --- a/e2e/single-page/package.json +++ b/e2e/single-page/package.json @@ -36,7 +36,7 @@ "lazy": "1.0.11", "mocha": "~5.2.0", "mochawesome": "~3.1.2", - "nativescript-dev-appium": "next", + "nativescript-dev-appium": "^6.0.0", "nativescript-dev-webpack": "next", "tslib": "^1.7.1", "typescript": "~3.5.3"