mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: fix automated tests
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
// >> observable-require
|
||||
import { Observable, PropertyChangeData, EventData, WrappedValue, fromObject, fromObjectRecursive } from '@nativescript/core';
|
||||
import { Observable, PropertyChangeData, EventData, WrappedValue, fromObject, fromObjectRecursive, ObservableArray } from '@nativescript/core';
|
||||
// << observable-require
|
||||
|
||||
import * as TKUnit from '../tk-unit';
|
||||
import * as types from '@nativescript/core/utils/types';
|
||||
import { ObservableArray } from '@nativescript/core';
|
||||
|
||||
var TESTED_NAME = 'tested';
|
||||
class TestObservable extends Observable {
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import * as TKUnit from '../tk-unit';
|
||||
import { EventData, Page, NavigatedData } from '@nativescript/core';
|
||||
import { Frame, NavigationTransition } from '@nativescript/core/ui/frame';
|
||||
import { StackLayout } from '@nativescript/core/ui/layouts/stack-layout';
|
||||
import { Color } from '@nativescript/core/color';
|
||||
import { EventData, Page, NavigatedData, Frame, NavigationTransition, StackLayout, Color } from '@nativescript/core';
|
||||
import * as helper from '../ui-helper';
|
||||
import * as frame from '@nativescript/core/ui/frame';
|
||||
// Creates a random colorful page full of meaningless stuff.
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import * as helper from '../ui-helper';
|
||||
import * as platform from '@nativescript/core/platform';
|
||||
import { Trace } from '@nativescript/core';
|
||||
import { Trace, CoreTypes } from '@nativescript/core';
|
||||
import { Color } from '@nativescript/core/color';
|
||||
import { NavigationEntry, NavigationTransition } from '@nativescript/core/ui/frame';
|
||||
import { Page } from '@nativescript/core/ui/page';
|
||||
import { CoreTypes } from '@nativescript/core';
|
||||
import { CustomTransition } from './custom-transition';
|
||||
|
||||
function _testTransition(navigationTransition: NavigationTransition) {
|
||||
|
||||
@@ -4,12 +4,11 @@ import * as viewModule from '@nativescript/core/ui/core/view';
|
||||
import { Label } from '@nativescript/core/ui/label';
|
||||
import { StackLayout } from '@nativescript/core/ui/layouts/stack-layout';
|
||||
import * as colorModule from '@nativescript/core/color';
|
||||
import { Enums } from '@nativescript/core';
|
||||
import { CoreTypes, PercentLength } from '@nativescript/core';
|
||||
import { AnimationPromise } from '@nativescript/core/ui/animation';
|
||||
|
||||
// >> animation-require
|
||||
import * as animation from '@nativescript/core/ui/animation';
|
||||
import { CoreTypes, PercentLength } from '@nativescript/core';
|
||||
// << animation-require
|
||||
|
||||
function prepareTest(parentHeight?: number, parentWidth?: number): Label {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as buttonModule from '@nativescript/core/ui/button';
|
||||
import * as colorModule from '@nativescript/core/color';
|
||||
import { Enums } from '@nativescript/core';
|
||||
import { CoreTypes } from '@nativescript/core';
|
||||
import { getColor } from '../../ui-helper';
|
||||
|
||||
export function getNativeText(button: buttonModule.Button): string {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as labelModule from '@nativescript/core/ui/label';
|
||||
import { Enums } from '@nativescript/core';
|
||||
import { CoreTypes } from '@nativescript/core';
|
||||
import * as colorModule from '@nativescript/core/color';
|
||||
|
||||
export function getNativeTextAlignment(label: labelModule.Label): string {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as labelModule from '@nativescript/core/ui/label';
|
||||
import { Enums } from '@nativescript/core';
|
||||
import { CoreTypes } from '@nativescript/core';
|
||||
import * as colorModule from '@nativescript/core/color';
|
||||
import { getColor } from '../../ui-helper';
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import * as colorModule from '@nativescript/core/color';
|
||||
import * as utils from '@nativescript/core/utils/utils';
|
||||
import * as observableModule from '@nativescript/core/data/observable';
|
||||
import * as bindable from '@nativescript/core/ui/core/bindable';
|
||||
import { CoreTypes } from '@nativescript/core';
|
||||
import { CoreTypes, Span, FormattedString } from '@nativescript/core';
|
||||
import * as labelTestsNative from './label-tests-native';
|
||||
import * as fs from '@nativescript/core/file-system';
|
||||
|
||||
@@ -20,7 +20,6 @@ import { isIOS, isAndroid } from '@nativescript/core/platform';
|
||||
import { Label } from '@nativescript/core/ui/label';
|
||||
import { LayoutBase } from '@nativescript/core/ui/layouts/layout-base';
|
||||
import * as helper from '../../ui-helper';
|
||||
import { Span, FormattedString } from '@nativescript/core';
|
||||
|
||||
const testDir = 'ui/label';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { TextField, Color, Utils, Enums } from '@nativescript/core';
|
||||
import { TextField, Color, Utils, CoreTypes } from '@nativescript/core';
|
||||
|
||||
export function getNativeText(textField: TextField): string {
|
||||
return textField.android.getText().toString();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as textFieldModule from '@nativescript/core/ui/text-field';
|
||||
import * as colorModule from '@nativescript/core/color';
|
||||
import { getColor } from '../../ui-helper';
|
||||
import { Enums } from '@nativescript/core';
|
||||
import { CoreTypes } from '@nativescript/core';
|
||||
|
||||
export function getNativeText(textField: textFieldModule.TextField): string {
|
||||
return textField.ios.text;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { TextView, Color, Utils, Enums } from '@nativescript/core';
|
||||
import { TextView, Color, Utils, CoreTypes } from '@nativescript/core';
|
||||
|
||||
export function getNativeText(textView: TextView): string {
|
||||
return textView.android.getText().toString();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as textViewModule from '@nativescript/core/ui/text-view';
|
||||
import * as colorModule from '@nativescript/core/color';
|
||||
import { getColor } from '../../ui-helper';
|
||||
import { Enums } from '@nativescript/core';
|
||||
import { CoreTypes } from '@nativescript/core';
|
||||
|
||||
export function getNativeText(textView: textViewModule.TextView): string {
|
||||
return textView.ios.text;
|
||||
|
||||
@@ -5,9 +5,8 @@ import { Button } from '@nativescript/core/ui/button';
|
||||
import * as types from '@nativescript/core/utils/types';
|
||||
import { StackLayout } from '@nativescript/core/ui/layouts/stack-layout';
|
||||
import { Label } from '@nativescript/core/ui/label';
|
||||
import { Trace } from '@nativescript/core';
|
||||
import { Trace, isIOS } from '@nativescript/core';
|
||||
import { Color } from '@nativescript/core/color';
|
||||
import { isIOS } from '@nativescript/core';
|
||||
|
||||
// enable the trace, it is disabled by default
|
||||
Trace.enable();
|
||||
|
||||
@@ -84,7 +84,8 @@ export function testBackgroundInternalChangedOnceOnResize() {
|
||||
export function test_automation_text_set_to_native() {
|
||||
var newButton = new Button();
|
||||
newButton.automationText = 'Button1';
|
||||
newButton.accessibilityLabel = 'Button1';
|
||||
helper.getCurrentPage().content = newButton;
|
||||
TKUnit.assertEqual((<UIView>newButton.ios).accessibilityIdentifier, 'Button1', 'accessibilityIdentifier not set to native view.');
|
||||
TKUnit.assertEqual((<UIView>newButton.ios).accessibilityLabel, 'Button1', 'accessibilityIdentifier not set to native view.');
|
||||
TKUnit.assertEqual((<UIView>newButton.ios).accessibilityLabel, 'Button1', 'accessibilityLabel not set to native view.');
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Observable } from '@nativescript/core';
|
||||
import { EventData, Page } from '@nativescript/core';
|
||||
import { Observable, EventData, Page } from '@nativescript/core';
|
||||
|
||||
export function navigatingTo(args: EventData) {
|
||||
const page = <Page>args.object;
|
||||
|
||||
Reference in New Issue
Block a user