Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
68e36ecb
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,发现更多精彩内容 >>
提交
68e36ecb
编写于
4月 11, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more wait calls
上级
5d48d471
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
35 addition
and
74 deletion
+35
-74
test/smoke/src/areas/activitybar/activityBar.ts
test/smoke/src/areas/activitybar/activityBar.ts
+1
-1
test/smoke/src/areas/explorer/explorer.ts
test/smoke/src/areas/explorer/explorer.ts
+2
-2
test/smoke/src/areas/extensions/extensions.test.ts
test/smoke/src/areas/extensions/extensions.test.ts
+2
-6
test/smoke/src/areas/extensions/extensions.ts
test/smoke/src/areas/extensions/extensions.ts
+0
-1
test/smoke/src/areas/multiroot/multiroot.test.ts
test/smoke/src/areas/multiroot/multiroot.test.ts
+1
-3
test/smoke/src/areas/preferences/preferences.test.ts
test/smoke/src/areas/preferences/preferences.test.ts
+2
-4
test/smoke/src/areas/statusbar/statusbar.ts
test/smoke/src/areas/statusbar/statusbar.ts
+2
-2
test/smoke/src/areas/workbench/data-migration.test.ts
test/smoke/src/areas/workbench/data-migration.test.ts
+6
-21
test/smoke/src/areas/workbench/localization.test.ts
test/smoke/src/areas/workbench/localization.test.ts
+5
-12
test/smoke/src/areas/workbench/viewlet.ts
test/smoke/src/areas/workbench/viewlet.ts
+3
-5
test/smoke/src/main.ts
test/smoke/src/main.ts
+7
-12
test/smoke/src/vscode/code.ts
test/smoke/src/vscode/code.ts
+4
-5
未找到文件。
test/smoke/src/areas/activitybar/activityBar.ts
浏览文件 @
68e36ecb
...
...
@@ -14,7 +14,7 @@ export class ActivityBar {
constructor
(
private
code
:
Code
)
{
}
async
get
ActivityBar
(
position
:
ActivityBarPosition
):
Promise
<
void
>
{
async
waitFor
ActivityBar
(
position
:
ActivityBarPosition
):
Promise
<
void
>
{
let
positionClass
:
string
;
if
(
position
===
ActivityBarPosition
.
LEFT
)
{
...
...
test/smoke/src/areas/explorer/explorer.ts
浏览文件 @
68e36ecb
...
...
@@ -21,8 +21,8 @@ export class Explorer extends Viewlet {
return
this
.
commands
.
runCommand
(
'
workbench.view.explorer
'
);
}
getOpenEditorsViewTitle
():
Promise
<
string
>
{
return
this
.
code
.
waitForTextContent
(
Explorer
.
OPEN_EDITORS_VIEW
);
async
waitForOpenEditorsViewTitle
(
fn
:
(
title
:
string
)
=>
boolean
):
Promise
<
void
>
{
await
this
.
code
.
waitForTextContent
(
Explorer
.
OPEN_EDITORS_VIEW
,
undefined
,
fn
);
}
async
openFile
(
fileName
:
string
):
Promise
<
any
>
{
...
...
test/smoke/src/areas/extensions/extensions.test.ts
浏览文件 @
68e36ecb
...
...
@@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
assert
from
'
assert
'
;
import
{
Application
,
Quality
}
from
'
../../application
'
;
export
function
setup
()
{
...
...
@@ -19,15 +18,12 @@ export function setup() {
const
extensionName
=
'
vscode-smoketest-check
'
;
await
app
.
workbench
.
extensions
.
openExtensionsViewlet
();
const
installed
=
await
app
.
workbench
.
extensions
.
installExtension
(
extensionName
);
assert
.
ok
(
installed
);
await
app
.
workbench
.
extensions
.
installExtension
(
extensionName
);
await
app
.
reload
();
await
app
.
workbench
.
extensions
.
waitForExtensionsViewlet
();
await
app
.
workbench
.
runCommand
(
'
Smoke Test Check
'
);
const
statusbarText
=
await
app
.
workbench
.
statusbar
.
getStatusbarTextByTitle
(
'
smoke test
'
);
assert
.
equal
(
statusbarText
,
'
VS Code Smoke Test Check
'
);
await
app
.
workbench
.
statusbar
.
waitForStatusbarText
(
'
smoke test
'
,
'
VS Code Smoke Test Check
'
);
});
});
}
\ No newline at end of file
test/smoke/src/areas/extensions/extensions.ts
浏览文件 @
68e36ecb
...
...
@@ -32,7 +32,6 @@ export class Extensions extends Viewlet {
async
installExtension
(
name
:
string
):
Promise
<
void
>
{
await
this
.
searchForExtension
(
name
);
await
this
.
code
.
waitAndClick
(
`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[aria-label="
${
name
}
"] .extension li[class='action-item'] .extension-action.install`
);
await
this
.
code
.
waitForElement
(
`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[aria-label="
${
name
}
"] .extension li[class='action-item'] .extension-action.reload`
);
}
...
...
test/smoke/src/areas/multiroot/multiroot.test.ts
浏览文件 @
68e36ecb
...
...
@@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
assert
from
'
assert
'
;
import
{
Application
}
from
'
../../application
'
;
export
function
setup
()
{
...
...
@@ -27,8 +26,7 @@ export function setup() {
it
(
'
shows workspace name in title
'
,
async
function
()
{
const
app
=
this
.
app
as
Application
;
const
title
=
await
app
.
code
.
getTitle
();
assert
.
ok
(
title
.
indexOf
(
'
smoketest (Workspace)
'
)
>=
0
);
await
app
.
code
.
waitForTitle
(
title
=>
/smoketest
\(
Workspace
\)
/i
.
test
(
title
));
});
});
}
\ No newline at end of file
test/smoke/src/areas/preferences/preferences.test.ts
浏览文件 @
68e36ecb
...
...
@@ -3,8 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
assert
from
'
assert
'
;
import
{
Application
}
from
'
../../application
'
;
import
{
ActivityBarPosition
}
from
'
../activitybar/activityBar
'
;
...
...
@@ -23,12 +21,12 @@ export function setup() {
it
(
`changes 'workbench.action.toggleSidebarPosition' command key binding and verifies it`
,
async
function
()
{
const
app
=
this
.
app
as
Application
;
a
ssert
.
ok
(
await
app
.
workbench
.
activitybar
.
getActivityBar
(
ActivityBarPosition
.
LEFT
),
'
Activity bar should be positioned on the left.
'
);
a
wait
app
.
workbench
.
activitybar
.
waitForActivityBar
(
ActivityBarPosition
.
LEFT
);
await
app
.
workbench
.
keybindingsEditor
.
updateKeybinding
(
'
workbench.action.toggleSidebarPosition
'
,
'
ctrl+u
'
,
'
Control+U
'
);
await
app
.
code
.
dispatchKeybinding
(
'
ctrl+u
'
);
a
ssert
.
ok
(
await
app
.
workbench
.
activitybar
.
getActivityBar
(
ActivityBarPosition
.
RIGHT
),
'
Activity bar was not moved to right after toggling its position.
'
);
a
wait
app
.
workbench
.
activitybar
.
waitForActivityBar
(
ActivityBarPosition
.
RIGHT
);
});
after
(
async
function
()
{
...
...
test/smoke/src/areas/statusbar/statusbar.ts
浏览文件 @
68e36ecb
...
...
@@ -37,8 +37,8 @@ export class StatusBar {
return
this
.
code
.
waitForTextContent
(
this
.
getSelector
(
StatusBarElement
.
EOL_STATUS
),
eol
);
}
async
getStatusbarTextByTitle
(
title
:
string
):
Promise
<
string
>
{
return
await
this
.
code
.
waitForTextContent
(
`
${
this
.
mainSelector
}
span[title="smoke test"]`
);
async
waitForStatusbarText
(
title
:
string
,
text
:
string
):
Promise
<
void
>
{
await
this
.
code
.
waitForTextContent
(
`
${
this
.
mainSelector
}
span[title="
${
title
}
"]`
,
text
);
}
private
getSelector
(
element
:
StatusBarElement
):
string
{
...
...
test/smoke/src/areas/workbench/data-migration.test.ts
浏览文件 @
68e36ecb
...
...
@@ -3,13 +3,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
assert
from
'
assert
'
;
import
{
Application
,
Quality
}
from
'
../../application
'
;
import
*
as
rimraf
from
'
rimraf
'
;
export
interface
ICreateAppFn
{
(
quality
:
Quality
):
Application
|
null
;
(
quality
:
Quality
):
Application
;
}
export
function
setup
(
userDataDir
:
string
,
createApp
:
ICreateAppFn
)
{
...
...
@@ -40,14 +38,9 @@ export function setup(userDataDir: string, createApp: ICreateAppFn) {
// Checking latest version for the restored state
const
app
=
createApp
(
Quality
.
Insiders
);
if
(
!
app
)
{
return
assert
(
false
);
}
await
app
.
start
(
false
);
assert
.
ok
(
await
app
.
workbench
.
editors
.
waitForActiveTab
(
'
Untitled-1
'
,
true
),
`Untitled-1 tab is not present after migration.`
);
await
app
.
workbench
.
editors
.
waitForActiveTab
(
'
Untitled-1
'
,
true
);
await
app
.
workbench
.
editor
.
waitForEditorContents
(
'
Untitled-1
'
,
c
=>
c
.
indexOf
(
textToType
)
>
-
1
);
await
app
.
stop
();
...
...
@@ -76,13 +69,9 @@ export function setup(userDataDir: string, createApp: ICreateAppFn) {
// Checking latest version for the restored state
const
app
=
createApp
(
Quality
.
Insiders
);
if
(
!
app
)
{
return
assert
(
false
);
}
await
app
.
start
(
false
);
a
ssert
.
ok
(
await
app
.
workbench
.
editors
.
waitForActiveTab
(
fileName
),
`dirty file tab is not present after migration.`
);
a
wait
app
.
workbench
.
editors
.
waitForActiveTab
(
fileName
);
await
app
.
workbench
.
editor
.
waitForEditorContents
(
fileName
,
c
=>
c
.
indexOf
(
textPart
)
>
-
1
);
await
app
.
stop
();
...
...
@@ -109,15 +98,11 @@ export function setup(userDataDir: string, createApp: ICreateAppFn) {
const
app
=
createApp
(
Quality
.
Insiders
);
if
(
!
app
)
{
return
assert
(
false
);
}
await
app
.
start
(
false
);
a
ssert
.
ok
(
await
app
.
workbench
.
editors
.
waitForTab
(
fileName1
),
`
${
fileName1
}
tab was not restored after migration.`
);
a
ssert
.
ok
(
await
app
.
workbench
.
editors
.
waitForTab
(
fileName2
),
`
${
fileName2
}
tab was not restored after migration.`
);
a
ssert
.
ok
(
await
app
.
workbench
.
editors
.
waitForTab
(
fileName3
),
`
${
fileName3
}
tab was not restored after migration.`
);
a
wait
app
.
workbench
.
editors
.
waitForTab
(
fileName1
);
a
wait
app
.
workbench
.
editors
.
waitForTab
(
fileName2
);
a
wait
app
.
workbench
.
editors
.
waitForTab
(
fileName3
);
await
app
.
stop
();
});
...
...
test/smoke/src/areas/workbench/localization.test.ts
浏览文件 @
68e36ecb
...
...
@@ -3,8 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
assert
from
'
assert
'
;
import
{
Application
,
Quality
}
from
'
../../application
'
;
export
function
setup
()
{
...
...
@@ -27,24 +25,19 @@ export function setup() {
return
;
}
let
text
=
await
app
.
workbench
.
explorer
.
getOpenEditorsViewTitle
();
assert
(
/geöffnete editoren/i
.
test
(
text
));
await
app
.
workbench
.
explorer
.
waitForOpenEditorsViewTitle
(
title
=>
/geöffnete editoren/i
.
test
(
title
));
await
app
.
workbench
.
search
.
openSearchViewlet
();
text
=
await
app
.
workbench
.
search
.
getTitle
();
assert
(
/suchen/i
.
test
(
text
));
await
app
.
workbench
.
search
.
waitForTitle
(
title
=>
/suchen/i
.
test
(
title
));
await
app
.
workbench
.
scm
.
openSCMViewlet
();
text
=
await
app
.
workbench
.
scm
.
getTitle
();
assert
(
/quellcodeverwaltung/i
.
test
(
text
));
await
app
.
workbench
.
scm
.
waitForTitle
(
title
=>
/quellcodeverwaltung/i
.
test
(
title
));
await
app
.
workbench
.
debug
.
openDebugViewlet
();
text
=
await
app
.
workbench
.
debug
.
getTitle
();
assert
(
/debuggen/i
.
test
(
text
));
await
app
.
workbench
.
debug
.
waitForTitle
(
title
=>
/debuggen/i
.
test
(
title
));
await
app
.
workbench
.
extensions
.
openExtensionsViewlet
();
text
=
await
app
.
workbench
.
extensions
.
getTitle
();
assert
(
/erweiterungen/i
.
test
(
text
));
await
app
.
workbench
.
extensions
.
waitForTitle
(
title
=>
/erweiterungen/i
.
test
(
title
));
});
});
}
\ No newline at end of file
test/smoke/src/areas/workbench/viewlet.ts
浏览文件 @
68e36ecb
...
...
@@ -9,11 +9,9 @@ import { Code } from '../../vscode/code';
export
abstract
class
Viewlet
{
constructor
(
protected
code
:
Code
)
{
// noop
}
constructor
(
protected
code
:
Code
)
{
}
async
getTitle
():
Promise
<
string
>
{
return
this
.
code
.
waitForTextContent
(
'
.monaco-workbench-container .part.sidebar > .title > .title-label > span
'
);
async
waitForTitle
(
fn
:
(
title
:
string
)
=>
boolean
):
Promise
<
void
>
{
await
this
.
code
.
waitForTextContent
(
'
.monaco-workbench-container .part.sidebar > .title > .title-label > span
'
,
undefined
,
fn
);
}
}
\ No newline at end of file
test/smoke/src/main.ts
浏览文件 @
68e36ecb
...
...
@@ -100,16 +100,16 @@ function getBuildElectronPath(root: string): string {
}
let
testCodePath
=
opts
.
build
;
let
stableCodePath
=
opts
[
'
stable-build
'
];
//
let stableCodePath = opts['stable-build'];
let
electronPath
:
string
;
let
stablePath
:
string
;
//
let stablePath: string;
if
(
testCodePath
)
{
electronPath
=
getBuildElectronPath
(
testCodePath
);
if
(
stableCodePath
)
{
stablePath
=
getBuildElectronPath
(
stableCodePath
);
}
//
if (stableCodePath) {
//
stablePath = getBuildElectronPath(stableCodePath);
//
}
}
else
{
testCodePath
=
getDevElectronPath
();
electronPath
=
testCodePath
;
...
...
@@ -228,13 +228,7 @@ async function setup(): Promise<void> {
console
.
log
(
'
*** Smoketest setup done!
\n
'
);
}
function
createApp
(
quality
:
Quality
):
Application
|
null
{
const
path
=
quality
===
Quality
.
Stable
?
stablePath
:
electronPath
;
if
(
!
path
)
{
return
null
;
}
function
createApp
(
quality
:
Quality
):
Application
{
return
new
Application
({
quality
,
codePath
:
opts
.
build
,
...
...
@@ -246,6 +240,7 @@ function createApp(quality: Quality): Application | null {
verbose
:
opts
.
verbose
});
}
before
(
async
function
()
{
// allow two minutes for setup
this
.
timeout
(
2
*
60
*
1000
);
...
...
test/smoke/src/vscode/code.ts
浏览文件 @
68e36ecb
...
...
@@ -246,23 +246,22 @@ export class Code {
return
await
this
.
waitFor
<
IElement
>
(()
=>
this
.
driver
.
getElements
(
windowId
,
selector
).
then
(
els
=>
els
[
0
]),
accept
,
`element with selector
${
selector
}
`
);
}
async
waitForActiveElement
(
selector
:
string
):
Promise
<
any
>
{
async
waitForActiveElement
(
selector
:
string
):
Promise
<
void
>
{
if
(
this
.
verbose
)
{
console
.
log
(
'
- waitForActiveElement:
'
,
selector
);
}
const
windowId
=
await
this
.
getActiveWindowId
();
return
await
this
.
waitFor
(()
=>
this
.
driver
.
isActiveElement
(
windowId
,
selector
),
undefined
,
`wait for active element:
${
selector
}
`
);
await
this
.
waitFor
(()
=>
this
.
driver
.
isActiveElement
(
windowId
,
selector
),
undefined
,
`wait for active element:
${
selector
}
`
);
}
// TODO make into waitForTitle
async
getTitle
():
Promise
<
string
>
{
async
waitForTitle
(
fn
:
(
title
:
string
)
=>
boolean
):
Promise
<
void
>
{
if
(
this
.
verbose
)
{
console
.
log
(
'
- getTitle
'
);
}
const
windowId
=
await
this
.
getActiveWindowId
();
return
await
this
.
driver
.
getTitle
(
windowId
);
await
this
.
waitFor
(()
=>
this
.
driver
.
getTitle
(
windowId
),
fn
,
'
wait for title: ${}
'
);
}
// TODO make into waitForTypeInEditor
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录