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
b042b097
Commit
b042b097
authored
Nov 02, 2018
by
afc163
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test case timeout
parent
67fccc35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
32 deletions
+11
-32
src/e2e/layout.e2e.js
src/e2e/layout.e2e.js
+11
-32
No files found.
src/e2e/layout.e2e.js
View file @
b042b097
...
@@ -19,44 +19,23 @@ describe('Homepage', () => {
...
@@ -19,44 +19,23 @@ describe('Homepage', () => {
let
browser
;
let
browser
;
let
page
;
let
page
;
const
testAllPage
=
async
layout
=>
const
testPage
=
path
=>
async
()
=>
{
new
Promise
(
async
(
resolve
,
reject
)
=>
{
await
page
.
goto
(
`
${
BASE_URL
}${
path
}
`
,
{
waitUntil
:
'
networkidle2
'
});
const
loadPage
=
async
index
=>
{
const
haveFooter
=
await
page
.
evaluate
(
const
path
=
layout
[
index
];
()
=>
document
.
getElementsByTagName
(
'
footer
'
).
length
>
0
try
{
);
await
page
.
goto
(
`
${
BASE_URL
}${
path
}
`
,
{
waitUntil
:
'
networkidle2
'
});
expect
(
haveFooter
).
toBeTruthy
();
const
haveFooter
=
await
page
.
evaluate
(
};
()
=>
document
.
getElementsByTagName
(
'
footer
'
).
length
>
0
);
expect
(
haveFooter
).
toBeTruthy
();
if
(
index
<
layout
.
length
-
1
)
{
loadPage
(
index
+
1
);
}
else
{
resolve
(
'
ok
'
);
}
}
catch
(
error
)
{
reject
(
error
);
}
};
loadPage
(
0
);
});
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
browser
=
await
puppeteer
.
launch
({
args
:
[
'
--no-sandbox
'
]
});
browser
=
await
puppeteer
.
launch
({
args
:
[
'
--no-sandbox
'
]
});
page
=
await
browser
.
newPage
();
page
=
await
browser
.
newPage
();
jest
.
setTimeout
(
1000000
);
});
});
it
(
'
test user layout
'
,
async
()
=>
{
RouterConfig
.
forEach
(({
routes
=
[]
})
=>
{
const
userLayout
=
formatter
(
RouterConfig
[
0
].
routes
);
formatter
(
routes
).
forEach
(
route
=>
{
await
testAllPage
(
userLayout
);
it
(
`test pages
${
route
}
`
,
testPage
(
route
));
});
});
it
(
'
test base layout
'
,
async
()
=>
{
const
baseLayout
=
formatter
(
RouterConfig
[
1
].
routes
);
await
testAllPage
(
baseLayout
);
});
});
afterAll
(()
=>
browser
.
close
());
afterAll
(()
=>
browser
.
close
());
...
...
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