Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f5bf8a35
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,发现更多精彩内容 >>
提交
f5bf8a35
编写于
9月 06, 2017
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
smoke tests: clean up
上级
ffee5147
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
0 addition
and
200 deletion
+0
-200
test/smoke/src/areas/css.ts
test/smoke/src/areas/css.ts
+0
-62
test/smoke/src/areas/data-loss.ts
test/smoke/src/areas/data-loss.ts
+0
-26
test/smoke/src/areas/extensions.ts
test/smoke/src/areas/extensions.ts
+0
-112
未找到文件。
test/smoke/src/areas/css.ts
已删除
100644 → 0
浏览文件 @
ffee5147
/*---------------------------------------------------------------------------------------------
* 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
'
;
export
enum
CSSProblem
{
WARNING
=
0
,
ERROR
=
1
};
export
class
CSS
{
constructor
(
private
spectron
:
SpectronApplication
)
{
// noop
}
public
openQuickOutline
():
any
{
return
this
.
spectron
.
command
(
'
workbench.action.gotoSymbol
'
);
}
public
toggleProblemsView
():
any
{
return
this
.
spectron
.
command
(
'
workbench.actions.view.problems
'
);
}
public
async
getEditorProblem
(
problemType
:
CSSProblem
):
Promise
<
any
>
{
let
selector
;
if
(
problemType
===
CSSProblem
.
WARNING
)
{
selector
=
'
greensquiggly
'
;
}
else
if
(
problemType
===
CSSProblem
.
ERROR
)
{
selector
=
'
redsquiggly
'
;
}
else
{
throw
new
Error
(
'
No such problem type defined.
'
);
}
let
el
=
await
this
.
spectron
.
client
.
waitForElement
(
`.view-overlays .cdr.
${
selector
}
`
);
if
(
el
)
{
return
el
;
}
return
undefined
;
}
public
async
getProblemsViewsProblem
(
problemType
:
CSSProblem
):
Promise
<
any
>
{
let
selector
;
if
(
problemType
===
CSSProblem
.
WARNING
)
{
selector
=
'
warning
'
;
}
else
if
(
problemType
===
CSSProblem
.
ERROR
)
{
selector
=
'
error
'
;
}
else
{
throw
new
Error
(
'
No such problem type defined.
'
);
}
let
el
=
await
this
.
spectron
.
client
.
waitForElement
(
`div[aria-label="Problems grouped by files"] .icon.
${
selector
}
`
);
if
(
el
)
{
return
el
;
}
return
undefined
;
}
}
\ No newline at end of file
test/smoke/src/areas/data-loss.ts
已删除
100644 → 0
浏览文件 @
ffee5147
/*---------------------------------------------------------------------------------------------
* 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
'
;
export
class
DataLoss
{
constructor
(
private
spectron
:
SpectronApplication
)
{
}
public
openExplorerViewlet
():
Promise
<
any
>
{
return
this
.
spectron
.
command
(
'
workbench.view.explorer
'
);
}
public
async
verifyTabIsDirty
(
tabName
:
string
,
active
?:
boolean
):
Promise
<
any
>
{
let
activeSelector
=
active
?
'
.active
'
:
''
;
let
el
=
await
this
.
spectron
.
client
.
waitForElement
(
`.tabs-container .tab.dirty
${
activeSelector
}
[aria-label="
${
tabName
}
, tab"]`
);
if
(
el
)
{
return
el
;
}
return
undefined
;
}
}
\ No newline at end of file
test/smoke/src/areas/extensions.ts
已删除
100644 → 0
浏览文件 @
ffee5147
/*---------------------------------------------------------------------------------------------
* 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
{
CommonActions
}
from
'
./common
'
;
var
htmlparser
=
require
(
'
htmlparser2
'
);
export
class
Extensions
{
private
readonly
extensionsViewletSelector
=
'
div[id="workbench.view.extensions"]
'
;
private
viewletExtensionIndex
:
number
;
constructor
(
private
spectron
:
SpectronApplication
,
private
common
:
CommonActions
)
{
}
public
async
openExtensionsViewlet
():
Promise
<
any
>
{
await
this
.
spectron
.
command
(
'
workbench.view.extensions
'
);
return
this
.
spectron
.
wait
();
}
public
async
searchForExtension
(
name
:
string
):
Promise
<
any
>
{
const
searchBoxSelector
=
`
${
this
.
extensionsViewletSelector
}
.search-box`
;
await
this
.
spectron
.
client
.
clearElement
(
searchBoxSelector
);
try
{
await
this
.
spectron
.
client
.
waitAndClick
(
searchBoxSelector
);
}
catch
(
e
)
{
return
Promise
.
reject
(
'
Failed to click on search box in extensions viewlet.
'
);
}
await
this
.
spectron
.
client
.
keys
(
name
);
return
this
.
spectron
.
client
.
keys
([
'
NULL
'
,
'
Enter
'
,
'
NULL
'
]);
}
public
async
installExtension
(
name
:
string
):
Promise
<
any
>
{
const
extensionListSelector
=
`
${
this
.
extensionsViewletSelector
}
.monaco-list-rows`
;
this
.
viewletExtensionIndex
=
await
this
.
getExtensionIndex
(
name
,
extensionListSelector
);
try
{
return
this
.
spectron
.
client
.
waitAndClick
(
`
${
extensionListSelector
}
>:nth-child(
${
this
.
viewletExtensionIndex
}
) .extension .extension-action.install`
);
}
catch
(
e
)
{
return
Promise
.
reject
(
'
Failed to click on install button for selected extension.
'
);
}
}
public
getExtensionReloadText
():
Promise
<
any
>
{
try
{
return
this
.
spectron
.
waitFor
(
this
.
spectron
.
client
.
getText
,
`
${
this
.
extensionsViewletSelector
}
.monaco-list-rows>:nth-child(
${
this
.
viewletExtensionIndex
}
) .extension .extension-action.reload`
);
}
catch
(
e
)
{
return
Promise
.
reject
(
'
Reload was not prompted for an installed extension.
'
);
}
}
public
async
activateExtension
():
Promise
<
any
>
{
await
this
.
common
.
showCommands
();
await
this
.
common
.
type
(
'
Smoke Test Check
'
);
await
this
.
spectron
.
wait
();
return
this
.
common
.
enter
();
}
public
verifyStatusbarItem
():
Promise
<
any
>
{
try
{
return
this
.
spectron
.
waitFor
(
this
.
spectron
.
client
.
getText
,
'
.statusbar-item.statusbar-entry span[title="smoke test"]
'
);
}
catch
(
e
)
{
return
Promise
.
reject
(
'
Failed to validate extension contribution.
'
);
}
}
private
getExtensionIndex
(
name
:
string
,
extensionListSelector
:
string
):
Promise
<
number
>
{
return
this
.
spectron
.
waitFor
(
this
.
spectron
.
client
.
waitForHTML
,
extensionListSelector
).
then
(
html
=>
{
return
new
Promise
<
number
>
((
res
,
rej
)
=>
{
let
extensionIndex
:
number
=
0
;
let
extension
:
boolean
;
let
tags
:
string
[]
=
[];
let
parser
=
new
htmlparser
.
Parser
({
onopentag
:
function
(
name
,
attribs
)
{
if
(
name
===
'
div
'
&&
attribs
.
class
===
'
extension
'
)
{
extensionIndex
++
;
extension
=
true
;
}
if
(
extension
)
{
tags
.
push
(
name
);
}
},
ontext
:
function
(
text
)
{
if
(
extension
&&
text
===
name
)
{
parser
.
end
();
}
},
onclosetag
:
function
(
name
)
{
if
(
extension
)
{
tags
.
pop
();
}
if
(
extension
&&
tags
.
length
===
0
)
{
extension
=
false
;
}
},
onend
:
function
()
{
if
(
extensionIndex
===
0
)
{
return
rej
(
`
${
name
}
extension was not found.`
);
}
return
res
(
extensionIndex
);
}
});
parser
.
write
(
html
);
});
});
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录