chore: cleanup

This commit is contained in:
Nathan Walker
2020-07-23 14:03:37 -07:00
parent 6d039909af
commit 1e6fccf272
1534 changed files with 45656 additions and 45945 deletions

View File

@@ -0,0 +1,21 @@
import { AppiumDriver, logInfo } from "nativescript-dev-appium";
import { PageObjectBaseModel } from "../../../page-object-base-model";
export class StylesPage extends PageObjectBaseModel {
private readonly app = "app";
constructor(_driver: AppiumDriver) {
super(_driver, ["css", "styles"]);
}
async btnApp() {
return this._driver.waitForElement(this.app);
}
async tapAppBtn() {
await (await this.btnApp()).click();
logInfo(`Tap on '${this.app}' button.`);
}
}

View File

@@ -0,0 +1,41 @@
import { assert } from "chai";
import { AppiumDriver, createDriver, nsCapabilities } from "nativescript-dev-appium";
import { setImageName } from "../../../helpers/image-helper";
import { StylesPage } from "./styles-page";
const suite = "css";
const spec = "styles";
describe(`${suite}-${spec}-suite`, () => {
let driver: AppiumDriver;
let stylesPage: StylesPage;
before(async function () {
nsCapabilities.testReporter.context = this;
driver = await createDriver();
await driver.restartApp();
stylesPage = new StylesPage(driver);
await stylesPage.initSuite();
});
after(async function () {
await stylesPage.endSuite();
});
beforeEach(async function () {
driver.imageHelper.testName = setImageName(suite, spec, this.currentTest.title);
});
afterEach(async function () {
if (this.currentTest.state === "failed") {
await driver.logTestArtifacts(this.currentTest.title);
}
});
it(`${suite}-${spec}-apply`, async function () {
await stylesPage.tapAppBtn();
await driver.imageHelper.compareScreen();
assert.isTrue(driver.imageHelper.hasImageComparisonPassed());
});
});