mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(ios): translate transform breaks sequential animation set (#5961)
* fix(ios): translate transform breaks sequential animation set * chore: add e2e test app for animations
This commit is contained in:
48
e2e/animation/e2e/animation.e2e-spec.ts
Normal file
48
e2e/animation/e2e/animation.e2e-spec.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
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 play sequentially", async () => {
|
||||
await screen.loadedHome();
|
||||
|
||||
const button = await driver.findElementByText("Play Sequential Animation With Translate", SearchOptions.exact);
|
||||
await button.click();
|
||||
|
||||
const label = await driver.findElementByText("Label1 animated sequentially!", SearchOptions.exact);
|
||||
assert.isTrue(await label.isDisplayed());
|
||||
});
|
||||
|
||||
it("should play simultaneously", async () => {
|
||||
await screen.loadedHome();
|
||||
|
||||
const button = await driver.findElementByText("Play Simultaneous Animation With Translate", SearchOptions.exact);
|
||||
await button.click();
|
||||
|
||||
const label = await driver.findElementByText("Label2 animated simultaneously!", SearchOptions.exact);
|
||||
assert.isTrue(await label.isDisplayed());
|
||||
});
|
||||
});
|
||||
19
e2e/animation/e2e/screen.ts
Normal file
19
e2e/animation/e2e/screen.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { AppiumDriver } from "nativescript-dev-appium";
|
||||
import { assert } from "chai";
|
||||
|
||||
const home = "Home"
|
||||
|
||||
export class Screen {
|
||||
|
||||
private _driver: AppiumDriver
|
||||
|
||||
constructor(driver: AppiumDriver) {
|
||||
this._driver = driver;
|
||||
}
|
||||
|
||||
loadedHome = async () => {
|
||||
const lblHome = await this._driver.findElementByText(home);
|
||||
assert.isTrue(await lblHome.isDisplayed());
|
||||
console.log(home + " loaded!");
|
||||
}
|
||||
}
|
||||
15
e2e/animation/e2e/setup.ts
Normal file
15
e2e/animation/e2e/setup.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { AppiumDriver, createDriver, startServer, stopServer } from "nativescript-dev-appium";
|
||||
|
||||
let driver: AppiumDriver;
|
||||
|
||||
before("start server", async () => {
|
||||
await startServer();
|
||||
driver = await createDriver();
|
||||
await driver.setDontKeepActivities(true);
|
||||
});
|
||||
|
||||
after("stop server", async () => {
|
||||
await driver.setDontKeepActivities(false);
|
||||
await driver.quit();
|
||||
await stopServer();
|
||||
});
|
||||
19
e2e/animation/e2e/tsconfig.json
Normal file
19
e2e/animation/e2e/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"importHelpers": false,
|
||||
"sourceMap": true,
|
||||
"types": [
|
||||
"node",
|
||||
"mocha",
|
||||
"chai"
|
||||
],
|
||||
"lib": [
|
||||
"es2015",
|
||||
"dom"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user