FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: update test samples (#7016) · NativeScript/NativeScript@2efafc3 · GitHub

Repository navigation

Commit 2efafc3

Browse files
test: update test samples (#7016)
* test: update test samples
1 parent f9e008f commit 2efafc3

18 files changed

Lines changed: 133 additions & 74 deletions

File tree

‎apps/app/ui-tests-app/action-bar/icons.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</ActionBar>
99
</Page.actionBar>
1010
<StackLayout>
11-
<Button text="go to cleared page" tap="navigate"/>
11+
<Button text="go to cleared page" automationText="goToClearedPage" tap="navigate"/>
1212
<Button text="undefined" tap="onChangeRenderingMode"/>
1313
</StackLayout>
1414
</Page>

‎apps/app/ui-tests-app/action-bar/local-icons.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</ActionBar>
99
</Page.actionBar>
1010
<StackLayout>
11-
<Button text="go to cleared page" tap="navigate"/>
11+
<Button text="go to cleared page" automationText="goToClearedPage" tap="navigate"/>
1212
<Button text="undefined" tap="onChangeRenderingMode"/>
1313
</StackLayout>
1414
</Page>

‎apps/app/ui-tests-app/intent/main-page.ts‎

Lines changed: 0 additions & 17 deletions
This file was deleted.

‎apps/app/ui-tests-app/intent/main-page.xml‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎apps/app/ui-tests-app/intent/open-file.xml‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎apps/app/ui-tests-app/issues/main-page.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export function loadExamples() {
3030
examples.set("ng-repo-1599", "issues/issue-ng-repo-1599");
3131
examples.set("ng-repo-1626", "issues/issue-ng-repo-1626");
3232
examples.set("6439", "issues/issue-6439");
33+
examples.set("open-file-6895", "issues/open-file-6895")
3334

3435
return examples;
3536
}
File renamed without changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Page navigatingTo="navigatingTo">
2+
<GridLayout id="root">
3+
<Button text="Open File" automationText="openFile" tap="openFile" height="40"></Button>
4+
</GridLayout>
5+
</Page>
Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,36 @@
1-
export function onOuterWrapLayoutTap() {
2-
console.log("on outer wrap layout tap");
1+
import { EventData, Page } from "tns-core-modules/ui/page/page";
2+
import { Label } from "tns-core-modules/ui/label/label";
3+
4+
const setLabelTextAndLog = (args, text: string) => {
5+
const page = <Page>args.object.page;
6+
const label = <Label>page.getViewById("resultLabel");
7+
label.set("text", text);
8+
console.log("on button tap");
39
}
410

5-
export function onStackLayoutThrowTap() {
6-
throw new Error("Should not tap layout with IsPassThroughParentEnabled=true");
11+
export function onTap(args: EventData) {
12+
setLabelTextAndLog(args, "onButtonTapResult");
713
}
814

9-
export function onUserInteractionDisabledTap() {
10-
throw new Error("Should not tap button with IsUserInteractionEnabled=false");
15+
export function clearResult(args: EventData) {
16+
setLabelTextAndLog(args, "none");
1117
}
1218

13-
export function onDisabledThrowTap() {
14-
throw new Error("Should not tap button with IsEnabled=false");
19+
export function onOuterWrapLayoutTap(args) {
20+
setLabelTextAndLog(args, "onOuterWrapLayoutTapResult");
1521
}
1622

17-
export function onTap() {
18-
console.log("on button tap");
19-
}
23+
export function onStackLayoutThrowTap(args: EventData) {
24+
setLabelTextAndLog(args, "Should not tap layout with IsPassThroughParentEnabled=true");
25+
// throw new Error("Should not tap layout with IsPassThroughParentEnabled=true");
26+
}
27+
28+
export function onUserInteractionDisabledTap(args: EventData) {
29+
setLabelTextAndLog(args, "Should not tap button with IsUserInteractionEnabled=false");
30+
// throw new Error("Should not tap button with IsUserInteractionEnabled=false");
31+
}
32+
33+
export function onDisabledThrowTap(args: EventData) {
34+
setLabelTextAndLog(args, "Should not tap button with IsEnabled=false");
35+
// throw new Error("Should not tap button with IsEnabled=false");
36+
}
Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1-
<Page class="page" actionBarHidden="true" xmlns="http://schemas.nativescript.org/tns.xsd">
1+
<Page class="page" actionBarHidden="true"
2+
xmlns="http://schemas.nativescript.org/tns.xsd">
23

3-
<WrapLayout tap="onOuterWrapLayoutTap" backgroundColor="#bed3f4">
4-
5-
<StackLayout tap="onStackLayoutThrowTap" backgroundColor="#f3f9db" height="200" isPassThroughParentEnabled="true">
6-
<Label text="isPassThroughParentEnabled='true'" isUserInteractionEnabled="false" />
7-
<Button isUserInteractionEnabled="false" tap="onUserInteractionDisabledThrowTap" text="isUserInteractionEnabled='false'"></Button>
8-
<Button isEnabled="false" tap="onDisabledThrowTap" text="isEnabled='false'"></Button>
9-
<Button tap="onTap" text="TAP"></Button>
4+
<WrapLayout tap="onOuterWrapLayoutTap" automationText="onOuterWrapLayoutTap" backgroundColor="#bed3f4" padding="5">
5+
<StackLayout tap="onStackLayoutThrowTap" automationText="stackLayout1" backgroundColor="#f3f9db" height="180" isPassThroughParentEnabled="true">
6+
<Label automationText="label1" text="isPassThroughParentEnabled='true'" isUserInteractionEnabled="false" />
7+
<Button automationText="onUserInteractionDisabledThrowTap1" isUserInteractionEnabled="false" tap="onUserInteractionDisabledThrowTap" text="isUserInteractionEnabled='false'"></Button>
8+
<Button automationText="onDisabledThrowTap1" isEnabled="false" tap="onDisabledThrowTap" text="isEnabled='false'"></Button>
9+
<Button tap="onTap" text="TAP" automationText="btn1"></Button>
1010
</StackLayout>
1111

12-
<StackLayout tap="onStackLayoutThrowTap" style.margin="20" height="300" width="300" backgroundColor="#f5edf7" isPassThroughParentEnabled="true">
13-
<Label text="isPassThroughParentEnabled='true'" isUserInteractionEnabled="false" />
14-
<StackLayout tap="onStackLayoutThrowTap" backgroundColor="#f3f9db" height="200" isPassThroughParentEnabled="true">
15-
<Label text="isPassThroughParentEnabled='true'" isUserInteractionEnabled="false" />
16-
<Button isUserInteractionEnabled="false" tap="onUserInteractionDisabledThrowTap" text="isUserInteractionEnabled='false'"></Button>
17-
<Button isEnabled="false" tap="onDisabledThrowTap" text="isEnabled='false'"></Button>
18-
<Button tap="onTap" text="TAP"></Button>
12+
<StackLayout tap="onStackLayoutThrowTap" automationText="stackLayout2" style.margin="20" height="250" width="300" backgroundColor="#f5edf7" isPassThroughParentEnabled="true">
13+
<Label automationText="label2" text="isPassThroughParentEnabled='true'" isUserInteractionEnabled="false" />
14+
<StackLayout tap="onStackLayoutThrowTap" automationText="stackLayout3" backgroundColor="#f3f9db" height="200" isPassThroughParentEnabled="true">
15+
<Label automationText="label3" text="isPassThroughParentEnabled='true'" isUserInteractionEnabled="false" />
16+
<Button automationText="onUserInteractionDisabledThrowTap2" isUserInteractionEnabled="false" tap="onUserInteractionDisabledThrowTap" text="isUserInteractionEnabled='false'"></Button>
17+
<Button automationText="onDisabledThrowTap2" isEnabled="false" tap="onDisabledThrowTap" text="isEnabled='false'"></Button>
18+
<Button automationText="btn2" tap="onTap" text="TAP"></Button>
1919
</StackLayout>
2020
</StackLayout>
2121

22-
</WrapLayout>
22+
<Button text="x" automationText="clearResult" tap="clearResult" height="35" width="40" padding="0" />
2323

24+
<StackLayout>
25+
<Label id="resultLabel" textWrap="true" />
26+
</StackLayout>
27+
</WrapLayout>
2428
</Page>

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL