FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
NativeScript/apps/tests/ui-test.ts at patch-1 · rclai/NativeScript · GitHub
rclai
NativeScript
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
NativeScript
/
apps
/
tests
/
ui-test.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
83 lines (67 loc) · 2.04 KB
Breadcrumbs
NativeScript
/
apps
/
tests
/
ui-test.ts
Copy path
File metadata and controls
83 lines (67 loc) · 2.04 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
78
79
80
81
82
83
import
{
Page
}
from
"ui/page"
;
import
{
View
}
from
"ui/core/view"
;
import
trace
=
require
(
"trace"
)
;
import
navHelper
=
require
(
"./ui/helper"
)
;
import
TKUnit
=
require
(
"./TKUnit"
)
;
export
class
UITest
<
T
extends
View
>
implements
trace
.
TraceWriter
{
private
_testPage
:
Page
;
private
_testView
:
T
;
private
_errorMessage
;
public
get
errorMessage
(
)
:
string
{
return
this
.
_errorMessage
;
}
public
get
testPage
(
)
:
Page
{
return
this
.
_testPage
;
}
public
get
testView
(
)
:
T
{
return
this
.
_testView
;
}
public
waitUntilTestElementIsLoaded
(
timeoutSec
?:
number
)
:
void
{
TKUnit
.
waitUntilReady
(
(
)
=>
{
return
this
.
testView
.
isLoaded
;
}
,
timeoutSec
||
1
)
;
}
public
waitUntilTestElementLayoutIsValid
(
timeoutSec
?:
number
)
:
void
{
TKUnit
.
waitUntilReady
(
(
)
=>
{
return
this
.
testView
.
isLayoutValid
;
}
,
timeoutSec
||
1
)
;
}
public
create
(
)
:
T
{
throw
new
Error
(
this
+
" should implement Create method."
)
;
}
public
setUpModule
(
)
:
void
{
var
pageFactory
=
(
)
=>
{
var
page
=
new
Page
(
)
;
this
.
_testPage
=
page
;
return
page
;
}
;
trace
.
addWriter
(
this
)
;
trace
.
enable
(
)
;
navHelper
.
navigate
(
pageFactory
)
;
}
public
tearDownModule
(
)
{
this
.
_testPage
=
null
;
this
.
_testView
=
null
;
trace
.
removeWriter
(
this
)
;
navHelper
.
goBack
(
)
;
}
public
setUp
(
)
{
this
.
_testView
=
this
.
create
(
)
;
this
.
_testPage
.
content
=
this
.
_testView
;
}
public
tearDown
(
)
{
this
.
_testPage
.
content
=
null
;
this
.
_testPage
.
bindingContext
=
null
;
this
.
_testPage
.
css
=
""
;
this
.
_testView
=
null
;
this
.
_errorMessage
=
undefined
;
}
public
write
(
message
:
any
,
category
:
string
,
type
?:
number
)
:
void
{
if
(
category
===
trace
.
categories
.
Error
)
{
this
.
_errorMessage
=
message
;
}
}
}
export
function
createTestCase
(
)
:
UITest
<
View
>
{
return
null
;
}
Back
|
FazBrowse Home
|
New Git URL