Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a5d75513
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,发现更多精彩内容 >>
提交
a5d75513
编写于
4月 13, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
smoke: better reload, better extension search
上级
30c497bd
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
29 addition
and
18 deletion
+29
-18
src/vs/platform/driver/common/driver.ts
src/vs/platform/driver/common/driver.ts
+7
-0
src/vs/platform/driver/electron-main/driver.ts
src/vs/platform/driver/electron-main/driver.ts
+8
-0
test/smoke/src/application.ts
test/smoke/src/application.ts
+1
-7
test/smoke/src/areas/extensions/extensions.test.ts
test/smoke/src/areas/extensions/extensions.test.ts
+1
-1
test/smoke/src/areas/extensions/extensions.ts
test/smoke/src/areas/extensions/extensions.ts
+1
-5
test/smoke/src/areas/workbench/workbench.ts
test/smoke/src/areas/workbench/workbench.ts
+5
-5
test/smoke/src/main.ts
test/smoke/src/main.ts
+1
-0
test/smoke/src/vscode/code.ts
test/smoke/src/vscode/code.ts
+5
-0
未找到文件。
src/vs/platform/driver/common/driver.ts
浏览文件 @
a5d75513
...
...
@@ -27,6 +27,7 @@ export interface IDriver {
_serviceBrand
:
any
;
getWindowIds
():
TPromise
<
number
[]
>
;
reloadWindow
(
windowId
:
number
):
TPromise
<
void
>
;
dispatchKeybinding
(
windowId
:
number
,
keybinding
:
string
):
TPromise
<
void
>
;
click
(
windowId
:
number
,
selector
:
string
,
xoffset
?:
number
|
undefined
,
yoffset
?:
number
|
undefined
):
TPromise
<
void
>
;
doubleClick
(
windowId
:
number
,
selector
:
string
):
TPromise
<
void
>
;
...
...
@@ -42,6 +43,7 @@ export interface IDriver {
export
interface
IDriverChannel
extends
IChannel
{
call
(
command
:
'
getWindowIds
'
):
TPromise
<
number
[]
>
;
call
(
command
:
'
reloadWindow
'
,
arg
:
number
):
TPromise
<
void
>
;
call
(
command
:
'
dispatchKeybinding
'
,
arg
:
[
number
,
string
]):
TPromise
<
void
>
;
call
(
command
:
'
click
'
,
arg
:
[
number
,
string
,
number
|
undefined
,
number
|
undefined
]):
TPromise
<
void
>
;
call
(
command
:
'
doubleClick
'
,
arg
:
[
number
,
string
]):
TPromise
<
void
>
;
...
...
@@ -62,6 +64,7 @@ export class DriverChannel implements IDriverChannel {
call
(
command
:
string
,
arg
?:
any
):
TPromise
<
any
>
{
switch
(
command
)
{
case
'
getWindowIds
'
:
return
this
.
driver
.
getWindowIds
();
case
'
reloadWindow
'
:
return
this
.
driver
.
reloadWindow
(
arg
);
case
'
dispatchKeybinding
'
:
return
this
.
driver
.
dispatchKeybinding
(
arg
[
0
],
arg
[
1
]);
case
'
click
'
:
return
this
.
driver
.
click
(
arg
[
0
],
arg
[
1
],
arg
[
2
],
arg
[
3
]);
case
'
doubleClick
'
:
return
this
.
driver
.
doubleClick
(
arg
[
0
],
arg
[
1
]);
...
...
@@ -88,6 +91,10 @@ export class DriverChannelClient implements IDriver {
return
this
.
channel
.
call
(
'
getWindowIds
'
);
}
reloadWindow
(
windowId
:
number
):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
reloadWindow
'
,
windowId
);
}
dispatchKeybinding
(
windowId
:
number
,
keybinding
:
string
):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
dispatchKeybinding
'
,
[
windowId
,
keybinding
]);
}
...
...
src/vs/platform/driver/electron-main/driver.ts
浏览文件 @
a5d75513
...
...
@@ -63,6 +63,14 @@ export class Driver implements IDriver, IWindowDriverRegistry {
.
filter
(
id
=>
this
.
registeredWindowIds
.
has
(
id
)
&&
!
this
.
reloadingWindowIds
.
has
(
id
));
}
async
reloadWindow
(
windowId
:
number
):
TPromise
<
void
>
{
await
this
.
whenUnfrozen
(
windowId
);
const
window
=
this
.
windowsService
.
getWindowById
(
windowId
);
this
.
reloadingWindowIds
.
add
(
windowId
);
window
.
reload
();
}
async
dispatchKeybinding
(
windowId
:
number
,
keybinding
:
string
):
TPromise
<
void
>
{
await
this
.
whenUnfrozen
(
windowId
);
...
...
test/smoke/src/application.ts
浏览文件 @
a5d75513
...
...
@@ -27,7 +27,6 @@ export class Application {
private
_code
:
Code
|
undefined
;
private
_workbench
:
Workbench
;
private
keybindings
:
any
[];
private
stopLogCollection
:
(()
=>
Promise
<
void
>
)
|
undefined
;
constructor
(
private
options
:
ApplicationOptions
)
{
}
...
...
@@ -79,7 +78,7 @@ export class Application {
}
async
reload
():
Promise
<
any
>
{
this
.
workbench
.
runCommand
(
'
Reload Window
'
)
this
.
code
.
reload
(
)
.
catch
(
err
=>
null
);
// ignore the connection drop errors
// needs to be enough to propagate the 'Reload Window' command
...
...
@@ -88,11 +87,6 @@ export class Application {
}
async
stop
():
Promise
<
any
>
{
if
(
this
.
stopLogCollection
)
{
await
this
.
stopLogCollection
();
this
.
stopLogCollection
=
undefined
;
}
if
(
this
.
_code
)
{
this
.
_code
.
dispose
();
this
.
_code
=
undefined
;
...
...
test/smoke/src/areas/extensions/extensions.test.ts
浏览文件 @
a5d75513
...
...
@@ -21,7 +21,7 @@ export function setup() {
await
app
.
workbench
.
extensions
.
installExtension
(
extensionName
);
await
app
.
reload
();
await
app
.
workbench
.
extensions
.
waitFor
ExtensionsViewlet
();
await
app
.
workbench
.
extensions
.
open
ExtensionsViewlet
();
await
app
.
workbench
.
runCommand
(
'
Smoke Test Check
'
);
await
app
.
workbench
.
statusbar
.
waitForStatusbarText
(
'
smoke test
'
,
'
VS Code Smoke Test Check
'
);
});
...
...
test/smoke/src/areas/extensions/extensions.ts
浏览文件 @
a5d75513
...
...
@@ -17,17 +17,13 @@ export class Extensions extends Viewlet {
async
openExtensionsViewlet
():
Promise
<
any
>
{
await
this
.
commands
.
runCommand
(
'
workbench.view.extensions
'
);
await
this
.
waitForExtensionsViewlet
();
}
async
waitForExtensionsViewlet
():
Promise
<
any
>
{
await
this
.
code
.
waitForActiveElement
(
SEARCH_BOX
);
}
async
searchForExtension
(
name
:
string
):
Promise
<
any
>
{
await
this
.
code
.
waitAndClick
(
SEARCH_BOX
);
await
this
.
code
.
waitForActiveElement
(
SEARCH_BOX
);
await
this
.
code
.
waitForSetValue
(
SEARCH_BOX
,
name
);
await
this
.
code
.
waitForSetValue
(
SEARCH_BOX
,
`name:"
${
name
}
"`
);
}
async
installExtension
(
name
:
string
):
Promise
<
void
>
{
...
...
test/smoke/src/areas/workbench/workbench.ts
浏览文件 @
a5d75513
...
...
@@ -58,14 +58,14 @@ export class Workbench implements Commands {
* Retrieves the command from keybindings file and executes it with WebdriverIO client API
* @param command command (e.g. 'workbench.action.files.newUntitledFile')
*/
async
runCommand
(
command
:
string
):
Promise
<
any
>
{
async
runCommand
(
command
:
string
):
Promise
<
void
>
{
const
binding
=
this
.
keybindings
.
find
(
x
=>
x
[
'
command
'
]
===
command
);
if
(
!
binding
)
{
if
(
binding
)
{
await
this
.
code
.
dispatchKeybinding
(
binding
.
key
);
}
else
{
await
this
.
quickopen
.
runCommand
(
command
);
return
;
}
return
this
.
code
.
dispatchKeybinding
(
binding
.
key
);
}
}
test/smoke/src/main.ts
浏览文件 @
a5d75513
...
...
@@ -248,6 +248,7 @@ before(async function () {
});
after
(
async
function
()
{
await
new
Promise
(
c
=>
setTimeout
(
c
,
500
));
// wait for shutdown
await
new
Promise
((
c
,
e
)
=>
rimraf
(
testDataPath
,
{
maxBusyTries
:
10
},
err
=>
err
?
e
(
err
)
:
c
()));
});
...
...
test/smoke/src/vscode/code.ts
浏览文件 @
a5d75513
...
...
@@ -211,6 +211,11 @@ export class Code {
await
this
.
driver
.
dispatchKeybinding
(
windowId
,
keybinding
);
}
async
reload
():
Promise
<
void
>
{
const
windowId
=
await
this
.
getActiveWindowId
();
await
this
.
driver
.
reloadWindow
(
windowId
);
}
async
waitForTextContent
(
selector
:
string
,
textContent
?:
string
,
accept
?:
(
result
:
string
)
=>
boolean
):
Promise
<
string
>
{
const
windowId
=
await
this
.
getActiveWindowId
();
accept
=
accept
||
(
result
=>
textContent
!==
void
0
?
textContent
===
result
:
!!
result
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录