Skip to content

Commit 2f3070c

Browse files
Merge pull request #7216 from NativeScript/merge-release-in-master
chore: merge release in master
2 parents db4c024 + 3f50a79 commit 2f3070c

21 files changed

Lines changed: 280 additions & 205 deletions

‎e2e/animation/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.vscode/settings.json
2+
mochawesome-report

‎e2e/animation/e2e/animation.e2e-spec.ts‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
import { AppiumDriver, createDriver, SearchOptions } from "nativescript-dev-appium";
1+
import { AppiumDriver, createDriver, SearchOptions, nsCapabilities } from "nativescript-dev-appium";
22
import { Screen } from "./screen";
33
import { assert } from "chai";
44

5-
describe("animation:", () => {
5+
describe("animation:", async function () {
66

77
let driver: AppiumDriver;
88
let screen: Screen;
99

10-
before(async () => {
10+
before(async function () {
11+
nsCapabilities.testReporter.context = this;
1112
driver = await createDriver();
1213
screen = new Screen(driver);
1314

1415
await driver.resetApp();
1516
});
1617

17-
after(async () => {
18+
after(async function () {
1819
await driver.quit();
1920
console.log("Quit driver!");
2021
});
@@ -26,28 +27,28 @@ describe("animation:", () => {
2627
}
2728
});
2829

29-
it("should navigate to chaining with animation set example", async () => {
30+
it("should navigate to chaining with animation set example", async function () {
3031
await screen.loadedHome();
3132
await screen.loadedChainingWithAnimationSet();
3233
});
3334

34-
it("should play animation sequentially", async () => {
35+
it("should play animation sequentially", async function () {
3536
const buttonAnimate = await driver.findElementByText("Animate Sequentially", SearchOptions.exact);
3637
await buttonAnimate.click();
3738

3839
const label = await driver.findElementByText("{{N4}}", SearchOptions.exact);
3940
assert.isTrue(await label.isDisplayed());
4041
});
4142

42-
it ("should reset example", async() => {
43+
it("should reset example", async () => {
4344
const buttonReset = await driver.findElementByText("Reset", SearchOptions.exact);
4445
await buttonReset.click();
4546

4647
const label = await driver.findElementByText("{N4}", SearchOptions.exact);
4748
assert.isTrue(await label.isDisplayed());
4849
});
4950

50-
it("should play animation simultaneously", async () => {
51+
it("should play animation simultaneously", async function () {
5152
const button = await driver.findElementByText("Animate Simultaneously", SearchOptions.exact);
5253
await button.click();
5354

‎e2e/animation/e2e/setup.ts‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
import { AppiumDriver, createDriver, startServer, stopServer } from "nativescript-dev-appium";
1+
import { startServer, stopServer, ITestReporter, nsCapabilities, LogImageType, AppiumDriver, createDriver } from "nativescript-dev-appium";
2+
const addContext = require("mochawesome/addContext");
23

4+
const testReporterContext = <ITestReporter>{};
5+
testReporterContext.name = "mochawesome";
6+
testReporterContext.reportDir = "mochawesome-report";
7+
testReporterContext.log = addContext;
8+
testReporterContext.logImageTypes = [LogImageType.screenshots];
9+
nsCapabilities.testReporter = testReporterContext;
310
let driver: AppiumDriver;
411

5-
before("start server", async () => {
12+
before("start server", async function () {
13+
nsCapabilities.testReporter.context = this;
614
await startServer();
715
driver = await createDriver();
816
await driver.setDontKeepActivities(true);
917
});
1018

11-
after("stop server", async () => {
19+
after("stop server", async function () {
1220
await driver.setDontKeepActivities(false);
1321
await driver.quit();
1422
await stopServer();

‎e2e/animation/package.json‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@
1717
"tns-core-modules": "next"
1818
},
1919
"devDependencies": {
20-
"@types/chai": "~4.1.3",
21-
"@types/mocha": "~5.2.1",
22-
"@types/node": "10.11.4",
20+
"@types/chai": "~4.1.7",
21+
"@types/mocha": "~5.2.5",
22+
"@types/node": "~10.12.18",
2323
"babel-traverse": "6.26.0",
2424
"babel-types": "6.26.0",
2525
"babylon": "6.18.0",
2626
"lazy": "1.0.11",
27-
"mocha": "~5.1.0",
28-
"mocha-junit-reporter": "~1.17.0",
29-
"mocha-multi": "~1.0.0",
27+
"mocha": "~5.2.0",
28+
"mochawesome": "~3.1.2",
3029
"nativescript-dev-appium": "next",
3130
"nativescript-dev-typescript": "next",
3231
"nativescript-dev-webpack": "next"

‎e2e/config/mocha.opts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
--timeout 300000
22
--recursive e2e
3-
--reporter mocha-multi
4-
--reporter-options spec=-,mocha-junit-reporter=test-results.xml
3+
--reporter mochawesome
4+
--reporter-options quiet=true,html=true,inline=true,autoOpen=true
5+
--exit

‎e2e/modal-navigation/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.vscode/settings.json
2+
mochawesome-report

‎e2e/modal-navigation/e2e/android-back-button.e2e-spec.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import { AppiumDriver, createDriver, SearchOptions } from "nativescript-dev-appium";
1+
import { AppiumDriver, createDriver, SearchOptions, nsCapabilities } from "nativescript-dev-appium";
22
import { Screen, driverDefaultWaitTime, elementDefaultWaitTimeInSeconds } from "./screen"
33
import { assert } from "chai";
44

55
const exampleAndroidBackBtnEvents = "Android Back Btn Events";
66

7-
describe("android-navigate-back", () => {
7+
describe("android-navigate-back", async function () {
88
let driver: AppiumDriver;
99
let screen: Screen;
1010

11-
before(async () => {
11+
before(async function () {
12+
nsCapabilities.testReporter.context = this;
1213
driver = await createDriver();
1314
driver.defaultWaitTime = driverDefaultWaitTime;
1415
screen = new Screen(driver);
@@ -22,7 +23,7 @@ describe("android-navigate-back", () => {
2223
}
2324
});
2425

25-
after(async () => {
26+
after(async function () {
2627
await driver.resetApp();
2728
});
2829

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AppiumDriver, createDriver } from "nativescript-dev-appium";
1+
import { AppiumDriver, createDriver, nsCapabilities } from "nativescript-dev-appium";
22
import { Screen, driverDefaultWaitTime } from "./screen"
33
import {
44
roots,
@@ -10,21 +10,24 @@ import {
1010
testDialogBackground
1111
} from "./shared.e2e-spec"
1212

13-
describe("modal-frame:", () => {
13+
describe("modal-frame:", async function () {
1414

1515
let driver: AppiumDriver;
1616
let screen: Screen;
1717

18-
before(async () => {
18+
before(async function () {
19+
nsCapabilities.testReporter.context = this;
1920
driver = await createDriver();
2021
driver.defaultWaitTime = driverDefaultWaitTime;
2122
screen = new Screen(driver);
2223
});
2324

24-
roots.forEach(root => {
25-
describe(`${root} modal frame background scenarios:`, () => {
25+
for (let index = 0; index < roots.length; index++) {
26+
const root = roots[index];
27+
describe(`${root} modal frame background scenarios:`, async function () {
2628

27-
before(async () => {
29+
before(async function () {
30+
nsCapabilities.testReporter.context = this;
2831
await screen[root]();
2932
});
3033

@@ -40,38 +43,38 @@ describe("modal-frame:", () => {
4043
}
4144
});
4245

43-
after(async () => {
46+
after(async function () {
4447
await screen.closeModal();
4548
await screen.loadedHome();
4649
});
4750

48-
it("should show dialog confirm, run in background", async () => {
51+
it("should show dialog confirm, run in background", async function () {
4952
await testDialogBackground(driver, screen);
5053
});
5154

52-
it("should run modal page with frame in background", async () => {
55+
it("should run modal page with frame in background", async function () {
5356
await modalFrameBackground(driver, screen);
5457
});
5558

56-
it("should navigate to second page, run in background, go back", async () => {
59+
it("should navigate to second page, run in background, go back", async function () {
5760
await testSecondPageBackground(driver, screen);
5861
});
5962

60-
it("should show nested modal page with frame, run in background, close", async () => {
63+
it("should show nested modal page with frame, run in background, close", async function () {
6164
await testNestedModalFrameBackground(driver, screen);
6265
});
6366

64-
it("should show nested modal page, run in background, close", async () => {
67+
it("should show nested modal page, run in background, close", async function () {
6568
await testNestedModalPageBackground(driver, screen);
6669
});
6770

68-
it("should navigate to second page, close", async () => {
71+
it("should navigate to second page, close", async function () {
6972
await testSecondPageClose(driver, screen);
7073
});
7174

72-
it("should navigate to second page, run in background, go back", async () => {
75+
it("should navigate to second page, run in background, go back", async function () {
7376
await testSecondPageBackground(driver, screen);
7477
});
7578
});
76-
});
79+
};
7780
});
Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AppiumDriver, createDriver } from "nativescript-dev-appium";
1+
import { AppiumDriver, createDriver, nsCapabilities } from "nativescript-dev-appium";
22
import { Screen, driverDefaultWaitTime } from "./screen"
33
import {
44
roots,
@@ -10,21 +10,25 @@ import {
1010
testDialogBackground
1111
} from "./shared.e2e-spec"
1212

13-
describe("modal-layout:", () => {
13+
describe("modal-layout:", async function () {
1414

1515
let driver: AppiumDriver;
1616
let screen: Screen;
1717

18-
before(async () => {
18+
before(async function () {
19+
nsCapabilities.testReporter.context = this;
1920
driver = await createDriver();
2021
driver.defaultWaitTime = driverDefaultWaitTime;
2122
screen = new Screen(driver);
2223
});
2324

24-
roots.forEach(root => {
25-
describe(`${root} modal layout background scenarios:`, () => {
25+
for (let index = 0; index < roots.length; index++) {
26+
const root = roots[index];
27+
describe(`${root} modal layout background scenarios:`, async function () {
28+
29+
before(async function () {
30+
nsCapabilities.testReporter.context = this;
2631

27-
before(async () => {
2832
if (driver.isAndroid) {
2933
await driver.resetApp();
3034
}
@@ -43,38 +47,38 @@ describe("modal-layout:", () => {
4347
}
4448
});
4549

46-
after(async () => {
50+
after(async function () {
4751
await screen.closeModal();
4852
await screen.loadedHome();
4953
});
5054

51-
it("should show dialog confirm, run in background", async () => {
55+
it("should show dialog confirm, run in background", async function () {
5256
await testDialogBackground(driver, screen);
5357
});
5458

55-
it("should run modal layout in background", async () => {
59+
it("should run modal layout in background", async function () {
5660
await modalFrameBackground(driver, screen);
5761
});
5862

59-
it("should navigate to second page, run in background, go back", async () => {
63+
it("should navigate to second page, run in background, go back", async function () {
6064
await testSecondPageBackground(driver, screen);
6165
});
6266

63-
it("should show nested modal page with frame, run in background, close", async () => {
67+
it("should show nested modal page with frame, run in background, close", async function () {
6468
await testNestedModalFrameBackground(driver, screen);
6569
});
6670

67-
it("should show nested modal page, run in background, close", async () => {
71+
it("should show nested modal page, run in background, close", async function () {
6872
await testNestedModalPageBackground(driver, screen);
6973
});
7074

71-
it("should navigate to second page, close", async () => {
75+
it("should navigate to second page, close", async function () {
7276
await testSecondPageClose(driver, screen);
7377
});
7478

75-
it("should navigate to second page, run in background, go back", async () => {
79+
it("should navigate to second page, run in background, go back", async function () {
7680
await testSecondPageBackground(driver, screen);
7781
});
7882
});
79-
});
83+
};
8084
});

‎e2e/modal-navigation/e2e/modal-page.e2e-spec.ts‎

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AppiumDriver, createDriver } from "nativescript-dev-appium";
1+
import { AppiumDriver, createDriver, nsCapabilities } from "nativescript-dev-appium";
22
import { Screen, driverDefaultWaitTime } from "./screen"
33
import {
44
roots,
@@ -9,21 +9,24 @@ import {
99
testDialogBackground
1010
} from "./shared.e2e-spec"
1111

12-
describe("modal-page:", () => {
12+
describe("modal-page:", async function () {
1313

1414
let driver: AppiumDriver;
1515
let screen: Screen;
1616

17-
before(async () => {
17+
before(async function () {
18+
nsCapabilities.testReporter.context = this;
1819
driver = await createDriver();
1920
driver.defaultWaitTime = driverDefaultWaitTime;
2021
screen = new Screen(driver);
2122
});
2223

23-
roots.forEach(root => {
24-
describe(`${root} modal page background scenarios:`, () => {
24+
for (let index = 0; index < roots.length; index++) {
25+
const root = roots[index];
26+
describe(`${root} modal page background scenarios:`, async function () {
2527

26-
before(async () => {
28+
before(async function () {
29+
nsCapabilities.testReporter.context = this;
2730
if (driver.isAndroid) {
2831
await driver.resetApp();
2932
}
@@ -42,26 +45,26 @@ describe("modal-page:", () => {
4245
}
4346
});
4447

45-
after(async () => {
48+
after(async function () {
4649
await screen.closeModal();
4750
await screen.loadedHome();
4851
});
4952

50-
it("should show dialog confirm, run in background", async () => {
53+
it("should show dialog confirm, run in background", async function () {
5154
await testDialogBackground(driver, screen, false);
5255
});
5356

54-
it("should run modal page in background", async () => {
57+
it("should run modal page in background", async function () {
5558
await modalPageBackground(driver, screen, false);
5659
});
5760

58-
it("should show nested modal page with frame, run in background, close", async () => {
61+
it("should show nested modal page with frame, run in background, close", async function () {
5962
await testNestedModalFrameBackground(driver, screen, false);
6063
});
6164

62-
it("should show nested modal page, run in background, close", async () => {
65+
it("should show nested modal page, run in background, close", async function () {
6366
await testNestedModalPageBackground(driver, screen, false);
6467
});
6568
});
66-
});
69+
};
6770
});

0 commit comments

Comments
 (0)