Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d8989c95
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,发现更多精彩内容 >>
提交
d8989c95
编写于
12月 08, 2017
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix smoketests
fixes #37603
上级
12fb325e
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
53 addition
and
27 deletion
+53
-27
test/smoke/src/areas/debug/debug.test.ts
test/smoke/src/areas/debug/debug.test.ts
+43
-0
test/smoke/src/areas/git/git.test.ts
test/smoke/src/areas/git/git.test.ts
+0
-13
test/smoke/src/areas/git/scm.ts
test/smoke/src/areas/git/scm.ts
+3
-3
test/smoke/src/areas/multiroot/multiroot.test.ts
test/smoke/src/areas/multiroot/multiroot.test.ts
+1
-1
test/smoke/src/areas/search/search.test.ts
test/smoke/src/areas/search/search.test.ts
+3
-3
test/smoke/src/main.ts
test/smoke/src/main.ts
+1
-1
test/smoke/src/spectron/application.ts
test/smoke/src/spectron/application.ts
+2
-2
test/smoke/src/spectron/client.ts
test/smoke/src/spectron/client.ts
+0
-4
未找到文件。
test/smoke/src/areas/debug/debug.test.ts
浏览文件 @
d8989c95
...
...
@@ -12,6 +12,7 @@ import * as stripJsonComments from 'strip-json-comments';
import
{
SpectronApplication
,
Quality
}
from
'
../../spectron/application
'
;
describe
(
'
Debug
'
,
()
=>
{
let
skip
=
false
;
before
(
async
function
()
{
const
app
=
this
.
app
as
SpectronApplication
;
...
...
@@ -27,11 +28,13 @@ describe('Debug', () => {
if
(
!
debugExists
)
{
console
.
warn
(
`Skipping debug tests because vscode-node-debug extension was not found in
${
extensionsPath
}
`
);
skip
=
true
;
return
;
}
if
(
!
debug2Exists
)
{
console
.
warn
(
`Skipping debug tests because vscode-node-debug2 extension was not found in
${
extensionsPath
}
`
);
skip
=
true
;
return
;
}
...
...
@@ -44,6 +47,11 @@ describe('Debug', () => {
});
it
(
'
configure launch json
'
,
async
function
()
{
if
(
skip
)
{
this
.
skip
();
return
;
}
const
app
=
this
.
app
as
SpectronApplication
;
await
app
.
workbench
.
debug
.
openDebugViewlet
();
...
...
@@ -69,6 +77,11 @@ describe('Debug', () => {
});
it
(
'
breakpoints
'
,
async
function
()
{
if
(
skip
)
{
this
.
skip
();
return
;
}
const
app
=
this
.
app
as
SpectronApplication
;
await
app
.
workbench
.
quickopen
.
openFile
(
'
index.js
'
);
...
...
@@ -78,6 +91,11 @@ describe('Debug', () => {
let
port
:
number
;
it
(
'
start debugging
'
,
async
function
()
{
if
(
skip
)
{
this
.
skip
();
return
;
}
const
app
=
this
.
app
as
SpectronApplication
;
port
=
await
app
.
workbench
.
debug
.
startDebugging
();
...
...
@@ -93,6 +111,11 @@ describe('Debug', () => {
});
it
(
'
focus stack frames and variables
'
,
async
function
()
{
if
(
skip
)
{
this
.
skip
();
return
;
}
const
app
=
this
.
app
as
SpectronApplication
;
await
app
.
client
.
waitFor
(()
=>
app
.
workbench
.
debug
.
getLocalVariableCount
(),
c
=>
c
===
4
,
'
there should be 4 local variables
'
);
...
...
@@ -108,6 +131,11 @@ describe('Debug', () => {
});
it
(
'
stepOver, stepIn, stepOut
'
,
async
function
()
{
if
(
skip
)
{
this
.
skip
();
return
;
}
const
app
=
this
.
app
as
SpectronApplication
;
await
app
.
workbench
.
debug
.
stepIn
();
...
...
@@ -125,6 +153,11 @@ describe('Debug', () => {
});
it
(
'
continue
'
,
async
function
()
{
if
(
skip
)
{
this
.
skip
();
return
;
}
const
app
=
this
.
app
as
SpectronApplication
;
await
app
.
workbench
.
debug
.
continue
();
...
...
@@ -140,12 +173,22 @@ describe('Debug', () => {
});
it
(
'
debug console
'
,
async
function
()
{
if
(
skip
)
{
this
.
skip
();
return
;
}
const
app
=
this
.
app
as
SpectronApplication
;
await
app
.
workbench
.
debug
.
waitForReplCommand
(
'
2 + 2
'
,
r
=>
r
===
'
4
'
);
});
it
(
'
stop debugging
'
,
async
function
()
{
if
(
skip
)
{
this
.
skip
();
return
;
}
const
app
=
this
.
app
as
SpectronApplication
;
await
app
.
workbench
.
debug
.
stopDebugging
();
...
...
test/smoke/src/areas/git/git.test.ts
浏览文件 @
d8989c95
...
...
@@ -52,12 +52,6 @@ describe('Git', () => {
it
(
'
stages correctly
'
,
async
function
()
{
const
app
=
this
.
app
as
SpectronApplication
;
// TODO@joao get these working once joh fixes scm viewlet
if
(
!
false
)
{
this
.
skip
();
return
;
}
await
app
.
workbench
.
scm
.
openSCMViewlet
();
const
appJs
=
await
app
.
workbench
.
scm
.
waitForChange
(
c
=>
c
.
name
===
'
app.js
'
&&
c
.
type
===
'
Modified
'
);
...
...
@@ -72,13 +66,6 @@ describe('Git', () => {
it
(
`stages, commits changes and verifies outgoing change`
,
async
function
()
{
const
app
=
this
.
app
as
SpectronApplication
;
// TODO@joao get these working once joh fixes scm viewlet
if
(
!
false
)
{
cp
.
execSync
(
'
git reset --hard origin/master
'
,
{
cwd
:
app
.
workspacePath
});
this
.
skip
();
return
;
}
await
app
.
workbench
.
scm
.
openSCMViewlet
();
const
appJs
=
await
app
.
workbench
.
scm
.
waitForChange
(
c
=>
c
.
name
===
'
app.js
'
&&
c
.
type
===
'
Modified
'
);
...
...
test/smoke/src/areas/git/scm.ts
浏览文件 @
d8989c95
...
...
@@ -13,7 +13,7 @@ const SCM_RESOURCE = `${VIEWLET} .monaco-list-row > .resource`;
const
SCM_RESOURCE_GROUP
=
`
${
VIEWLET
}
.monaco-list-row > .resource-group`
;
const
REFRESH_COMMAND
=
`div[id="workbench.parts.sidebar"] .actions-container a.action-label[title="Refresh"]`
;
const
COMMIT_COMMAND
=
`div[id="workbench.parts.sidebar"] .actions-container a.action-label[title="Commit"]`
;
const
SCM_RESOURCE_CLICK
=
name
=>
`
${
SCM_RESOURCE
}
.monaco-icon-label[title
$
="
${
name
}
"]`
;
const
SCM_RESOURCE_CLICK
=
name
=>
`
${
SCM_RESOURCE
}
.monaco-icon-label[title
*
="
${
name
}
"]`
;
const
SCM_RESOURCE_GROUP_COMMAND_CLICK
=
name
=>
`
${
SCM_RESOURCE_GROUP
}
.actions .action-label[title="
${
name
}
"]`
;
export
interface
Change
{
...
...
@@ -49,7 +49,7 @@ export class SCM extends Viewlet {
const
result
=
await
this
.
spectron
.
webclient
.
selectorExecute
(
SCM_RESOURCE
,
div
=>
(
Array
.
isArray
(
div
)
?
div
:
[
div
]).
map
(
element
=>
{
const
name
=
element
.
querySelector
(
'
.label-name
'
)
as
HTMLElement
;
const
icon
=
element
.
querySelector
(
'
.
monaco-icon-label
'
)
as
HTMLElement
;
const
icon
=
element
.
querySelector
(
'
.
decoration-icon
'
)
as
HTMLElement
;
const
actionElementList
=
element
.
querySelectorAll
(
'
.actions .action-label
'
);
const
actionElements
:
any
[]
=
[];
...
...
@@ -60,7 +60,7 @@ export class SCM extends Viewlet {
return
{
name
:
name
.
textContent
,
type
:
(
icon
.
title
||
''
)
.
replace
(
/^
([^
,
]
+
)
,.*$/
,
'
$1
'
)
,
type
:
(
icon
.
title
||
''
),
element
,
actionElements
};
...
...
test/smoke/src/areas/multiroot/multiroot.test.ts
浏览文件 @
d8989c95
...
...
@@ -17,7 +17,7 @@ describe('Multiroot', () => {
// for some reason Code opens 2 windows at this point
// so let's select the last one
await
app
.
client
.
windowByIndex
(
2
);
await
app
.
client
.
windowByIndex
(
1
);
});
it
(
'
shows results from all folders
'
,
async
function
()
{
...
...
test/smoke/src/areas/search/search.test.ts
浏览文件 @
d8989c95
...
...
@@ -15,7 +15,7 @@ describe('Search', () => {
await
app
.
workbench
.
search
.
openSearchViewlet
();
await
app
.
workbench
.
search
.
searchFor
(
'
body
'
);
await
app
.
workbench
.
search
.
waitForResultText
(
'
7 results in 4
files
'
);
await
app
.
workbench
.
search
.
waitForResultText
(
'
14 results in 5
files
'
);
});
it
(
'
searches only for *.js files & checks for correct result number
'
,
async
function
()
{
...
...
@@ -34,7 +34,7 @@ describe('Search', () => {
const
app
=
this
.
app
as
SpectronApplication
;
await
app
.
workbench
.
search
.
searchFor
(
'
body
'
);
await
app
.
workbench
.
search
.
removeFileMatch
(
1
);
await
app
.
workbench
.
search
.
waitForResultText
(
'
3 results in 3
files
'
);
await
app
.
workbench
.
search
.
waitForResultText
(
'
10 results in 4
files
'
);
});
it
(
'
replaces first search result with a replace term
'
,
async
function
()
{
...
...
@@ -46,7 +46,7 @@ describe('Search', () => {
await
app
.
workbench
.
search
.
replaceFileMatch
(
1
);
await
app
.
workbench
.
saveOpenedFile
();
await
app
.
workbench
.
search
.
waitForResultText
(
'
3 results in 3
files
'
);
await
app
.
workbench
.
search
.
waitForResultText
(
'
10 results in 4
files
'
);
await
app
.
workbench
.
search
.
searchFor
(
'
ydob
'
);
await
app
.
workbench
.
search
.
setReplaceText
(
'
body
'
);
...
...
test/smoke/src/main.ts
浏览文件 @
d8989c95
...
...
@@ -195,7 +195,7 @@ async function setup(): Promise<void> {
* @see https://github.com/webdriverio/webdriverio/issues/2076
*/
// Filter out the following messages:
const
wdioDeprecationWarning
=
/^WARNING: the "
\w
+" command will be dep
crecated soon
./
;
// [sic]
const
wdioDeprecationWarning
=
/^WARNING: the "
\w
+" command will be dep
recated soon.
./
;
// [sic]
// Monkey patch:
const
warn
=
console
.
warn
;
console
.
warn
=
function
suppressWebdriverWarnings
(
message
)
{
...
...
test/smoke/src/spectron/application.ts
浏览文件 @
d8989c95
...
...
@@ -271,9 +271,9 @@ export class SpectronApplication {
await
this
.
webclient
.
waitUntilWindowLoaded
();
// Spectron opens multiple terminals in Windows platform
// Workaround to focus the right window - https://github.com/electron/spectron/issues/60
await
this
.
client
.
windowByIndex
(
1
);
//
await this.client.windowByIndex(1);
// await this.app.browserWindow.focus();
await
this
.
client
.
waitFor
HTML
(
'
[id="workbench.main.container"]
'
);
await
this
.
client
.
waitFor
Element
(
'
.monaco-workbench
'
);
}
private
async
waitForWelcome
():
Promise
<
any
>
{
...
...
test/smoke/src/spectron/client.ts
浏览文件 @
d8989c95
...
...
@@ -54,10 +54,6 @@ export class SpectronClient {
return
this
.
waitFor
(()
=>
this
.
spectron
.
client
.
getValue
(
selector
),
accept
,
`getValue with selector
${
selector
}
`
);
}
async
waitForHTML
(
selector
:
string
,
accept
:
(
result
:
string
)
=>
boolean
=
(
result
:
string
)
=>
!!
result
):
Promise
<
any
>
{
return
this
.
waitFor
(()
=>
this
.
spectron
.
client
.
getHTML
(
selector
),
accept
,
`getHTML with selector
${
selector
}
`
);
}
async
waitAndClick
(
selector
:
string
):
Promise
<
any
>
{
return
this
.
waitFor
(()
=>
this
.
spectron
.
client
.
click
(
selector
),
void
0
,
`click with selector
${
selector
}
`
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录