Skip to content

Commit 19040fb

Browse files
chore: speed up tests (#1583)
1 parent 129e1f9 commit 19040fb

9 files changed

+63
-76
lines changed

Diff for: e2e/modal-navigation-ng/app/home/home.component.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<ActionBar class="action-bar">
2-
<Label class="action-bar-title" text="Home Component"></Label>
2+
<Label class="action-bar-title" text="Home Component" automationText="Home Component" ></Label>
33
</ActionBar>
44

55
<WrapLayout>
@@ -9,7 +9,7 @@
99
<Button text="Reset Named Frame Root View" (tap)="onNamedFrameRootViewReset()"></Button>
1010
<Button text="Reset Frame Root View" (tap)="onFrameRootViewReset()"></Button>
1111
<Button text="Reset Tab Root View" (tap)="onTabRootViewReset()"></Button>
12-
<Button text="Reset Layout Root View" (tap)="onLayoutRootViewReset()"></Button>
12+
<Button text="Reset Layout Root View" automationText="Reset Layout Root View" (tap)="onLayoutRootViewReset()"></Button>
1313
<Button text="Show Dialog" (tap)="onShowDialog()"></Button>
1414

1515
<Button text="show shared modal" (tap)="onRootModalTap()"></Button>

Diff for: e2e/modal-navigation-ng/app/modal-nested/modal-nested.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
</ActionBar>
55

66
<GridLayout #rootLayout rows="auto" (showingModally)="onShowingModally($event)" backgroundColor="lightBlue">
7-
<Button text="Close Modal Nested" (tap)="close(rootLayout)"></Button>
7+
<Button text="Close Modal Nested" automationText="Close Modal Nested" (tap)="close(rootLayout)"></Button>
88
</GridLayout>

Diff for: e2e/modal-navigation-ng/app/modal-second/modal-second.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
<GridLayout #rootLayout rows="auto, auto" (loaded)="onLoaded($event)">
77
<Button text="Go Back(activatedRoute)" (tap)="goBack()"></Button>
8-
<Button row="1" text="Close Modal" (tap)="close(rootLayout)"></Button>
8+
<Button row="1" text="Close Modal" automationText="Close Modal" (tap)="close(rootLayout)"></Button>
99
</GridLayout>

Diff for: e2e/modal-navigation-ng/app/modal/modal.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<Button text="Show Nested Modal Page With Frame" (tap)="showNestedModalFrame()" [visibility]="navigationVisibility"></Button>
99
<Button text="Show Nested Modal Page" (tap)="showNestedModal()"></Button>
1010
<Button text="Show Dialog" (tap)="showDialogConfirm()"></Button>
11-
<Button text="Close Modal" (tap)="close(rootLayout)"></Button>
11+
<Button text="Close Modal" automationText="Close Modal" (tap)="close(rootLayout)"></Button>
1212
</StackLayout>
1313
</GridLayout>

Diff for: e2e/modal-navigation-ng/e2e/modal-frame.e2e-spec.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ describe("modal-frame:", () => {
2828
});
2929

3030
beforeEach(async function () {
31-
await screen.loadModalFrame();
3231
});
3332

3433
afterEach(async function () {
@@ -45,30 +44,37 @@ describe("modal-frame:", () => {
4544
});
4645

4746
it("should show dialog confirm, run in background", async () => {
47+
await screen.loadModalFrame(true);
4848
await testDialogBackground(driver, screen);
4949
});
5050

5151
it("should run modal page with frame in background", async () => {
52+
await screen.loadModalFrame(false);
5253
await modalFrameBackground(driver, screen);
5354
});
5455

5556
it("should navigate to second page, run in background, go back", async () => {
57+
await screen.loadModalFrame(false);
5658
await testSecondPageBackground(driver, screen);
5759
});
5860

5961
it("should show nested modal page with frame, run in background, close", async () => {
62+
await screen.loadModalFrame(false);
6063
await testNestedModalFrameBackground(driver, screen);
6164
});
6265

6366
it("should show nested modal page, run in background, close", async () => {
67+
await screen.loadModalFrame(false);
6468
await testNestedModalPageBackground(driver, screen);
6569
});
6670

6771
it("should navigate to second page, close", async () => {
72+
await screen.loadModalFrame(false);
6873
await testSecondPageClose(driver, screen);
6974
});
7075

7176
it("should navigate to second page, run in background, go back", async () => {
77+
await screen.loadModalFrame(true);
7278
await testSecondPageBackground(driver, screen);
7379
});
7480
});

Diff for: e2e/modal-navigation-ng/e2e/modal-layout.e2e-spec.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ import { AppiumDriver, createDriver } from "nativescript-dev-appium";
22
import { Screen } from "./screen"
33
import {
44
roots,
5-
modalFrameBackground,
6-
testSecondPageBackground,
7-
testSecondPageClose,
8-
testNestedModalFrameBackground,
95
testNestedModalPageBackground,
106
testDialogBackground,
117
} from "./shared.e2e-spec"
@@ -22,15 +18,10 @@ describe("modal-layout:", () => {
2218

2319
roots.forEach(root => {
2420
describe(`${root} modal no frame background scenarios:`, () => {
25-
2621
before(async () => {
2722
await screen[root]();
2823
});
2924

30-
beforeEach(async function () {
31-
await screen.loadModalNoFrame();
32-
});
33-
3425
afterEach(async function () {
3526
if (this.currentTest.state === "failed") {
3627
await driver.logTestArtifacts(this.currentTest.title);
@@ -45,10 +36,13 @@ describe("modal-layout:", () => {
4536
});
4637

4738
it("should show nested modal page, run in background, close", async () => {
39+
await screen.loadModalNoFrame(true);
4840
await testNestedModalPageBackground(driver, screen, false);
41+
4942
});
5043

5144
it("should show dialog confirm inside modal view with no frame, run in background", async () => {
45+
await screen.loadModalNoFrame(false);
5246
await testDialogBackground(driver, screen, false);
5347
});
5448
});

Diff for: e2e/modal-navigation-ng/e2e/modal.shared.e2e-spec.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ describe("Shared modal from home and back", () => {
1111
await driver.resetApp();
1212
});
1313

14-
after(async () => {
15-
await driver.quit();
16-
console.log("Quit driver!");
17-
});
18-
1914
afterEach(async function () {
2015
if (this.currentTest.state === "failed") {
2116
await driver.logTestArtifacts(this.currentTest.title);
@@ -93,8 +88,7 @@ describe("Shared modal from different components", () => {
9388

9489
afterEach(async function () {
9590
if (this.currentTest.state === "failed") {
96-
await driver.logPageSource(this.currentTest.title);
97-
await driver.logScreenshot(this.currentTest.title);
91+
await driver.logTestArtifacts(this.currentTest.title);
9892
}
9993
});
10094

0 commit comments

Comments
 (0)