Files
NativeScript/e2e/animation/e2e/setup.ts
SvetoslavTsenov 2ca4eba58f chore: fix tslint
2019-05-07 10:15:52 +03:00

24 lines
861 B
TypeScript

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;
before("start server", async function () {
nsCapabilities.testReporter.context = this;
await startServer();
driver = await createDriver();
await driver.setDontKeepActivities(true);
});
after("stop server", async function () {
await driver.setDontKeepActivities(false);
await driver.quit();
await stopServer();
});