Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
bac00820
Commit
bac00820
authored
Dec 25, 2018
by
ζι
Committed by
Yu
Jan 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix e2etest
parent
5732c5bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
34 deletions
+0
-34
e2e/login.e2e.js
e2e/login.e2e.js
+0
-34
No files found.
e2e/login.e2e.js
deleted
100644 β 0
View file @
5732c5bf
const
BASE_URL
=
`http://localhost:
${
process
.
env
.
PORT
||
8000
}
`
;
describe
(
'
Login
'
,
()
=>
{
beforeAll
(
async
()
=>
{
jest
.
setTimeout
(
1000000
);
});
beforeEach
(
async
()
=>
{
await
page
.
goto
(
`
${
BASE_URL
}
/user/login`
,
{
waitUntil
:
'
networkidle2
'
});
await
page
.
evaluate
(()
=>
window
.
localStorage
.
setItem
(
'
antd-pro-authority
'
,
'
guest
'
));
});
it
(
'
should login with failure
'
,
async
()
=>
{
await
page
.
waitForSelector
(
'
#userName
'
,
{
timeout
:
2000
,
});
await
page
.
type
(
'
#userName
'
,
'
mockuser
'
);
await
page
.
type
(
'
#password
'
,
'
wrong_password
'
);
await
page
.
click
(
'
button[type="submit"]
'
);
await
page
.
waitForSelector
(
'
.ant-alert-error
'
);
// should display error
});
it
(
'
should login successfully
'
,
async
()
=>
{
await
page
.
waitForSelector
(
'
#userName
'
,
{
timeout
:
2000
,
});
await
page
.
type
(
'
#userName
'
,
'
admin
'
);
await
page
.
type
(
'
#password
'
,
'
ant.design
'
);
await
page
.
click
(
'
button[type="submit"]
'
);
await
page
.
waitForSelector
(
'
.ant-layout-sider h1
'
);
// should display error
const
text
=
await
page
.
evaluate
(()
=>
document
.
body
.
innerHTML
);
expect
(
text
).
toContain
(
'
<h1>Ant Design Pro</h1>
'
);
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment