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
P
pro-blocks
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
pro-blocks
Commits
802930e7
Commit
802930e7
authored
Nov 15, 2018
by
陈帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix test script
parent
f3ec5fa9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
27 deletions
+15
-27
package.json
package.json
+2
-2
src/e2e/baseLayout.e2e.js
src/e2e/baseLayout.e2e.js
+12
-24
tests/run-tests.js
tests/run-tests.js
+1
-1
No files found.
package.json
View file @
802930e7
...
@@ -36,7 +36,6 @@
...
@@ -36,7 +36,6 @@
"
dva
"
:
"
^2.4.0
"
,
"
dva
"
:
"
^2.4.0
"
,
"
enquire-js
"
:
"
^0.2.1
"
,
"
enquire-js
"
:
"
^0.2.1
"
,
"
hash.js
"
:
"
^1.1.5
"
,
"
hash.js
"
:
"
^1.1.5
"
,
"
jest-puppeteer
"
:
"
^3.5.1
"
,
"
lodash
"
:
"
^4.17.10
"
,
"
lodash
"
:
"
^4.17.10
"
,
"
lodash-decorators
"
:
"
^6.0.0
"
,
"
lodash-decorators
"
:
"
^6.0.0
"
,
"
memoize-one
"
:
"
^4.0.0
"
,
"
memoize-one
"
:
"
^4.0.0
"
,
...
@@ -57,7 +56,7 @@
...
@@ -57,7 +56,7 @@
"
react-router-dom
"
:
"
^4.3.1
"
"
react-router-dom
"
:
"
^4.3.1
"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"
@types/react
"
:
"
^16.
4.1
6
"
,
"
@types/react
"
:
"
^16.
7.
6
"
,
"
@types/react-dom
"
:
"
^16.0.9
"
,
"
@types/react-dom
"
:
"
^16.0.9
"
,
"
antd-pro-merge-less
"
:
"
^0.2.0
"
,
"
antd-pro-merge-less
"
:
"
^0.2.0
"
,
"
antd-theme-webpack-plugin
"
:
"
^1.1.8
"
,
"
antd-theme-webpack-plugin
"
:
"
^1.1.8
"
,
...
@@ -76,6 +75,7 @@
...
@@ -76,6 +75,7 @@
"
eslint-plugin-react
"
:
"
^7.11.1
"
,
"
eslint-plugin-react
"
:
"
^7.11.1
"
,
"
gh-pages
"
:
"
^2.0.1
"
,
"
gh-pages
"
:
"
^2.0.1
"
,
"
husky
"
:
"
^1.1.2
"
,
"
husky
"
:
"
^1.1.2
"
,
"
jest-puppeteer
"
:
"
^3.5.1
"
,
"
lint-staged
"
:
"
^8.0.4
"
,
"
lint-staged
"
:
"
^8.0.4
"
,
"
merge-umi-mock-data
"
:
"
^0.0.3
"
,
"
merge-umi-mock-data
"
:
"
^0.0.3
"
,
"
mockjs
"
:
"
^1.0.1-beta3
"
,
"
mockjs
"
:
"
^1.0.1-beta3
"
,
...
...
src/e2e/baseLayout.e2e.js
View file @
802930e7
...
@@ -12,35 +12,23 @@ function formatter(data) {
...
@@ -12,35 +12,23 @@ function formatter(data) {
}
}
describe
(
'
Homepage
'
,
async
()
=>
{
describe
(
'
Homepage
'
,
async
()
=>
{
const
testPage
=
path
=>
const
testPage
=
path
=>
async
()
=>
{
new
Promise
(
async
reslove
=>
{
await
page
.
goto
(
`
${
BASE_URL
}${
path
}
`
);
console
.
log
(
`test
${
path
}
`
);
await
page
.
waitForSelector
(
'
footer
'
,
{
await
page
.
goto
(
`
${
BASE_URL
}${
path
}
`
,
{
timeout
:
2000
,
timeout
:
600000
,
});
await
page
.
waitForSelector
(
'
footer
'
,
{
timeout
:
600000
,
});
reslove
();
});
});
const
haveFooter
=
await
page
.
evaluate
(
()
=>
document
.
getElementsByTagName
(
'
footer
'
).
length
>
0
);
expect
(
haveFooter
).
toBeTruthy
();
};
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
jest
.
setTimeout
(
1000000
);
jest
.
setTimeout
(
1000000
);
await
page
.
setCacheEnabled
(
false
);
await
page
.
setCacheEnabled
(
false
);
});
});
const
routers
=
formatter
(
RouterConfig
[
1
].
routes
);
it
(
`test pages`
,
async
()
=>
{
routers
.
forEach
(
route
=>
{
const
routers
=
formatter
(
RouterConfig
[
1
].
routes
);
fit
(
`test pages
${
route
}
`
,
testPage
(
route
));
const
testAll
=
index
=>
new
Promise
(
async
reslove
=>
{
await
testPage
(
routers
[
index
]);
if
(
index
<
routers
.
length
-
1
)
{
const
newIndex
=
index
+
1
;
await
testAll
(
newIndex
);
reslove
();
}
reslove
();
});
await
testAll
(
0
);
});
});
});
});
tests/run-tests.js
View file @
802930e7
...
@@ -31,7 +31,7 @@ startServer.stdout.on('data', data => {
...
@@ -31,7 +31,7 @@ startServer.stdout.on('data', data => {
console
.
log
(
'
Development server is started, ready to run tests.
'
);
console
.
log
(
'
Development server is started, ready to run tests.
'
);
const
testCmd
=
spawn
(
const
testCmd
=
spawn
(
/^win/
.
test
(
process
.
platform
)
?
'
npm.cmd
'
:
'
npm
'
,
/^win/
.
test
(
process
.
platform
)
?
'
npm.cmd
'
:
'
npm
'
,
[
'
test
'
,
'
--
'
,
'
--maxWorkers=1
'
],
[
'
test
'
,
'
--
'
,
'
--maxWorkers=1
'
,
'
--runInBand
'
],
{
{
stdio
:
'
inherit
'
,
stdio
:
'
inherit
'
,
}
}
...
...
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