FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nativescript-sdk-examples-js/e2e/button.js at master · NativeScript/nativescript-sdk-examples-js · GitHub
NativeScript
/
nativescript-sdk-examples-js
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
153
Star
52
Code
Issues
6
Pull requests
3
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nativescript-sdk-examples-js
/
e2e
/
button.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
68 lines (58 loc) · 1.94 KB
Breadcrumbs
nativescript-sdk-examples-js
/
e2e
/
button.js
Copy path
File metadata and controls
68 lines (58 loc) · 1.94 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
const
chai
=
require
(
"chai"
)
;
const
nsAppium
=
require
(
"nativescript-dev-appium"
)
;
const
examples
=
require
(
"./examples"
)
;
describe
(
"button scenarios"
,
(
)
=>
{
const
button
=
examples
.
examples
.
button
;
let
driver
;
let
index
=
0
;
let
example
;
before
(
async
(
)
=>
{
driver
=
await
nsAppium
.
createDriver
(
)
;
const
mainPageBtn
=
await
driver
.
findElementByText
(
button
.
baseExampleName
)
;
await
mainPageBtn
.
click
(
)
;
}
)
;
beforeEach
(
async
(
)
=>
{
example
=
button
.
examples
[
index
]
;
const
btnTap
=
await
driver
.
findElementByText
(
example
)
;
await
btnTap
.
click
(
)
;
index
++
;
}
)
;
afterEach
(
async
function
(
)
{
if
(
this
.
currentTest
.
state
===
"failed"
)
{
await
driver
.
logTestArtifacts
(
this
.
currentTest
.
title
)
;
}
await
driver
.
navBack
(
)
;
}
)
;
after
(
async
(
)
=>
{
await
driver
.
navBack
(
)
;
}
)
const
findButton
=
async
(
)
=>
{
const
btn
=
await
driver
.
findElementByClassName
(
driver
.
locators
.
button
)
;
return
btn
;
}
it
(
`Basics`
,
async
(
)
=>
{
const
btn
=
await
findButton
(
)
;
await
btn
.
click
(
)
;
await
btn
.
click
(
)
;
await
btn
.
click
(
)
;
const
text
=
'TAPPED 3 TIMES'
;
const
btnText
=
await
btn
.
text
(
)
;
chai
.
assert
.
isTrue
(
text
===
btnText
)
;
}
)
;
it
(
`Code-Behind`
,
async
(
)
=>
{
const
btn
=
await
findButton
(
)
;
await
btn
.
click
(
)
;
const
text
=
'My newly created button'
;
const
dialog
=
await
driver
.
findElementByText
(
text
,
"contains"
)
;
chai
.
assert
.
isTrue
(
await
dialog
.
isDisplayed
(
)
)
;
await
(
await
driver
.
findElementByText
(
"OK"
,
"contains"
)
)
.
tapCenter
(
)
;
}
)
;
it
(
`Styling`
,
async
(
)
=>
{
const
btn
=
await
findButton
(
)
;
await
btn
.
click
(
)
;
await
btn
.
click
(
)
;
const
text
=
'TAP ME!'
;
const
btnText
=
await
btn
.
text
(
)
;
chai
.
assert
.
isTrue
(
btnText
.
includes
(
text
)
)
;
}
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL