mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 11:01:21 +08:00
tests: include mochawesome reporter
This commit is contained in:
1
e2e/animation/.gitignore
vendored
1
e2e/animation/.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
.vscode/settings.json
|
.vscode/settings.json
|
||||||
|
mochawesome-report
|
@ -1,20 +1,21 @@
|
|||||||
import { AppiumDriver, createDriver, SearchOptions } from "nativescript-dev-appium";
|
import { AppiumDriver, createDriver, SearchOptions, nsCapabilities } from "nativescript-dev-appium";
|
||||||
import { Screen } from "./screen";
|
import { Screen } from "./screen";
|
||||||
import { assert } from "chai";
|
import { assert } from "chai";
|
||||||
|
|
||||||
describe("animation:", () => {
|
describe("animation:", async function () {
|
||||||
|
|
||||||
let driver: AppiumDriver;
|
let driver: AppiumDriver;
|
||||||
let screen: Screen;
|
let screen: Screen;
|
||||||
|
|
||||||
before(async () => {
|
before(async function () {
|
||||||
|
nsCapabilities.testReporter.context = this;
|
||||||
driver = await createDriver();
|
driver = await createDriver();
|
||||||
screen = new Screen(driver);
|
screen = new Screen(driver);
|
||||||
|
|
||||||
await driver.resetApp();
|
await driver.resetApp();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async function () {
|
||||||
await driver.quit();
|
await driver.quit();
|
||||||
console.log("Quit driver!");
|
console.log("Quit driver!");
|
||||||
});
|
});
|
||||||
@ -26,12 +27,12 @@ describe("animation:", () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should navigate to chaining with animation set example", async () => {
|
it("should navigate to chaining with animation set example", async function () {
|
||||||
await screen.loadedHome();
|
await screen.loadedHome();
|
||||||
await screen.loadedChainingWithAnimationSet();
|
await screen.loadedChainingWithAnimationSet();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should play animation sequentially", async () => {
|
it("should play animation sequentially", async function () {
|
||||||
const buttonAnimate = await driver.findElementByText("Animate Sequentially", SearchOptions.exact);
|
const buttonAnimate = await driver.findElementByText("Animate Sequentially", SearchOptions.exact);
|
||||||
await buttonAnimate.click();
|
await buttonAnimate.click();
|
||||||
|
|
||||||
@ -39,7 +40,7 @@ describe("animation:", () => {
|
|||||||
assert.isTrue(await label.isDisplayed());
|
assert.isTrue(await label.isDisplayed());
|
||||||
});
|
});
|
||||||
|
|
||||||
it ("should reset example", async() => {
|
it("should reset example", async () => {
|
||||||
const buttonReset = await driver.findElementByText("Reset", SearchOptions.exact);
|
const buttonReset = await driver.findElementByText("Reset", SearchOptions.exact);
|
||||||
await buttonReset.click();
|
await buttonReset.click();
|
||||||
|
|
||||||
@ -47,7 +48,7 @@ describe("animation:", () => {
|
|||||||
assert.isTrue(await label.isDisplayed());
|
assert.isTrue(await label.isDisplayed());
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should play animation simultaneously", async () => {
|
it("should play animation simultaneously", async function () {
|
||||||
const button = await driver.findElementByText("Animate Simultaneously", SearchOptions.exact);
|
const button = await driver.findElementByText("Animate Simultaneously", SearchOptions.exact);
|
||||||
await button.click();
|
await button.click();
|
||||||
|
|
||||||
|
@ -1,14 +1,22 @@
|
|||||||
import { AppiumDriver, createDriver, startServer, stopServer } from "nativescript-dev-appium";
|
import { startServer, stopServer, ITestReporter, nsCapabilities, LogImageType, AppiumDriver, createDriver } from "nativescript-dev-appium";
|
||||||
|
const addContext = require('mochawesome/addContext');
|
||||||
|
|
||||||
|
const testReporterContext = <ITestReporter>{};
|
||||||
|
testReporterContext.name = "mochawesome";
|
||||||
|
testReporterContext.reportDir = "mochawesome-report";
|
||||||
|
testReporterContext.log = addContext;
|
||||||
|
testReporterContext.logImageTypes = [LogImageType.screenshots];
|
||||||
|
nsCapabilities.testReporter = testReporterContext;
|
||||||
let driver: AppiumDriver;
|
let driver: AppiumDriver;
|
||||||
|
|
||||||
before("start server", async () => {
|
before("start server", async function () {
|
||||||
|
nsCapabilities.testReporter.context = this;
|
||||||
await startServer();
|
await startServer();
|
||||||
driver = await createDriver();
|
driver = await createDriver();
|
||||||
await driver.setDontKeepActivities(true);
|
await driver.setDontKeepActivities(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
after("stop server", async () => {
|
after("stop server", async function () {
|
||||||
await driver.setDontKeepActivities(false);
|
await driver.setDontKeepActivities(false);
|
||||||
await driver.quit();
|
await driver.quit();
|
||||||
await stopServer();
|
await stopServer();
|
||||||
|
@ -17,16 +17,15 @@
|
|||||||
"tns-core-modules": "next"
|
"tns-core-modules": "next"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/chai": "~4.1.3",
|
"@types/chai": "~4.1.7",
|
||||||
"@types/mocha": "~5.2.1",
|
"@types/mocha": "~5.2.5",
|
||||||
"@types/node": "10.11.4",
|
"@types/node": "~10.12.18",
|
||||||
"babel-traverse": "6.26.0",
|
"babel-traverse": "6.26.0",
|
||||||
"babel-types": "6.26.0",
|
"babel-types": "6.26.0",
|
||||||
"babylon": "6.18.0",
|
"babylon": "6.18.0",
|
||||||
"lazy": "1.0.11",
|
"lazy": "1.0.11",
|
||||||
"mocha": "~5.1.0",
|
"mocha": "~5.2.0",
|
||||||
"mocha-junit-reporter": "~1.17.0",
|
"mochawesome": "~3.1.2",
|
||||||
"mocha-multi": "~1.0.0",
|
|
||||||
"nativescript-dev-appium": "next",
|
"nativescript-dev-appium": "next",
|
||||||
"nativescript-dev-typescript": "next",
|
"nativescript-dev-typescript": "next",
|
||||||
"nativescript-dev-webpack": "next"
|
"nativescript-dev-webpack": "next"
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
"version": "next"
|
"version": "next"
|
||||||
},
|
},
|
||||||
"tns-android": {
|
"tns-android": {
|
||||||
"version": "5.4.0-2019-05-02-235338-05"
|
"version": "next"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
"version": "next"
|
"version": "next"
|
||||||
},
|
},
|
||||||
"tns-android": {
|
"tns-android": {
|
||||||
"version": "5.4.0-2019-05-02-235338-05"
|
"version": "next"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
Reference in New Issue
Block a user