-
-
Notifications
You must be signed in to change notification settings - Fork 241
/
Copy pathmodal-frame.e2e-spec.ts
77 lines (62 loc) · 2.45 KB
/
modal-frame.e2e-spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import { AppiumDriver, createDriver } from "nativescript-dev-appium";
import { Screen } from "./screen"
import {
roots,
modalFrameBackground,
testSecondPageBackground,
testSecondPageClose,
testNestedModalFrameBackground,
testNestedModalPageBackground,
testDialogBackground
} from "./shared.e2e-spec"
describe("modal-frame:", () => {
let driver: AppiumDriver;
let screen: Screen;
before(async () => {
driver = await createDriver();
screen = new Screen(driver);
});
roots.forEach(root => {
describe(`${root} modal frame background scenarios:`, () => {
before(async () => {
await screen[root]();
});
beforeEach(async function () {
await screen.loadModalFrame();
});
afterEach(async function () {
if (this.currentTest.state === "failed") {
await driver.logPageSource(this.currentTest.title);
await driver.logScreenshot(this.currentTest.title);
await driver.resetApp();
await screen[root]();
}
});
after(async () => {
await screen.closeModal();
await screen.loadedHome();
});
it("should show dialog confirm, run in background", async () => {
await testDialogBackground(driver, screen);
});
it("should run modal page with frame in background", async () => {
await modalFrameBackground(driver, screen);
});
it("should navigate to second page, run in background, go back", async () => {
await testSecondPageBackground(driver, screen);
});
it("should show nested modal page with frame, run in background, close", async () => {
await testNestedModalFrameBackground(driver, screen);
});
it("should show nested modal page, run in background, close", async () => {
await testNestedModalPageBackground(driver, screen);
});
it("should navigate to second page, close", async () => {
await testSecondPageClose(driver, screen);
});
it("should navigate to second page, run in background, go back", async () => {
await testSecondPageBackground(driver, screen);
});
});
});
});