mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
test: added missing page (#8493)
* test: added missing page * fix: use strings instead of Visiblity
This commit is contained in:
27
e2e/ui-tests-app/app/button/tappable-span-page.ts
Normal file
27
e2e/ui-tests-app/app/button/tappable-span-page.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Label } from "tns-core-modules/ui/label";
|
||||
import { EventData, TextBase } from "tns-core-modules/ui/text-base";
|
||||
import { Page } from "tns-core-modules/ui/page";
|
||||
|
||||
export function foxTap(args: EventData) {
|
||||
let page = <Page>(<any>args.object).page;
|
||||
let foxTapped = page.getViewById<Label>("foxTapped");
|
||||
foxTapped.visibility = "visible";
|
||||
|
||||
setTimeout(() => {
|
||||
foxTapped.visibility = "hidden";
|
||||
}, 1000);
|
||||
|
||||
console.log("foxTap");
|
||||
}
|
||||
|
||||
export function dogTap(args: EventData) {
|
||||
let page = <Page>(<any>args.object).page;
|
||||
let dogTapped = page.getViewById<Label>("dogTapped");
|
||||
dogTapped.visibility = "visible";
|
||||
|
||||
setTimeout(() => {
|
||||
dogTapped.visibility = "hidden";
|
||||
}, 1000);
|
||||
|
||||
console.log("dogTap");
|
||||
}
|
||||
19
e2e/ui-tests-app/app/button/tappable-span-page.xml
Normal file
19
e2e/ui-tests-app/app/button/tappable-span-page.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<Page>
|
||||
<StackLayout style="font-size: 50">
|
||||
<Label automationText="formattedText" id="formattedText" textWrap="true" style="text-transform: capitalize;">
|
||||
<Label.formattedText>
|
||||
<FormattedString>
|
||||
<FormattedString.spans>
|
||||
<Span text="The quick brown " style="font-weight: bold; color: green;" />
|
||||
<Span text="fox" style="font-weight: italic; color: green;" linkTap="foxTap"/>
|
||||
<Span text=" jumps over the lazy " style="font-weight: bold; color: red;" />
|
||||
<Span text="dog" style="font-weight: bold; color: blue;" linkTap="dogTap"/>
|
||||
<Span text="." style="font-weight: bold; color: green;" />
|
||||
</FormattedString.spans>
|
||||
</FormattedString>
|
||||
</Label.formattedText>
|
||||
</Label>
|
||||
<Label id="foxTapped" text="Fox tapped" visibility="hidden" color="green"/>
|
||||
<Label id="dogTapped" text="Dog tapped" visibility="hidden" color="blue"/>
|
||||
</StackLayout>
|
||||
</Page>
|
||||
Reference in New Issue
Block a user