Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
5fffacbb
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
Vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5fffacbb
编写于
9月 08, 2017
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
smoke: make editor tests more reliable
上级
40af684b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
18 deletion
+14
-18
test/smoke/src/areas/editor/editor.test.ts
test/smoke/src/areas/editor/editor.test.ts
+4
-10
test/smoke/src/areas/editor/peek.ts
test/smoke/src/areas/editor/peek.ts
+10
-8
未找到文件。
test/smoke/src/areas/editor/editor.test.ts
浏览文件 @
5fffacbb
...
...
@@ -28,12 +28,8 @@ describe('Editor', () => {
const
references
=
await
app
.
workbench
.
editor
.
findReferences
(
'
app
'
,
7
);
const
countInTitle
=
await
references
.
getCountFromTitle
();
await
app
.
screenCapturer
.
capture
(
'
References result
'
);
assert
.
equal
(
countInTitle
,
3
,
'
References count in widget title is not as expected.
'
);
const
referencesCount
=
await
references
.
getCount
();
assert
.
equal
(
referencesCount
,
3
,
'
References count in tree is not as expected.
'
);
await
references
.
waitForReferencesCountInTitle
(
3
);
await
references
.
waitForReferencesCount
(
3
);
await
references
.
close
();
});
...
...
@@ -70,7 +66,7 @@ describe('Editor', () => {
await
app
.
workbench
.
editor
.
gotoDefinition
(
'
express
'
,
11
);
a
ssert
.
ok
(
await
app
.
workbench
.
waitForActiveOpen
(
'
index.d.ts
'
),
'
Tab opened when navigating to definition is not as expected.
'
);
a
wait
app
.
workbench
.
waitForActiveOpen
(
'
index.d.ts
'
);
});
it
(
`verifies that 'Peek Definition' works`
,
async
function
()
{
...
...
@@ -78,8 +74,6 @@ describe('Editor', () => {
const
peek
=
await
app
.
workbench
.
editor
.
peekDefinition
(
'
express
'
,
11
);
const
definitionFilename
=
await
peek
.
getFileNameFromTitle
();
await
app
.
screenCapturer
.
capture
(
'
Peek definition result
'
);
assert
.
equal
(
definitionFilename
,
'
index.d.ts
'
,
'
Peek result is not as expected.
'
);
await
peek
.
waitForFile
(
'
index.d.ts
'
);
});
});
\ No newline at end of file
test/smoke/src/areas/editor/peek.ts
浏览文件 @
5fffacbb
...
...
@@ -19,20 +19,22 @@ export class References {
await
this
.
spectron
.
client
.
waitForElement
(
References
.
REFERENCES_WIDGET
);
}
public
async
getCountFromTitle
():
Promise
<
number
>
{
const
titleCount
=
await
this
.
spectron
.
client
.
waitForText
(
References
.
REFERENCES_TITLE_COUNT
);
const
matches
=
titleCount
.
match
(
/
\d
+/
);
return
matches
?
parseInt
(
matches
[
0
])
:
0
;
public
async
waitForReferencesCountInTitle
(
count
:
number
):
Promise
<
void
>
{
await
this
.
spectron
.
client
.
waitForText
(
References
.
REFERENCES_TITLE_COUNT
,
void
0
,
titleCount
=>
{
const
matches
=
titleCount
.
match
(
/
\d
+/
);
return
matches
?
parseInt
(
matches
[
0
])
===
count
:
false
;
});
}
public
async
getFileNameFromTitle
():
Promise
<
string
>
{
return
await
this
.
spectron
.
client
.
waitForText
(
References
.
REFERENCES_TITLE_FILE_NAME
);
public
async
waitForReferencesCount
(
count
:
number
):
Promise
<
void
>
{
await
this
.
spectron
.
client
.
waitForElements
(
References
.
REFERENCES
,
result
=>
result
&&
result
.
length
===
count
);
}
public
async
getCount
():
Promise
<
number
>
{
return
(
await
this
.
spectron
.
client
.
waitForElements
(
References
.
REFERENCES
)).
length
;
public
async
waitForFile
(
file
:
string
):
Promise
<
void
>
{
await
this
.
spectron
.
client
.
waitForText
(
References
.
REFERENCES_TITLE_FILE_NAME
,
file
)
;
}
public
async
close
():
Promise
<
void
>
{
await
this
.
spectron
.
client
.
keys
([
'
Escape
'
,
'
NULL
'
]);
await
this
.
spectron
.
client
.
waitForElement
(
References
.
REFERENCES_WIDGET
,
element
=>
!
element
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录