Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b9c6595e
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,发现更多精彩内容 >>
提交
b9c6595e
编写于
9月 05, 2017
作者:
J
Joao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
smoke
上级
0f34ab38
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
15 deletion
+27
-15
test/smoke/src/areas/git/git.test.ts
test/smoke/src/areas/git/git.test.ts
+1
-0
test/smoke/src/areas/git/scm.ts
test/smoke/src/areas/git/scm.ts
+17
-10
test/smoke/src/main.ts
test/smoke/src/main.ts
+9
-5
未找到文件。
test/smoke/src/areas/git/git.test.ts
浏览文件 @
b9c6595e
...
...
@@ -28,6 +28,7 @@ describe('Git', () => {
// wait
await
app
.
workbench
.
scm
.
refreshSCMViewlet
();
await
app
.
workbench
.
scm
.
waitForChange
(
c
=>
c
.
name
===
'
app.js
'
);
await
app
.
workbench
.
scm
.
waitForChange
(
c
=>
c
.
name
===
'
index.jade
'
);
...
...
test/smoke/src/areas/git/scm.ts
浏览文件 @
b9c6595e
...
...
@@ -5,11 +5,10 @@
import
{
SpectronApplication
}
from
'
../../spectron/application
'
;
// var htmlparser = require('htmlparser2');
const
VIEWLET
=
'
div[id="workbench.view.scm"]
'
;
const
SCM_INPUT
=
`
${
VIEWLET
}
.scm-editor textarea`
;
const
SCM_RESOURCE
=
`
${
VIEWLET
}
.monaco-list-row > .resource`
;
const
REFRESH_COMMAND
=
`div[id="workbench.parts.sidebar"] .actions-container a.action-label[title="Refresh"]`
;
export
interface
Change
{
name
:
string
;
...
...
@@ -31,14 +30,7 @@ export class SCM {
async
waitForChange
(
func
:
(
change
:
Change
)
=>
boolean
):
Promise
<
Change
>
{
return
await
this
.
spectron
.
client
.
waitFor
(
async
()
=>
{
const
changes
=
await
this
.
spectron
.
webclient
.
selectorExecute
(
SCM_RESOURCE
,
div
=>
(
Array
.
isArray
(
div
)
?
div
:
[
div
]).
map
(
div
=>
{
const
name
=
div
.
querySelector
(
'
.label-name
'
)
as
HTMLElement
;
const
icon
=
div
.
querySelector
(
'
.decoration-icon
'
)
as
HTMLElement
;
return
{
name
:
name
.
textContent
,
type
:
icon
.
title
};
})
)
as
Change
[];
const
changes
=
await
this
.
getChanges
();
for
(
const
change
of
changes
)
{
if
(
func
(
change
))
{
...
...
@@ -50,6 +42,21 @@ export class SCM {
});
}
async
refreshSCMViewlet
():
Promise
<
any
>
{
await
this
.
spectron
.
client
.
click
(
REFRESH_COMMAND
);
}
async
getChanges
():
Promise
<
Change
[]
>
{
return
await
this
.
spectron
.
webclient
.
selectorExecute
(
SCM_RESOURCE
,
div
=>
(
Array
.
isArray
(
div
)
?
div
:
[
div
]).
map
(
div
=>
{
const
name
=
div
.
querySelector
(
'
.label-name
'
)
as
HTMLElement
;
const
icon
=
div
.
querySelector
(
'
.decoration-icon
'
)
as
HTMLElement
;
return
{
name
:
name
.
textContent
,
type
:
icon
.
title
};
})
)
as
Change
[];
}
// async getChanges(expectedCount: number): Promise<Change[]> {
// await this.spectron.client.waitForElements(SCM_RESOURCE, r => r.length === expectedCount);
...
...
test/smoke/src/main.ts
浏览文件 @
b9c6595e
...
...
@@ -91,8 +91,10 @@ function toUri(path: string): string {
}
async
function
main
():
Promise
<
void
>
{
console
.
log
(
'
*** Preparing smoketest setup...
'
);
const
keybindingsUrl
=
`https://raw.githubusercontent.com/Microsoft/vscode-docs/master/scripts/keybindings/doc.keybindings.
${
getKeybindingPlatform
()}
.json`
;
console
.
log
(
`Fetching keybindings from
${
keybindingsUrl
}
...`
);
console
.
log
(
'
*** Fetching keybindings...
'
);
await
new
Promise
((
c
,
e
)
=>
{
https
.
get
(
keybindingsUrl
,
res
=>
{
...
...
@@ -105,7 +107,7 @@ async function main(): Promise<void> {
});
if
(
!
fs
.
existsSync
(
workspacePath
))
{
console
.
log
(
'
Creating workspace file...
'
);
console
.
log
(
'
***
Creating workspace file...
'
);
const
workspace
=
{
id
:
(
Date
.
now
()
+
Math
.
round
(
Math
.
random
()
*
1000
)).
toString
(),
folders
:
[
...
...
@@ -119,17 +121,19 @@ async function main(): Promise<void> {
}
if
(
!
fs
.
existsSync
(
testRepoLocalDir
))
{
console
.
log
(
'
Cloning test project repository...
'
);
console
.
log
(
'
***
Cloning test project repository...
'
);
cp
.
spawnSync
(
'
git
'
,
[
'
clone
'
,
testRepoUrl
,
testRepoLocalDir
]);
}
else
{
console
.
log
(
'
Cleaning test project repository...
'
);
console
.
log
(
'
***
Cleaning test project repository...
'
);
cp
.
spawnSync
(
'
git
'
,
[
'
fetch
'
],
{
cwd
:
testRepoLocalDir
});
cp
.
spawnSync
(
'
git
'
,
[
'
reset
'
,
'
--hard
'
,
'
FETCH_HEAD
'
],
{
cwd
:
testRepoLocalDir
});
cp
.
spawnSync
(
'
git
'
,
[
'
clean
'
,
'
-xdf
'
],
{
cwd
:
testRepoLocalDir
});
}
console
.
log
(
'
Running npm install...
'
);
console
.
log
(
'
***
Running npm install...
'
);
// cp.execSync('npm install', { cwd: testRepoLocalDir, stdio: 'inherit' });
console
.
log
(
'
*** Smoketest setup done!
\n
'
);
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录