mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Provide more info about test failures thrugh catching more webdriverio exceptions.
This commit is contained in:
parent
e0d0a4ecd3
commit
8e0d8cfc1e
|
@ -27,7 +27,11 @@ export class CommonActions {
|
|||
public async addSetting(setting: string, value: string): Promise<any> {
|
||||
await this.spectron.command('workbench.action.openGlobalSettings');
|
||||
await this.spectron.wait();
|
||||
await this.spectron.client.leftClick('.editable-preferences-editor-container .view-lines', 1, 1, false);
|
||||
try {
|
||||
await this.spectron.client.leftClick('.editable-preferences-editor-container .view-lines', 1, 1, false);
|
||||
} catch (e) {
|
||||
return Promise.reject('Failed to select settings editor to add a setting.');
|
||||
}
|
||||
await this.spectron.client.keys(['ArrowDown', 'NULL', 'ArrowDown', 'NULL'], false);
|
||||
await this.spectron.wait();
|
||||
await this.spectron.client.keys(`"${setting}": "${value}"`);
|
||||
|
@ -122,7 +126,12 @@ export class CommonActions {
|
|||
}
|
||||
selector += '"]';
|
||||
|
||||
await this.spectron.waitFor(this.spectron.client.doubleClick, selector);
|
||||
try {
|
||||
await this.spectron.waitFor(this.spectron.client.doubleClick, selector);
|
||||
} catch (e) {
|
||||
return Promise.reject(`Cannot fine ${fileName} in a viewlet.`);
|
||||
}
|
||||
|
||||
return this.spectron.wait();
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,10 @@ export class ConfigurationView {
|
|||
// noop
|
||||
}
|
||||
|
||||
public getEditorLineNumbers(): any {
|
||||
return this.spectron.client.elements('.line-numbers');
|
||||
public async getEditorLineNumbers(): Promise<any> {
|
||||
const lineNumbers = await this.spectron.client.elements('.line-numbers');
|
||||
|
||||
return lineNumbers.value.length;
|
||||
}
|
||||
|
||||
public enterKeybindingsView(): any {
|
||||
|
|
|
@ -25,19 +25,33 @@ export class Extensions {
|
|||
const searchBoxSelector = `${this.extensionsViewletSelector} .search-box`;
|
||||
|
||||
await this.spectron.client.clearElement(searchBoxSelector);
|
||||
await this.spectron.client.click(searchBoxSelector, false);
|
||||
try {
|
||||
await this.spectron.client.click(searchBoxSelector, false);
|
||||
} catch (e) {
|
||||
return Promise.reject('Failed to click on search box in extensions viewlet.');
|
||||
}
|
||||
await this.spectron.client.keys(name);
|
||||
|
||||
return this.spectron.client.keys(['NULL', 'Enter', 'NULL']);
|
||||
}
|
||||
|
||||
public async installExtension(name: string): Promise<any> {
|
||||
const extensionListSelector = `${this.extensionsViewletSelector} .monaco-list-rows`;
|
||||
this.viewletExtensionIndex = await this.getExtensionIndex(name, extensionListSelector);
|
||||
return this.spectron.client.click(`${extensionListSelector}>:nth-child(${this.viewletExtensionIndex}) .extension .extension-action.install`);
|
||||
|
||||
try {
|
||||
return this.spectron.client.click(`${extensionListSelector}>:nth-child(${this.viewletExtensionIndex}) .extension .extension-action.install`);
|
||||
} catch (e) {
|
||||
return Promise.reject('Failed to click on install button for selected extension.');
|
||||
}
|
||||
}
|
||||
|
||||
public getExtensionReloadText(): Promise<any> {
|
||||
return this.spectron.waitFor(this.spectron.client.getText, `${this.extensionsViewletSelector} .monaco-list-rows>:nth-child(${this.viewletExtensionIndex}) .extension .extension-action.reload`);
|
||||
try {
|
||||
return this.spectron.waitFor(this.spectron.client.getText, `${this.extensionsViewletSelector} .monaco-list-rows>:nth-child(${this.viewletExtensionIndex}) .extension .extension-action.reload`);
|
||||
} catch (e) {
|
||||
return Promise.reject('Reload was not prompted for an installed extension.');
|
||||
}
|
||||
}
|
||||
|
||||
public async selectMinimalIconsTheme(): Promise<any> {
|
||||
|
@ -49,7 +63,11 @@ export class Extensions {
|
|||
}
|
||||
|
||||
public async verifyFolderIconAppearance(): Promise<any> {
|
||||
return this.spectron.waitFor(this.spectron.client.getHTML, 'style[class="contributedIconTheme"]');
|
||||
try {
|
||||
return this.spectron.waitFor(this.spectron.client.getHTML, 'style[class="contributedIconTheme"]');
|
||||
} catch (e) {
|
||||
return Promise.reject('Failed to validate extension contribution.');
|
||||
}
|
||||
}
|
||||
|
||||
private getExtensionIndex(name: string, extensionListSelector: string): Promise<number> {
|
||||
|
@ -57,15 +75,15 @@ export class Extensions {
|
|||
const html = await this.spectron.waitFor(this.spectron.client.getHTML, extensionListSelector);
|
||||
let extensionIndex: number = 0;
|
||||
let extension: boolean;
|
||||
var domelems:string[] = [];
|
||||
var parser = new htmlparser.Parser({
|
||||
let tags: string[] = [];
|
||||
let parser = new htmlparser.Parser({
|
||||
onopentag: function (name, attribs) {
|
||||
if (name === 'div' && attribs.class === 'extension') {
|
||||
extensionIndex++;
|
||||
extension = true;
|
||||
}
|
||||
if (extension) {
|
||||
domelems.push(name);
|
||||
tags.push(name);
|
||||
}
|
||||
},
|
||||
ontext: function (text) {
|
||||
|
@ -75,17 +93,17 @@ export class Extensions {
|
|||
},
|
||||
onclosetag: function (name) {
|
||||
if (extension) {
|
||||
domelems.pop();
|
||||
tags.pop();
|
||||
}
|
||||
if (extension && domelems.length === 0) {
|
||||
if (extension && tags.length === 0) {
|
||||
extension = false;
|
||||
}
|
||||
},
|
||||
onend: function () {
|
||||
if (extensionIndex === 0) {
|
||||
rej(`${name} extension was not found.`);
|
||||
return rej(`${name} extension was not found.`);
|
||||
}
|
||||
res(extensionIndex);
|
||||
return res(extensionIndex);
|
||||
}
|
||||
});
|
||||
parser.write(html);
|
||||
|
|
|
@ -105,16 +105,29 @@ export class Git {
|
|||
}
|
||||
|
||||
public focusOnCommitBox(): Promise<any> {
|
||||
return this.spectron.client.click('div[id="workbench.view.scm"] textarea');
|
||||
try {
|
||||
return this.spectron.client.click('div[id="workbench.view.scm"] textarea');
|
||||
} catch (e) {
|
||||
return Promise.reject('Failed to focus on commit box: ' + e);
|
||||
}
|
||||
}
|
||||
|
||||
public async pressCommit(): Promise<any> {
|
||||
await this.spectron.client.click('.action-label.icon.contrib-cmd-icon-10');
|
||||
try {
|
||||
await this.spectron.client.click('.action-label.icon.contrib-cmd-icon-10');
|
||||
} catch (e) {
|
||||
return Promise.reject('Failed to press commit: ' + e);
|
||||
}
|
||||
|
||||
return this.spectron.wait();
|
||||
}
|
||||
|
||||
public getOutgoingChanges(): Promise<string> {
|
||||
return this.spectron.client.getText('a[title="Synchronize Changes"]');
|
||||
try {
|
||||
return this.spectron.client.getText('a[title="Synchronize Changes"]');
|
||||
} catch (e) {
|
||||
return Promise.reject(`Failed to obtain 'synchronize changes' title value from the status bar.`);
|
||||
}
|
||||
}
|
||||
|
||||
private getFirstChangeIndex(changeClass: string, selector: string): Promise<number> {
|
||||
|
|
|
@ -28,7 +28,12 @@ export class IntegratedTerminal {
|
|||
|
||||
const rows = await this.spectron.client.elements(`${selector} div`);
|
||||
for (let i = 0; i < rows.value.length; i++) {
|
||||
const rowText = await this.spectron.client.getText(`${selector}>:nth-child(${i + 1})`);
|
||||
let rowText;
|
||||
try {
|
||||
rowText = await this.spectron.client.getText(`${selector}>:nth-child(${i+1})`);
|
||||
} catch (e) {
|
||||
return Promise.reject(`Failed to obtain text from line ${i+1} from the terminal.`);
|
||||
}
|
||||
if (rowText.trim() === result) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,11 @@ export class JavaScriptDebug {
|
|||
}
|
||||
|
||||
public setBreakpointOnLine(lineNumber: number): Promise<any> {
|
||||
return this.spectron.client.leftClick(`${this.sidebarSelector}>:nth-child(${lineNumber})`, 5, 5);
|
||||
try {
|
||||
return this.spectron.client.leftClick(`${this.sidebarSelector}>:nth-child(${lineNumber})`, 5, 5);
|
||||
} catch (e) {
|
||||
return Promise.reject('Setting breakpoint failed: ' + e);
|
||||
}
|
||||
}
|
||||
|
||||
public async verifyBreakpointOnLine(lineNumber: number): Promise<any> {
|
||||
|
|
|
@ -66,7 +66,11 @@ export class JavaScript {
|
|||
this.foldLine = await this.getLineIndexOfFirstFoldableElement(`.margin-view-overlays`);
|
||||
this.foldSelector = `.margin-view-overlays>:nth-child(${this.foldLine})`;
|
||||
|
||||
return this.spectron.client.click(`${this.foldSelector} .cldr.folding`);
|
||||
try {
|
||||
return this.spectron.client.click(`${this.foldSelector} .cldr.folding`);
|
||||
} catch (e) {
|
||||
return Promise.reject('Clicking on fold element failed ' + e);
|
||||
}
|
||||
}
|
||||
|
||||
public async getFirstCommentFoldedIcon(): Promise<any> {
|
||||
|
@ -82,19 +86,27 @@ export class JavaScript {
|
|||
return Promise.reject('Folded line was not set, most likely because fold was not toggled initially.');
|
||||
}
|
||||
|
||||
return this.spectron.client.getText(`.margin-view-overlays>:nth-child(${this.foldLine+1}) .line-numbers`);
|
||||
return this.spectron.client.getText(`.margin-view-overlays>:nth-child(${this.foldLine + 1}) .line-numbers`);
|
||||
}
|
||||
|
||||
public async goToExpressDefinition(): Promise<any> {
|
||||
await this.setExpressVarSelector();
|
||||
await this.spectron.client.click(this.expressVarSelector);
|
||||
try {
|
||||
await this.spectron.client.click(this.expressVarSelector);
|
||||
} catch (e) {
|
||||
return Promise.reject(`Clicking on express variable failed: ` + e);
|
||||
}
|
||||
|
||||
return this.spectron.command('editor.action.goToDeclaration');
|
||||
}
|
||||
|
||||
public async peekExpressDefinition(): Promise<any> {
|
||||
await this.setExpressVarSelector();
|
||||
await this.spectron.client.click(this.expressVarSelector);
|
||||
try {
|
||||
await this.spectron.client.click(this.expressVarSelector);
|
||||
} catch (e) {
|
||||
return Promise.reject('Clicking on express variable failed: ' + e);
|
||||
}
|
||||
|
||||
return this.spectron.command('editor.action.previewDeclaration');
|
||||
}
|
||||
|
|
|
@ -19,7 +19,13 @@ export class Localization {
|
|||
}
|
||||
|
||||
public async getOpenEditorsText(): Promise<string> {
|
||||
const explorerTitles = await this.spectron.client.getText('div[id="workbench.view.explorer"] .title span');
|
||||
let explorerTitles;
|
||||
try {
|
||||
explorerTitles = await this.spectron.client.getText('div[id="workbench.view.explorer"] .title span');
|
||||
} catch (e) {
|
||||
return Promise.reject('Failed to get span of title in explorer viewlet.');
|
||||
}
|
||||
|
||||
return explorerTitles[0];
|
||||
}
|
||||
|
||||
|
@ -45,11 +51,19 @@ export class Localization {
|
|||
}
|
||||
|
||||
public getOpenedViewletTitle(): Promise<string> {
|
||||
return this.spectron.client.getText('div[id="workbench.parts.sidebar"] .title-label span');
|
||||
try {
|
||||
return this.spectron.client.getText('div[id="workbench.parts.sidebar"] .title-label span');
|
||||
} catch (e) {
|
||||
return Promise.reject('Failed to get span of title label in explorer viewlet.');
|
||||
}
|
||||
}
|
||||
|
||||
public getExtensionsSearchPlaceholder(): Promise<string> {
|
||||
return this.spectron.client.getAttribute('div[id="workbench.view.extensions"] .search-box', 'placeholder');
|
||||
try {
|
||||
return this.spectron.client.getAttribute('div[id="workbench.view.extensions"] .search-box', 'placeholder');
|
||||
} catch (e) {
|
||||
return Promise.reject('Failed to add attribute for extensi');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -21,11 +21,19 @@ export class Search {
|
|||
}
|
||||
|
||||
public setReplaceText(text: string): any {
|
||||
return this.spectron.client.setValue('.viewlet .input[title="Replace"]', text);
|
||||
try {
|
||||
return this.spectron.client.setValue('.viewlet .input[title="Replace"]', text);
|
||||
} catch (e) {
|
||||
return Promise.reject('Cannot set replace input in the viewlet: ' + e);
|
||||
}
|
||||
}
|
||||
|
||||
public replaceFirstMatch(): any {
|
||||
return this.spectron.client.click('.monaco-tree-rows.show-twisties .action-label.icon.action-replace-all');
|
||||
try {
|
||||
return this.spectron.client.click('.monaco-tree-rows.show-twisties .action-label.icon.action-replace-all');
|
||||
} catch (e) {
|
||||
return Promise.reject('Cannot replace the search first match: ' + e);
|
||||
}
|
||||
}
|
||||
|
||||
public getResultText(): any {
|
||||
|
@ -33,18 +41,34 @@ export class Search {
|
|||
}
|
||||
|
||||
public toggleSearchDetails(): any {
|
||||
return this.spectron.client.click('.query-details .more');
|
||||
try {
|
||||
return this.spectron.client.click('.query-details .more');
|
||||
} catch (e) {
|
||||
return Promise.reject('Toggling search details failed: ' + e);
|
||||
}
|
||||
}
|
||||
|
||||
public toggleReplace(): any {
|
||||
return this.spectron.client.click('.monaco-button.toggle-replace-button.collapse');
|
||||
try {
|
||||
return this.spectron.client.click('.monaco-button.toggle-replace-button.collapse');
|
||||
} catch (e) {
|
||||
return Promise.reject('Toggling replace failed: ' + e);
|
||||
}
|
||||
}
|
||||
|
||||
public hoverOverResultCount(): any {
|
||||
return this.spectron.waitFor(this.spectron.client.moveToObject, '.monaco-count-badge');
|
||||
try {
|
||||
return this.spectron.waitFor(this.spectron.client.moveToObject, '.monaco-count-badge');
|
||||
} catch (e) {
|
||||
return Promise.reject('Hovering over result count failed: ' + e);
|
||||
}
|
||||
}
|
||||
|
||||
public dismissResult(): any {
|
||||
return this.spectron.client.click('.action-label.icon.action-remove');
|
||||
try {
|
||||
return this.spectron.client.click('.action-label.icon.action-remove');
|
||||
} catch (e) {
|
||||
return Promise.reject('Clicking on dismissing result failed: ' + e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -41,7 +41,11 @@ export class StatusBar {
|
|||
throw new Error('No such element in the status bar defined.');
|
||||
}
|
||||
|
||||
return this.spectron.client.click(selector);
|
||||
try {
|
||||
return this.spectron.client.click(selector);
|
||||
} catch (e) {
|
||||
return Promise.reject(`Clicking on status bar element ${selector} failed.`);
|
||||
}
|
||||
}
|
||||
|
||||
public async getProblemsView(): Promise<any> {
|
||||
|
|
|
@ -35,7 +35,11 @@ export class Tasks {
|
|||
}
|
||||
|
||||
public selectOutputViewType(type: string): Promise<any> {
|
||||
return this.spectron.client.selectByValue(`${this.workbenchPanelSelector} .select-box`, type);
|
||||
try {
|
||||
return this.spectron.client.selectByValue(`${this.workbenchPanelSelector} .select-box`, type);
|
||||
} catch (e) {
|
||||
return Promise.reject(`Failed to select ${type} as workbench panel output.`);
|
||||
}
|
||||
}
|
||||
|
||||
public getOutputViewType(): Promise<any> {
|
||||
|
@ -43,10 +47,18 @@ export class Tasks {
|
|||
}
|
||||
|
||||
public getProblemsViewFirstElementName(): Promise<any> {
|
||||
return this.spectron.waitFor(this.spectron.client.getText, `${this.problemsViewSelector} .label-name`);
|
||||
try {
|
||||
return this.spectron.waitFor(this.spectron.client.getText, `${this.problemsViewSelector} .label-name`);
|
||||
} catch (e) {
|
||||
return Promise.reject('Failed to get problem label from Problems view: ' + e);
|
||||
}
|
||||
}
|
||||
|
||||
public getProblemsViewFirstElementCount(): Promise<any> {
|
||||
return this.spectron.waitFor(this.spectron.client.getText, `${this.problemsViewSelector} .monaco-count-badge`);
|
||||
try {
|
||||
return this.spectron.waitFor(this.spectron.client.getText, `${this.problemsViewSelector} .monaco-count-badge`);
|
||||
} catch (e) {
|
||||
return Promise.reject('Failed to get problem count from Problems view: ' + e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -142,7 +142,7 @@ export class SpectronApplication {
|
|||
public command(command: string, capture?: boolean): Promise<any> {
|
||||
const binding = this.keybindings.find(x => x['command'] === command);
|
||||
if (!binding) {
|
||||
throw new Error(`Key binding for ${command} was not found`);
|
||||
return Promise.reject(`Key binding for ${command} was not found.`);
|
||||
}
|
||||
|
||||
const keys: string = binding.key;
|
||||
|
|
|
@ -30,12 +30,12 @@ export function testConfigViews() {
|
|||
it('turns off editor line numbers and verifies the live change', async function () {
|
||||
await common.newUntitledFile();
|
||||
await app.wait();
|
||||
let elements = await configView.getEditorLineNumbers();
|
||||
assert.equal(elements.value.length, 1);
|
||||
let elementsCount = await configView.getEditorLineNumbers();
|
||||
assert.equal(elementsCount, 1, 'Line numbers are not present in the editor before disabling them.');
|
||||
await common.addSetting('editor.lineNumbers', 'off');
|
||||
await app.wait();
|
||||
elements = await configView.getEditorLineNumbers();
|
||||
assert.equal(elements.value.length, 0);
|
||||
elementsCount = await configView.getEditorLineNumbers();
|
||||
assert.equal(elementsCount, 0, 'Line numbers are still present in the editor after disabling them.');
|
||||
});
|
||||
|
||||
it(`changes 'workbench.action.toggleSidebarPosition' command key binding and verifies it`, async function () {
|
||||
|
@ -47,11 +47,11 @@ export function testConfigViews() {
|
|||
await configView.enterBinding(['Control', 'u', 'NULL']);
|
||||
await common.enter();
|
||||
let html = await configView.getActivityBar(ActivityBarPosition.RIGHT);
|
||||
assert.equal(html, undefined);
|
||||
assert.equal(html, undefined, 'Activity bar is positioned on the right, whereas should not be.');
|
||||
await app.wait();
|
||||
await configView.toggleActivityBarPosition();
|
||||
html = await configView.getActivityBar(ActivityBarPosition.RIGHT);
|
||||
assert.ok(html);
|
||||
assert.ok(html, 'Activity bar was not moved to right after toggling its position.');
|
||||
});
|
||||
});
|
||||
}
|
|
@ -32,7 +32,7 @@ export function testCSS() {
|
|||
await css.openQuickOutline();
|
||||
await app.wait();
|
||||
const count = await common.getQuickOpenElements();
|
||||
assert.equal(count, 2);
|
||||
assert.equal(count, 2, 'Quick outline symbol count is wrong.');
|
||||
});
|
||||
|
||||
it('verifies warnings for the empty rule', async function () {
|
||||
|
@ -40,10 +40,10 @@ export function testCSS() {
|
|||
await common.type('.foo{}');
|
||||
await app.wait();
|
||||
let warning = await css.getEditorProblem(CSSProblem.WARNING);
|
||||
assert.ok(warning);
|
||||
assert.ok(warning, `Warning squiggle is not shown in 'style.css'.`);
|
||||
await css.toggleProblemsView();
|
||||
warning = await css.getProblemsViewsProblem(CSSProblem.WARNING);
|
||||
assert.ok(warning);
|
||||
assert.ok(warning, 'Warning does not appear in Problems view.');
|
||||
});
|
||||
|
||||
it('verifies that warning becomes an error once setting changed', async function () {
|
||||
|
@ -52,10 +52,10 @@ export function testCSS() {
|
|||
await common.type('.foo{}');
|
||||
await app.wait();
|
||||
let error = await css.getEditorProblem(CSSProblem.ERROR);
|
||||
assert.ok(error);
|
||||
assert.ok(error, `Error squiggle is not shown in 'style.css'.`);
|
||||
await css.toggleProblemsView();
|
||||
error = await css.getProblemsViewsProblem(CSSProblem.ERROR);
|
||||
assert.ok(error);
|
||||
assert.ok(error, `Error does not appear in Problems view`);
|
||||
});
|
||||
});
|
||||
}
|
|
@ -40,11 +40,11 @@ export function testDataLoss() {
|
|||
await app.start();
|
||||
|
||||
// check tab presence
|
||||
assert.ok(await common.getTab(untitled));
|
||||
assert.ok(await common.getTab(fileName, true));
|
||||
assert.ok(await common.getTab(untitled), `${untitled} tab is not present after reopening.`);
|
||||
assert.ok(await common.getTab(fileName, true), `${fileName} tab is not present or is not active after reopening.`);
|
||||
// check if they marked as dirty (icon) and active tab is the last opened
|
||||
assert.ok(await dl.verifyTabIsDirty(untitled));
|
||||
assert.ok(await dl.verifyTabIsDirty(fileName, true));
|
||||
assert.ok(await dl.verifyTabIsDirty(untitled), `${untitled} tab is not dirty after reopening.`);
|
||||
assert.ok(await dl.verifyTabIsDirty(fileName, true), `${fileName} tab is not dirty after reopening.`);
|
||||
});
|
||||
|
||||
it(`verifies that contents of the dirty files are restored after 'hot exit'`, async function () {
|
||||
|
@ -65,10 +65,10 @@ export function testDataLoss() {
|
|||
|
||||
// check their contents
|
||||
let fileDirt = await common.getEditorFirstLinePlainText();
|
||||
assert.equal(fileDirt, 'Hello, Code'); // ignore '!' as it is a separate <span/>, first part is enough
|
||||
assert.equal(fileDirt, 'Hello, Code', 'Active file contents are different after restore.'); // ignore '!' as it is a separate <span/>, first part is enough
|
||||
await common.selectTab('Untitled-1');
|
||||
fileDirt = await common.getEditorFirstLinePlainText();
|
||||
assert.equal(fileDirt, textToType);
|
||||
assert.equal(fileDirt, textToType, 'Untitled file edit are different after restore.');
|
||||
});
|
||||
});
|
||||
}
|
|
@ -51,10 +51,10 @@ export function testDataMigration() {
|
|||
setupSpectron(this, LATEST_PATH);
|
||||
await app.start();
|
||||
|
||||
assert.ok(await common.getTab('Untitled-1'));
|
||||
assert.ok(await common.getTab('Untitled-1'), 'Untitled-1 tab was not restored after migration.');
|
||||
await common.selectTab('Untitled-1');
|
||||
const editorText = await common.getEditorFirstLinePlainText();
|
||||
assert.equal(editorText, textToType);
|
||||
assert.equal(editorText, textToType, 'Typed editor text does not match to the one after migration.');
|
||||
});
|
||||
|
||||
it('checks if the newly created dirty file is restored migrating from stable to latest', async function () {
|
||||
|
@ -77,10 +77,10 @@ export function testDataMigration() {
|
|||
// Checking latest version for the restored state
|
||||
setupSpectron(this, LATEST_PATH);
|
||||
await app.start();
|
||||
assert.ok(await common.getTab(fileName.split('/')[1]));
|
||||
assert.ok(await common.getTab(fileName.split('/')[1]), `${fileName} was not restored after migration.`);
|
||||
await common.selectTab(fileName.split('/')[1]);
|
||||
const editorText = await common.getEditorFirstLinePlainText();
|
||||
assert.equal(editorText, firstTextPart.concat(secondTextPart));
|
||||
assert.equal(editorText, firstTextPart.concat(secondTextPart), 'Entered text was not correctly restored after migration.');
|
||||
|
||||
// Cleanup
|
||||
await common.removeFile(`${fileName}`);
|
||||
|
@ -97,9 +97,9 @@ export function testDataMigration() {
|
|||
|
||||
setupSpectron(this, LATEST_PATH, [WORKSPACE_PATH]);
|
||||
await app.start();
|
||||
assert.ok(await common.getTab(fileName1));
|
||||
assert.ok(await common.getTab(fileName2));
|
||||
assert.ok(await common.getTab(fileName3));
|
||||
assert.ok(await common.getTab(fileName1), `${fileName1} tab was not restored after migration.`);
|
||||
assert.ok(await common.getTab(fileName2), `${fileName2} tab was not restored after migration.`);
|
||||
assert.ok(await common.getTab(fileName3), `${fileName3} tab was not restored after migration.`);
|
||||
});
|
||||
});
|
||||
}
|
|
@ -31,17 +31,17 @@ export function testGit() {
|
|||
const changesCount = await git.getScmIconChanges();
|
||||
assert.equal(changesCount, 2);
|
||||
await git.openGitViewlet();
|
||||
assert.ok(await git.verifyScmChange('app.js'));
|
||||
assert.ok(await git.verifyScmChange('launch.json'));
|
||||
assert.ok(await git.verifyScmChange('app.js'), 'app.js change does not appear in SCM viewlet.');
|
||||
assert.ok(await git.verifyScmChange('launch.json'), 'launch.json change does not appear in SCM viewlet.');
|
||||
});
|
||||
|
||||
it(`verifies 'app.js' diff viewer changes`, async function () {
|
||||
await git.openGitViewlet();
|
||||
await common.openFile('app.js');
|
||||
const original = await git.getOriginalAppJsBodyVarName();
|
||||
assert.equal(original, 'bodyParser');
|
||||
assert.equal(original, 'bodyParser', 'Original value from diff view is wrong.');
|
||||
const modified = await git.getModifiedAppJsBodyVarName();
|
||||
assert.equal(modified, 'ydobParser');
|
||||
assert.equal(modified, 'ydobParser', 'Modified value from diff view is wrong.');
|
||||
});
|
||||
|
||||
it(`stages 'app.js' changes and checks stage count`, async function () {
|
||||
|
@ -63,7 +63,7 @@ export function testGit() {
|
|||
await common.type('Test commit');
|
||||
await git.pressCommit();
|
||||
const changes = await git.getOutgoingChanges();
|
||||
assert.equal(changes, ' 0↓ 1↑');
|
||||
assert.equal(changes, ' 0↓ 1↑', 'Changes indicator is wrong in a status bar.');
|
||||
});
|
||||
});
|
||||
}
|
|
@ -34,7 +34,7 @@ export function testIntegratedTerminal() {
|
|||
await common.type(command);
|
||||
await common.enter();
|
||||
await app.wait();
|
||||
assert.ok(await terminal.commandOutputHas('test'));
|
||||
assert.ok(await terminal.commandOutputHas('test'), 'Terminal output does not contain echo.');
|
||||
});
|
||||
});
|
||||
}
|
|
@ -38,7 +38,7 @@ export function testJavaScriptDebug() {
|
|||
await common.openFirstMatchFile('index.js');
|
||||
await jsDebug.setBreakpointOnLine(6);
|
||||
const breakpoint = await jsDebug.verifyBreakpointOnLine(6);
|
||||
assert.ok(breakpoint);
|
||||
assert.ok(breakpoint, 'Breakpoint was not found on line 6.');
|
||||
});
|
||||
});
|
||||
}
|
|
@ -73,7 +73,7 @@ export function testJavaScript() {
|
|||
await common.openFirstMatchFile('app.js');
|
||||
await js.goToExpressDefinition();
|
||||
await app.wait();
|
||||
assert.ok(await common.getTab('index.d.ts'));
|
||||
assert.ok(await common.getTab('index.d.ts'), 'Tab opened when navigating to definition is not as expected.');
|
||||
});
|
||||
|
||||
it(`verifies that 'Peek Definition' works`, async function () {
|
||||
|
@ -81,7 +81,7 @@ export function testJavaScript() {
|
|||
await js.peekExpressDefinition();
|
||||
await app.wait();
|
||||
const definitionFilename = await js.getPeekExpressResultName();
|
||||
assert.equal(definitionFilename, 'index.d.ts');
|
||||
assert.equal(definitionFilename, 'index.d.ts', 'Peek result is not as expected.');
|
||||
});
|
||||
});
|
||||
}
|
|
@ -53,7 +53,7 @@ export function testSearch() {
|
|||
await s.dismissResult();
|
||||
await app.wait();
|
||||
const result = await s.getResultText();
|
||||
assert.equal(result, '3 results in 3 files');
|
||||
assert.equal(result, '3 results in 3 files', 'Result number after dismissal does not match to expected.');
|
||||
});
|
||||
|
||||
it('replaces first search result with a replace term', async function () {
|
||||
|
@ -67,7 +67,7 @@ export function testSearch() {
|
|||
await app.wait();
|
||||
await common.saveOpenedFile();
|
||||
const result = await s.getResultText();
|
||||
assert.equal(result, '3 results in 3 files');
|
||||
assert.equal(result, '3 results in 3 files', 'Result number after replacemenet does not match to expected.');
|
||||
});
|
||||
});
|
||||
}
|
|
@ -29,37 +29,37 @@ export function testStatusbar() {
|
|||
|
||||
it('verifies presence of all default status bar elements', async function () {
|
||||
await app.wait();
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.BRANCH_STATUS));
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.FEEDBACK_ICON));
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.SYNC_STATUS));
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.PROBLEMS_STATUS));
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.BRANCH_STATUS), 'Branch indicator is not visible.');
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.FEEDBACK_ICON), 'Feedback icon is not visible.');
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.SYNC_STATUS), 'Sync indicator is not visible.');
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.PROBLEMS_STATUS), 'Problems indicator is not visible.');
|
||||
|
||||
await common.openFirstMatchFile('app.js');
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.ENCODING_STATUS));
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.EOL_STATUS));
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.INDENTATION_STATUS));
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.LANGUAGE_STATUS));
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.SELECTION_STATUS));
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.ENCODING_STATUS), 'Encoding indicator is not visible.');
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.EOL_STATUS), 'EOL indicator is not visible.');
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.INDENTATION_STATUS), 'Indentation indicator is not visible.');
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.LANGUAGE_STATUS), 'Language indicator is not visible.');
|
||||
assert.ok(await statusBar.isVisible(StatusBarElement.SELECTION_STATUS), 'Selection indicator is not visible.');
|
||||
});
|
||||
|
||||
it(`verifies that 'quick open' opens when clicking on 'Branch', 'Indentation Status, 'Encoding', 'EOL' and 'Language' status elements`, async function () {
|
||||
it(`verifies that 'quick open' opens when clicking on status bar elements`, async function () {
|
||||
await app.wait();
|
||||
await statusBar.clickOn(StatusBarElement.BRANCH_STATUS);
|
||||
assert.ok(await statusBar.isQuickOpenWidgetVisible());
|
||||
assert.ok(await statusBar.isQuickOpenWidgetVisible(), 'Quick open is not opened for branch indicator.');
|
||||
await common.closeQuickOpen();
|
||||
|
||||
await common.openFirstMatchFile('app.js');
|
||||
await statusBar.clickOn(StatusBarElement.INDENTATION_STATUS);
|
||||
assert.ok(await statusBar.isQuickOpenWidgetVisible());
|
||||
assert.ok(await statusBar.isQuickOpenWidgetVisible(), 'Quick open is not opened for indentation indicator.');
|
||||
await common.closeQuickOpen();
|
||||
await statusBar.clickOn(StatusBarElement.ENCODING_STATUS);
|
||||
assert.ok(await statusBar.isQuickOpenWidgetVisible());
|
||||
assert.ok(await statusBar.isQuickOpenWidgetVisible(), 'Quick open is not opened for encoding indicator.');
|
||||
await common.closeQuickOpen();
|
||||
await statusBar.clickOn(StatusBarElement.EOL_STATUS);
|
||||
assert.ok(await statusBar.isQuickOpenWidgetVisible());
|
||||
assert.ok(await statusBar.isQuickOpenWidgetVisible(), 'Quick open is not opened for EOL indicator.');
|
||||
await common.closeQuickOpen();
|
||||
await statusBar.clickOn(StatusBarElement.LANGUAGE_STATUS);
|
||||
assert.ok(await statusBar.isQuickOpenWidgetVisible());
|
||||
assert.ok(await statusBar.isQuickOpenWidgetVisible(), 'Quick open is not opened for language indicator.');
|
||||
await common.closeQuickOpen();
|
||||
});
|
||||
|
||||
|
@ -79,7 +79,7 @@ export function testStatusbar() {
|
|||
const lineNumber = 15;
|
||||
await common.type(lineNumber.toString());
|
||||
await common.enter();
|
||||
assert.ok(await statusBar.getEditorHighlightedLine(lineNumber));
|
||||
assert.ok(await statusBar.getEditorHighlightedLine(lineNumber), 'Editor does not highlight the line.');
|
||||
});
|
||||
|
||||
it(`verifies if changing EOL is reflected in the status bar`, async function () {
|
||||
|
|
|
@ -48,9 +48,9 @@ export function testTasks() {
|
|||
await tasks.build();
|
||||
await tasks.openProblemsView();
|
||||
const problemName = await tasks.getProblemsViewFirstElementName();
|
||||
assert.equal(problemName, 'index.js');
|
||||
assert.equal(problemName, 'index.js', `'index.js' is not a build error.`);
|
||||
const problemsCount = await tasks.getProblemsViewFirstElementCount();
|
||||
assert.equal(problemsCount, '1');
|
||||
assert.equal(problemsCount, '1', `Problem count is different to expected.`);
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue