Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ae4da32e
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ae4da32e
编写于
9月 06, 2017
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
smoke test: remove tasks
上级
708d897c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
145 deletion
+0
-145
test/smoke/src/areas/tasks.ts
test/smoke/src/areas/tasks.ts
+0
-89
test/smoke/src/tests/tasks.ts
test/smoke/src/tests/tasks.ts
+0
-56
未找到文件。
test/smoke/src/areas/tasks.ts
已删除
100644 → 0
浏览文件 @
708d897c
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
SpectronApplication
}
from
'
../spectron/application
'
;
import
{
IntegratedTerminal
}
from
'
./integrated-terminal
'
;
export
class
Tasks
{
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
'
;
constructor
(
private
spectron
:
SpectronApplication
)
{
// noop
}
public
async
build
():
Promise
<
any
>
{
await
this
.
spectron
.
command
(
'
workbench.action.tasks.build
'
);
await
this
.
spectron
.
wait
();
// wait for build to finish
// Validate that it has finished
let
trial
=
0
;
while
(
trial
<
3
)
{
// Determine build status based on the statusbar indicator, don't continue until task has been terminated
try
{
return
await
this
.
spectron
.
client
.
getValue
(
'
.task-statusbar-item-progress.builder-hidden
'
);
}
catch
(
e
)
{
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
>
{
return
this
.
spectron
.
command
(
'
workbench.actions.view.problems
'
);
}
public
async
outputContains
(
string
:
string
):
Promise
<
boolean
>
{
const
output
:
string
=
await
this
.
spectron
.
waitFor
(
this
.
spectron
.
client
.
getText
,
this
.
outputViewSelector
);
if
(
output
.
indexOf
(
string
)
!==
-
1
)
{
return
true
;
}
return
false
;
}
public
async
selectOutputViewType
(
type
:
string
):
Promise
<
any
>
{
await
this
.
openOutputView
();
try
{
return
this
.
spectron
.
client
.
selectByValue
(
`
${
this
.
workbenchPanelSelector
}
.select-box`
,
type
);
}
catch
(
e
)
{
return
Promise
.
reject
(
`Failed to select
${
type
}
as workbench panel output.`
);
}
}
public
getOutputViewType
():
Promise
<
any
>
{
return
this
.
spectron
.
client
.
getValue
(
`
${
this
.
workbenchPanelSelector
}
.select-box`
);
}
public
getProblemsViewFirstElementName
():
Promise
<
any
>
{
try
{
return
this
.
spectron
.
waitFor
(
this
.
spectron
.
client
.
getText
,
`
${
this
.
problemsViewSelector
}
.label-name`
);
}
catch
(
e
)
{
return
Promise
.
reject
(
'
Failed to get problem label from Problems view:
'
+
e
);
}
}
public
getProblemsViewFirstElementCount
():
Promise
<
any
>
{
try
{
return
this
.
spectron
.
waitFor
(
this
.
spectron
.
client
.
getText
,
`
${
this
.
problemsViewSelector
}
.monaco-count-badge`
);
}
catch
(
e
)
{
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
已删除
100644 → 0
浏览文件 @
708d897c
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
assert
from
'
assert
'
;
import
{
SpectronApplication
,
LATEST_PATH
,
WORKSPACE_PATH
}
from
'
../spectron/application
'
;
import
{
Tasks
}
from
'
../areas/tasks
'
;
let
app
:
SpectronApplication
;
export
function
testTasks
()
{
describe
(
'
Tasks
'
,
()
=>
{
let
tasks
:
Tasks
;
beforeEach
(
async
function
()
{
app
=
new
SpectronApplication
(
LATEST_PATH
,
this
.
currentTest
.
fullTitle
(),
(
this
.
currentTest
as
any
).
currentRetry
(),
[
WORKSPACE_PATH
]);
tasks
=
new
Tasks
(
app
);
return
await
app
.
start
();
});
afterEach
(
async
function
()
{
return
await
app
.
stop
();
});
it
(
'
verifies that eslint task results in 1 problem
'
,
async
function
()
{
const
expectedOutput
=
'
1 problem (0 errors, 1 warning)
'
;
await
tasks
.
build
();
const
actualOutput
=
await
tasks
.
outputContains
(
expectedOutput
);
assert
.
ok
(
actualOutput
,
`Output does not contain the following string: '
${
expectedOutput
}
'`
);
});
it
(
`is able to select 'Git' output`
,
async
function
()
{
await
tasks
.
build
();
await
app
.
wait
();
await
tasks
.
selectOutputViewType
(
'
Git
'
);
const
viewType
=
await
tasks
.
getOutputViewType
();
assert
.
equal
(
viewType
,
'
Git
'
);
});
it
(
'
ensures that build task produces no-unused-vars message
'
,
async
function
()
{
await
tasks
.
build
();
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
()
{
await
tasks
.
build
();
await
tasks
.
openProblemsView
();
const
problemName
=
await
tasks
.
getProblemsViewFirstElementName
();
assert
.
equal
(
problemName
,
'
index.js
'
,
`'index.js' is not a build error.`
);
const
problemsCount
=
await
tasks
.
getProblemsViewFirstElementCount
();
assert
.
equal
(
problemsCount
,
'
1
'
,
`Problem count is different to expected.`
);
});
});
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录