FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
A2API/e2e/login-smoke.ui.spec.ts at main · APIJSON/A2API · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
APIJSON
/
A2API
Public
forked from
TommyLemon/A2API
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
A2API
/
e2e
/
login-smoke.ui.spec.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
39 lines (34 loc) · 1.33 KB
Breadcrumbs
A2API
/
e2e
/
login-smoke.ui.spec.ts
Copy path
File metadata and controls
39 lines (34 loc) · 1.33 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
import
{
expect
,
test
}
from
"@playwright/test"
;
test
(
"chat-demo Login opens modal and signs in via /apijson BFF"
,
async
(
{
page
,
}
)
=>
{
const
badModule404
:
string
[
]
=
[
]
;
page
.
on
(
"response"
,
(
res
)
=>
{
const
u
=
res
.
url
(
)
;
if
(
res
.
status
(
)
===
404
&&
/
1
2
7
\.
0
\.
0
\.
1
:
5
1
7
3
\/
.
*
\.
(
t
s
|
j
s
)
/
.
test
(
u
)
&&
!
u
.
includes
(
"favicon"
)
)
{
badModule404
.
push
(
`
${
res
.
status
(
)
}
${
u
}
`
)
;
}
}
)
;
await
page
.
goto
(
"http://127.0.0.1:5173/"
,
{
waitUntil
:
"domcontentloaded"
}
)
;
await
page
.
evaluate
(
(
)
=>
{
localStorage
.
removeItem
(
"a2api.account"
)
;
}
)
;
await
page
.
reload
(
{
waitUntil
:
"networkidle"
}
)
;
await
expect
(
page
.
locator
(
"#account-login-btn"
)
)
.
toHaveText
(
"Login"
)
;
await
page
.
locator
(
"#account-login-btn"
)
.
click
(
)
;
const
modal
=
page
.
locator
(
".auth-modal"
)
;
await
expect
(
modal
)
.
toBeVisible
(
{
timeout
:
5000
}
)
;
await
modal
.
locator
(
"input"
)
.
first
(
)
.
fill
(
"13000082001"
)
;
await
modal
.
locator
(
'input[type="password"]'
)
.
fill
(
"123456"
)
;
await
modal
.
getByRole
(
"button"
,
{
name
:
/
^
L
o
g
i
n
$
/
}
)
.
click
(
)
;
await
expect
(
page
.
locator
(
"#account-login-btn"
)
)
.
not
.
toHaveText
(
"Login"
,
{
timeout
:
10000
,
}
)
;
const
cookies
=
await
page
.
context
(
)
.
cookies
(
"http://127.0.0.1:5173"
)
;
expect
(
cookies
.
some
(
(
c
)
=>
c
.
name
===
"a2api_aj"
)
)
.
toBeTruthy
(
)
;
expect
(
badModule404
,
badModule404
.
join
(
"\n"
)
)
.
toEqual
(
[
]
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL