提交 43f8f080 编写于 作者: S Sandeep Somavarapu

smoke: improve status bar tests

上级 7e1f12fe
......@@ -21,7 +21,7 @@ export class Problems {
public async showProblemsView(): Promise<any> {
if (!await this.isVisible()) {
await this.spectron.command('workbench.actions.view.problems');
await this.spectron.client.waitForElement(Problems.PROBLEMS_VIEW_SELECTOR);
await this.waitForProblemsView();
}
}
......@@ -37,6 +37,10 @@ export class Problems {
return !!element;
}
public async waitForProblemsView(): Promise<void> {
await this.spectron.client.waitForElement(Problems.PROBLEMS_VIEW_SELECTOR);
}
public static getSelectorInProblemsView(problemType: ProblemSeverity): string {
let selector = problemType === ProblemSeverity.WARNING ? 'warning' : 'error';
return `div[aria-label="Problems grouped by files"] .icon.${selector}`;
......
......@@ -69,19 +69,14 @@ export class QuickOpen {
await this.spectron.client.waitAndClick(QuickOpen.QUICK_OPEN_FOCUSED_ELEMENT);
}
protected waitForQuickOpenOpened(): Promise<Element> {
public waitForQuickOpenOpened(): Promise<Element> {
return this.spectron.client.waitForElement(QuickOpen.QUICK_OPEN_FOCUSSED_INPUT);
}
protected waitForQuickOpenClosed(): Promise<Element> {
public waitForQuickOpenClosed(): Promise<Element> {
return this.spectron.client.waitForElement(QuickOpen.QUICK_OPEN_HIDDEN);
}
public async isQuickOpenVisible(): Promise<boolean> {
await this.waitForQuickOpenOpened();
return true;
}
public async submit(text: string): Promise<void> {
await this.spectron.client.type(text);
await this.spectron.client.keys(['Enter', 'NULL']);
......
......@@ -33,27 +33,27 @@ describe('Statusbar', () => {
it(`verifies that 'quick open' opens when clicking on status bar elements`, async function () {
await app.workbench.statusbar.clickOn(StatusBarElement.BRANCH_STATUS);
assert.ok(await app.workbench.quickopen.isQuickOpenVisible(), 'Quick open is not opened for branch indicator.');
await app.workbench.quickopen.waitForQuickOpenOpened();
await app.workbench.quickopen.closeQuickOpen();
await app.workbench.quickopen.openFile('app.js');
await app.workbench.statusbar.clickOn(StatusBarElement.INDENTATION_STATUS);
assert.ok(await app.workbench.quickopen.isQuickOpenVisible(), 'Quick open is not opened for indentation indicator.');
await app.workbench.quickopen.waitForQuickOpenOpened();
await app.workbench.quickopen.closeQuickOpen();
await app.workbench.statusbar.clickOn(StatusBarElement.ENCODING_STATUS);
assert.ok(await app.workbench.quickopen.isQuickOpenVisible(), 'Quick open is not opened for encoding indicator.');
await app.workbench.quickopen.waitForQuickOpenOpened();
await app.workbench.quickopen.closeQuickOpen();
await app.workbench.statusbar.clickOn(StatusBarElement.EOL_STATUS);
assert.ok(await app.workbench.quickopen.isQuickOpenVisible(), 'Quick open is not opened for EOL indicator.');
await app.workbench.quickopen.waitForQuickOpenOpened();
await app.workbench.quickopen.closeQuickOpen();
await app.workbench.statusbar.clickOn(StatusBarElement.LANGUAGE_STATUS);
assert.ok(await app.workbench.quickopen.isQuickOpenVisible(), 'Quick open is not opened for language indicator.');
await app.workbench.quickopen.waitForQuickOpenOpened();
await app.workbench.quickopen.closeQuickOpen();
});
it(`verifies that 'Problems View' appears when clicking on 'Problems' status element`, async function () {
await app.workbench.statusbar.clickOn(StatusBarElement.PROBLEMS_STATUS);
assert.ok(await app.workbench.problems.isVisible());
await app.workbench.problems.waitForProblemsView();
});
if (app.build !== VSCODE_BUILD.DEV) {
......@@ -67,7 +67,7 @@ describe('Statusbar', () => {
await app.workbench.quickopen.openFile('app.js');
await app.workbench.statusbar.clickOn(StatusBarElement.SELECTION_STATUS);
assert.ok(await app.workbench.quickopen.isQuickOpenVisible(), 'Quick open is not opened line number selection.');
await app.workbench.quickopen.waitForQuickOpenOpened();
await app.workbench.quickopen.submit('15');
await app.workbench.editor.waitForHighlightingLine(15);
......@@ -77,7 +77,7 @@ describe('Statusbar', () => {
await app.workbench.quickopen.openFile('app.js');
await app.workbench.statusbar.clickOn(StatusBarElement.EOL_STATUS);
assert.ok(await app.workbench.quickopen.isQuickOpenVisible(), 'Quick open is not opened line number selection.');
await app.workbench.quickopen.waitForQuickOpenOpened();
app.workbench.quickopen.selectQuickOpenElement(1);
await app.workbench.statusbar.waitForEOL('CRLF');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册