Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
bbfcefb4
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,发现更多精彩内容 >>
提交
bbfcefb4
编写于
7月 03, 2017
作者:
M
Michel Kaporin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Integrate smoketest-express project tasks 2.0 changes.
上级
a93c51ae
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
17 deletion
+29
-17
test/smoke/src/areas/integrated-terminal.ts
test/smoke/src/areas/integrated-terminal.ts
+5
-6
test/smoke/src/areas/tasks.ts
test/smoke/src/areas/tasks.ts
+22
-9
test/smoke/src/tests/tasks.ts
test/smoke/src/tests/tasks.ts
+2
-2
未找到文件。
test/smoke/src/areas/integrated-terminal.ts
浏览文件 @
bbfcefb4
...
...
@@ -8,7 +8,8 @@ import { CommonActions } from "./common";
export
class
IntegratedTerminal
{
private
readonly
terminalDiv
=
'
div[id="workbench.panel.terminal"]
'
;
public
static
terminalSelector
=
'
div[id="workbench.panel.terminal"]
'
;
public
static
terminalRowsSelector
=
'
div[id="workbench.panel.terminal"] .xterm-rows
'
;
constructor
(
private
spectron
:
SpectronApplication
)
{
// noop
...
...
@@ -26,7 +27,7 @@ export class IntegratedTerminal {
// If no terminal panel was opened, try triggering terminal from quick open
try
{
await
this
.
spectron
.
client
.
getHTML
(
this
.
terminalDiv
);
await
this
.
spectron
.
client
.
getHTML
(
IntegratedTerminal
.
terminalSelector
);
}
catch
(
e
)
{
await
commonActions
.
openQuickOpen
();
await
this
.
spectron
.
client
.
keys
(
'
>Toggle Integrated Terminal
'
);
...
...
@@ -35,13 +36,11 @@ export class IntegratedTerminal {
}
public
async
commandOutputHas
(
result
:
string
):
Promise
<
boolean
>
{
const
selector
=
`
${
this
.
terminalDiv
}
.xterm-rows`
;
const
rows
=
await
this
.
spectron
.
client
.
elements
(
`
${
selector
}
div`
);
const
rows
=
await
this
.
spectron
.
client
.
elements
(
`
${
IntegratedTerminal
.
terminalRowsSelector
}
div`
);
for
(
let
i
=
0
;
i
<
rows
.
value
.
length
;
i
++
)
{
let
rowText
;
try
{
rowText
=
await
this
.
spectron
.
client
.
getText
(
`
${
s
elector
}
>:nth-child(
${
i
+
1
}
)`
);
rowText
=
await
this
.
spectron
.
client
.
getText
(
`
${
IntegratedTerminal
.
terminalRowsS
elector
}
>:nth-child(
${
i
+
1
}
)`
);
}
catch
(
e
)
{
return
Promise
.
reject
(
`Failed to obtain text from line
${
i
+
1
}
from the terminal.`
);
}
...
...
test/smoke/src/areas/tasks.ts
浏览文件 @
bbfcefb4
...
...
@@ -4,10 +4,11 @@
*--------------------------------------------------------------------------------------------*/
import
{
SpectronApplication
}
from
'
../spectron/application
'
;
import
{
IntegratedTerminal
}
from
"
./integrated-terminal
"
;
export
class
Tasks
{
private
readonly
outputViewSelector
=
'
div[id="workbench.panel.output"] .view-lines
'
;
private
readonly
outputViewSelector
=
IntegratedTerminal
.
terminalRowsSelector
;
private
readonly
workbenchPanelSelector
=
'
div[id="workbench.parts.panel"]
'
;
private
readonly
problemsViewSelector
=
'
div[id="workbench.panel.markers"] .monaco-tree-row.expanded
'
;
...
...
@@ -20,16 +21,18 @@ export class Tasks {
await
this
.
spectron
.
wait
();
// wait for build to finish
// Validate that it has finished
let
inProgress
=
true
,
trial
=
0
;
while
(
inProgress
&&
trial
<
3
)
{
let
trial
=
0
;
while
(
trial
<
3
)
{
// Determine build status based on the statusbar indicator, don't continue until task has been terminated
const
hidden
=
!!
await
this
.
spectron
.
client
.
getAttribute
(
'
.task-statusbar-item-progress
'
,
'
aria-hidden
'
);
if
(
hidden
)
{
return
Promise
.
resolve
();
try
{
return
await
this
.
spectron
.
client
.
getValue
(
'
.task-statusbar-item-progress.builder-hidden
'
);
}
catch
(
e
)
{
await
this
.
spectron
.
wait
();
trial
++
;
}
await
this
.
spectron
.
wait
();
trial
++
;
}
return
Promise
.
reject
(
'
Could not determine if the task was terminated based on status bar progress spinner.
'
);
}
public
openProblemsView
():
Promise
<
any
>
{
...
...
@@ -46,7 +49,9 @@ export class Tasks {
return
false
;
}
public
selectOutputViewType
(
type
:
string
):
Promise
<
any
>
{
public
async
selectOutputViewType
(
type
:
string
):
Promise
<
any
>
{
await
this
.
openOutputView
();
try
{
return
this
.
spectron
.
client
.
selectByValue
(
`
${
this
.
workbenchPanelSelector
}
.select-box`
,
type
);
}
catch
(
e
)
{
...
...
@@ -73,4 +78,12 @@ export class Tasks {
return
Promise
.
reject
(
'
Failed to get problem count from Problems view:
'
+
e
);
}
}
private
openOutputView
():
Promise
<
any
>
{
try
{
return
this
.
spectron
.
command
(
'
workbench.action.output.toggleOutput
'
);
}
catch
(
e
)
{
return
Promise
.
reject
(
'
Failed to toggle output view
'
);
}
}
}
\ No newline at end of file
test/smoke/src/tests/tasks.ts
浏览文件 @
bbfcefb4
...
...
@@ -39,9 +39,9 @@ export function testTasks() {
assert
.
equal
(
viewType
,
'
Git
'
);
});
it
(
'
ensures that build task produces
error in index.js
'
,
async
function
()
{
it
(
'
ensures that build task produces
no-unused-vars message
'
,
async
function
()
{
await
tasks
.
build
();
assert
.
ok
(
await
tasks
.
outputContains
(
'
index.js
'
),
`Output does not contain error in index.js
`
);
assert
.
ok
(
await
tasks
.
outputContains
(
`'next' is defined but never used`
),
`Output does not contain no-unused-vars message
`
);
});
it
(
`verifies build error is reflected in 'Problems View'`
,
async
function
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录