Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Five-菜鸟级
echarts
提交
7bebc787
E
echarts
项目概览
Five-菜鸟级
/
echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7bebc787
编写于
5月 10, 2021
作者:
P
pissang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test(visual): optimize test cases
上级
8bcf63cf
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
30 addition
and
3 deletion
+30
-3
test/gauge-pointer.html
test/gauge-pointer.html
+2
-2
test/runTest/cli.js
test/runTest/cli.js
+28
-1
未找到文件。
test/gauge-pointer.html
浏览文件 @
7bebc787
...
...
@@ -566,12 +566,12 @@ under the License.
type
:
'
gauge
'
,
anchor
:
{
show
:
true
,
icon
:
"
image://
https://www.apache.org/img/support-apache.jp
g
"
,
icon
:
"
image://
asset/echarts-logo.pn
g
"
,
size
:
50
,
showAbove
:
true
},
pointer
:
{
icon
:
"
image://
https://www.apache.org/img/support-apache.jp
g
"
,
icon
:
"
image://
asset/echarts-logo.pn
g
"
,
length
:
"
70%
"
},
detail
:
{
formatter
:
'
{value}%
'
},
...
...
test/runTest/cli.js
浏览文件 @
7bebc787
...
...
@@ -17,6 +17,8 @@
* under the License.
*/
// TODO: Cases that needs lots of network loading still may fail. Like bmap-xxx
const
puppeteer
=
require
(
'
puppeteer
'
);
const
slugify
=
require
(
'
slugify
'
);
const
fse
=
require
(
'
fs-extra
'
);
...
...
@@ -44,13 +46,15 @@ program.parse(process.argv);
program
.
speed
=
+
program
.
speed
||
1
;
program
.
actual
=
program
.
actual
||
'
local
'
;
program
.
expected
=
program
.
expected
||
'
4.2.1
'
;
program
.
renderer
=
(
program
.
renderer
||
'
canvas
'
).
toLowerCase
();
program
.
dir
=
program
.
dir
||
(
__dirname
+
'
/tmp
'
);
if
(
!
program
.
tests
)
{
throw
new
Error
(
'
Tests are required
'
);
}
if
(
!
program
.
expected
)
{
throw
new
Error
(
'
Expected version is required
'
);
}
function
getScreenshotDir
()
{
return
`
${
program
.
dir
}
/__screenshot__`
;
...
...
@@ -125,6 +129,26 @@ async function takeScreenshot(page, fullPage, fileUrl, desc, isExpected, minor)
};
}
async
function
waitForNetworkIdle
(
page
)
{
let
count
=
0
;
const
started
=
()
=>
(
count
=
count
+
1
);
const
ended
=
()
=>
(
count
=
count
-
1
);
page
.
on
(
'
request
'
,
started
);
page
.
on
(
'
requestfailed
'
,
ended
);
page
.
on
(
'
requestfinished
'
,
ended
);
return
async
(
timeout
=
5000
)
=>
{
while
(
count
>
0
)
{
await
waitTime
(
100
);
if
((
timeout
=
timeout
-
100
)
<
0
)
{
console
.
error
(
'
Timeout
'
);
}
}
page
.
off
(
'
request
'
,
started
);
page
.
off
(
'
requestfailed
'
,
ended
);
page
.
off
(
'
requestfinished
'
,
ended
);
};
}
async
function
runTestPage
(
browser
,
testOpt
,
version
,
runtimeCode
,
isExpected
)
{
const
fileUrl
=
testOpt
.
fileUrl
;
...
...
@@ -170,6 +194,9 @@ async function runTestPage(browser, testOpt, version, runtimeCode, isExpected) {
await
page
.
exposeFunction
(
'
__VRT_MOUSE_UP__
'
,
async
()
=>
{
await
page
.
mouse
.
up
();
});
// await page.exposeFunction('__VRT_WAIT_FOR_NETWORK_IDLE__', async () => {
// await waitForNetworkIdle();
// });
// TODO should await exposeFunction here
const
waitForScreenshot
=
new
Promise
((
resolve
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录