Files
NativeScript/e2e/animation/e2e/animation.e2e-spec.ts
2018-06-19 17:52:02 +03:00

58 lines
1.9 KiB
TypeScript

import { AppiumDriver, createDriver, SearchOptions } from "nativescript-dev-appium";
import { Screen } from "./screen";
import { assert } from "chai";
describe("animation:", () => {
let driver: AppiumDriver;
let screen: Screen;
before(async () => {
driver = await createDriver();
screen = new Screen(driver);
await driver.resetApp();
});
after(async () => {
await driver.quit();
console.log("Quit driver!");
});
afterEach(async function () {
if (this.currentTest.state === "failed") {
await driver.logPageSource(this.currentTest.title);
await driver.logScreenshot(this.currentTest.title);
}
});
it("should navigate to chaining with animation set example", async () => {
await screen.loadedHome();
await screen.loadedChainingWithAnimationSet();
});
it("should play animation sequentially", async () => {
const buttonAnimate = await driver.findElementByText("Animate Sequentially", SearchOptions.exact);
await buttonAnimate.click();
const label = await driver.findElementByText("{{N4}}", SearchOptions.exact);
assert.isTrue(await label.isDisplayed());
});
it ("should reset example", async() => {
const buttonReset = await driver.findElementByText("Reset", SearchOptions.exact);
await buttonReset.click();
const label = await driver.findElementByText("{N4}", SearchOptions.exact);
assert.isTrue(await label.isDisplayed());
});
it("should play animation simultaneously", async () => {
const button = await driver.findElementByText("Animate Simultaneously", SearchOptions.exact);
await button.click();
const label = await driver.findElementByText("{{N4}}", SearchOptions.exact);
assert.isTrue(await label.isDisplayed());
});
});