From 4fe77bc3425da2f7d3cf906c1ef950989ed02982 Mon Sep 17 00:00:00 2001 From: Joao Date: Mon, 4 Sep 2017 15:23:20 +0200 Subject: [PATCH] smoke: omit warnings, clean imports --- test/smoke/src/areas/css/css.test.ts | 87 +++++++++---------- .../smoke/src/areas/explorer/explorer.test.ts | 39 ++++----- .../src/areas/extensions/extensions.test.ts | 39 ++++----- .../src/areas/multiroot/multiroot.test.ts | 33 ++++--- .../src/areas/preferences/keybindings.test.ts | 32 +++---- .../src/areas/preferences/settings.test.ts | 37 ++++---- test/smoke/src/areas/search/search.test.ts | 87 +++++++++---------- .../src/areas/workbench/data-loss.test.ts | 71 ++++++++------- test/smoke/src/test.ts | 50 ++++++----- 9 files changed, 228 insertions(+), 247 deletions(-) diff --git a/test/smoke/src/areas/css/css.test.ts b/test/smoke/src/areas/css/css.test.ts index 6514621e4b3f8..64c900ec13774 100644 --- a/test/smoke/src/areas/css/css.test.ts +++ b/test/smoke/src/areas/css/css.test.ts @@ -4,54 +4,51 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; - import { SpectronApplication, LATEST_PATH, WORKSPACE_PATH } from '../../spectron/application'; import { ProblemSeverity, Problems } from '../problems/problems'; import { QuickOutline } from '../editor/quickoutline'; import { SettingsEditor } from '../preferences/settings'; -export function testCSS() { - describe('CSS', () => { - let app: SpectronApplication = new SpectronApplication(LATEST_PATH, '', 0, [WORKSPACE_PATH]); - before(() => app.start()); - after(() => app.stop()); - - it('verifies quick outline', async function () { - await app.workbench.quickopen.openFile('style.css'); - const outline = new QuickOutline(app); - await outline.openSymbols(); - const elements = await app.client.waitForElements(QuickOutline.QUICK_OPEN_ENTRY_SELECTOR, elements => elements.length === 2); - assert.ok(elements, `Did not find two outline elements`); - }); - - it('verifies warnings for the empty rule', async function () { - await app.workbench.quickopen.openFile('style.css'); - await app.client.waitForElement(`.monaco-editor.focused`); - await app.type('.foo{}'); - - let warning = await app.client.waitForElement(Problems.getSelectorInEditor(ProblemSeverity.WARNING)); - assert.ok(warning, `Warning squiggle is not shown in 'style.css'.`); - - const problems = new Problems(app); - await problems.showProblemsView(); - warning = await app.client.waitForElement(Problems.getSelectorInProblemsView(ProblemSeverity.WARNING)); - assert.ok(warning, 'Warning does not appear in Problems view.'); - await problems.hideProblemsView(); - }); - - it('verifies that warning becomes an error once setting changed', async function () { - await new SettingsEditor(app).addUserSetting('css.lint.emptyRules', '"error"'); - await app.workbench.quickopen.openFile('style.css'); - await app.type('.foo{}'); - - let error = await app.client.waitForElement(Problems.getSelectorInEditor(ProblemSeverity.ERROR)); - assert.ok(error, `Warning squiggle is not shown in 'style.css'.`); - - const problems = new Problems(app); - await problems.showProblemsView(); - error = await app.client.waitForElement(Problems.getSelectorInProblemsView(ProblemSeverity.ERROR)); - assert.ok(error, 'Warning does not appear in Problems view.'); - await problems.hideProblemsView(); - }); +describe('CSS', () => { + let app: SpectronApplication = new SpectronApplication(LATEST_PATH, '', 0, [WORKSPACE_PATH]); + before(() => app.start()); + after(() => app.stop()); + + it('verifies quick outline', async function () { + await app.workbench.quickopen.openFile('style.css'); + const outline = new QuickOutline(app); + await outline.openSymbols(); + const elements = await app.client.waitForElements(QuickOutline.QUICK_OPEN_ENTRY_SELECTOR, elements => elements.length === 2); + assert.ok(elements, `Did not find two outline elements`); + }); + + it('verifies warnings for the empty rule', async function () { + await app.workbench.quickopen.openFile('style.css'); + await app.client.waitForElement(`.monaco-editor.focused`); + await app.type('.foo{}'); + + let warning = await app.client.waitForElement(Problems.getSelectorInEditor(ProblemSeverity.WARNING)); + assert.ok(warning, `Warning squiggle is not shown in 'style.css'.`); + + const problems = new Problems(app); + await problems.showProblemsView(); + warning = await app.client.waitForElement(Problems.getSelectorInProblemsView(ProblemSeverity.WARNING)); + assert.ok(warning, 'Warning does not appear in Problems view.'); + await problems.hideProblemsView(); + }); + + it('verifies that warning becomes an error once setting changed', async function () { + await new SettingsEditor(app).addUserSetting('css.lint.emptyRules', '"error"'); + await app.workbench.quickopen.openFile('style.css'); + await app.type('.foo{}'); + + let error = await app.client.waitForElement(Problems.getSelectorInEditor(ProblemSeverity.ERROR)); + assert.ok(error, `Warning squiggle is not shown in 'style.css'.`); + + const problems = new Problems(app); + await problems.showProblemsView(); + error = await app.client.waitForElement(Problems.getSelectorInProblemsView(ProblemSeverity.ERROR)); + assert.ok(error, 'Warning does not appear in Problems view.'); + await problems.hideProblemsView(); }); -} \ No newline at end of file +}); \ No newline at end of file diff --git a/test/smoke/src/areas/explorer/explorer.test.ts b/test/smoke/src/areas/explorer/explorer.test.ts index af73ca495dbcd..06ca12b88de6a 100644 --- a/test/smoke/src/areas/explorer/explorer.test.ts +++ b/test/smoke/src/areas/explorer/explorer.test.ts @@ -4,32 +4,29 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; - import { SpectronApplication, LATEST_PATH, WORKSPACE_PATH } from '../../spectron/application'; -export function testExplorer() { - describe('Explorer', () => { - let app: SpectronApplication = new SpectronApplication(LATEST_PATH, '', 0, [WORKSPACE_PATH]); - before(() => app.start()); - after(() => app.stop()); +describe('Explorer', () => { + let app: SpectronApplication = new SpectronApplication(LATEST_PATH, '', 0, [WORKSPACE_PATH]); + before(() => app.start()); + after(() => app.stop()); - it('quick open search produces correct result', async function () { - await app.workbench.quickopen.openQuickOpen(); - await app.client.type('.js'); - const elements = await app.workbench.quickopen.getQuickOpenElements(); - await app.client.keys(['Escape', 'NULL']); + it('quick open search produces correct result', async function () { + await app.workbench.quickopen.openQuickOpen(); + await app.client.type('.js'); + const elements = await app.workbench.quickopen.getQuickOpenElements(); + await app.client.keys(['Escape', 'NULL']); - assert.equal(elements.length, 7, 'There are 7 elements in quick open'); - }); + assert.equal(elements.length, 7, 'There are 7 elements in quick open'); + }); - it('quick open respects fuzzy matching', async function () { - await app.workbench.quickopen.openQuickOpen(); - await app.client.type('a.s'); + it('quick open respects fuzzy matching', async function () { + await app.workbench.quickopen.openQuickOpen(); + await app.client.type('a.s'); - const elements = await app.workbench.quickopen.getQuickOpenElements(); - await app.client.keys(['Escape', 'NULL']); + const elements = await app.workbench.quickopen.getQuickOpenElements(); + await app.client.keys(['Escape', 'NULL']); - assert.equal(elements.length, 3, 'There are 3 elements in quick open'); - }); + assert.equal(elements.length, 3, 'There are 3 elements in quick open'); }); -} \ No newline at end of file +}); \ No newline at end of file diff --git a/test/smoke/src/areas/extensions/extensions.test.ts b/test/smoke/src/areas/extensions/extensions.test.ts index 755f9725066b8..0d5faccddd27b 100644 --- a/test/smoke/src/areas/extensions/extensions.test.ts +++ b/test/smoke/src/areas/extensions/extensions.test.ts @@ -4,34 +4,29 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; - import { SpectronApplication, LATEST_PATH, WORKSPACE_PATH } from '../../spectron/application'; -export function testExtensions() { - - describe('Extensions', () => { - let app: SpectronApplication = new SpectronApplication(LATEST_PATH, '', 0, [WORKSPACE_PATH]); - before(() => app.start()); - after(() => app.stop()); - - // this used to run before each test - // await Util.rimraf(EXTENSIONS_DIR); +describe('Extensions', () => { + let app: SpectronApplication = new SpectronApplication(LATEST_PATH, '', 0, [WORKSPACE_PATH]); + before(() => app.start()); + after(() => app.stop()); - it(`install and activate vscode-smoketest-check extension`, async function () { - const extensionName = 'vscode-smoketest-check'; - await app.workbench.extensions.openExtensionsViewlet(); + // this used to run before each test + // await Util.rimraf(EXTENSIONS_DIR); - const installed = await app.workbench.extensions.installExtension(extensionName); + it(`install and activate vscode-smoketest-check extension`, async function () { + const extensionName = 'vscode-smoketest-check'; + await app.workbench.extensions.openExtensionsViewlet(); - assert.ok(installed); + const installed = await app.workbench.extensions.installExtension(extensionName); - await app.reload(); - await app.workbench.extensions.waitForExtensionsViewlet(); - await app.workbench.commandPallette.runCommand('Smoke Test Check'); + assert.ok(installed); - const statusbarText = await app.client.waitForText('.statusbar-item.statusbar-entry span[title="smoke test"]'); - assert.equal(statusbarText, 'VS Code Smoke Test Check'); - }); + await app.reload(); + await app.workbench.extensions.waitForExtensionsViewlet(); + await app.workbench.commandPallette.runCommand('Smoke Test Check'); + const statusbarText = await app.client.waitForText('.statusbar-item.statusbar-entry span[title="smoke test"]'); + assert.equal(statusbarText, 'VS Code Smoke Test Check'); }); -} +}); \ No newline at end of file diff --git a/test/smoke/src/areas/multiroot/multiroot.test.ts b/test/smoke/src/areas/multiroot/multiroot.test.ts index 33f281f7e18a0..9ec52705459e4 100644 --- a/test/smoke/src/areas/multiroot/multiroot.test.ts +++ b/test/smoke/src/areas/multiroot/multiroot.test.ts @@ -4,28 +4,25 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; - import { SpectronApplication, LATEST_PATH, CODE_WORKSPACE_PATH } from '../../spectron/application'; import { QuickOpen } from '../quickopen/quickopen'; import { Window } from '../window'; -export function testMultiRoot() { - describe('Multi Root', () => { - let app: SpectronApplication = new SpectronApplication(LATEST_PATH, '', 0, [CODE_WORKSPACE_PATH]); - before(() => app.start()); - after(() => app.stop()); +describe('Multi Root', () => { + let app: SpectronApplication = new SpectronApplication(LATEST_PATH, '', 0, [CODE_WORKSPACE_PATH]); + before(() => app.start()); + after(() => app.stop()); - it('shows results from all folders', async function () { - let quickOpen = new QuickOpen(app); - await quickOpen.openQuickOpen(); - await app.type('*.*'); - const elements = await quickOpen.getQuickOpenElements(); - assert.equal(elements.length, 6); - }); + it('shows results from all folders', async function () { + let quickOpen = new QuickOpen(app); + await quickOpen.openQuickOpen(); + await app.type('*.*'); + const elements = await quickOpen.getQuickOpenElements(); + assert.equal(elements.length, 6); + }); - it('shows workspace name in title', async function () { - const title = await new Window(app).getTitle(); - assert.ok(title.indexOf('smoketest (Workspace)') >= 0); - }); + it('shows workspace name in title', async function () { + const title = await new Window(app).getTitle(); + assert.ok(title.indexOf('smoketest (Workspace)') >= 0); }); -} \ No newline at end of file +}); \ No newline at end of file diff --git a/test/smoke/src/areas/preferences/keybindings.test.ts b/test/smoke/src/areas/preferences/keybindings.test.ts index 7560b087f81d5..103e87fffb368 100644 --- a/test/smoke/src/areas/preferences/keybindings.test.ts +++ b/test/smoke/src/areas/preferences/keybindings.test.ts @@ -4,29 +4,25 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; - import { SpectronApplication, LATEST_PATH, WORKSPACE_PATH } from '../../spectron/application'; import { ActivityBarPosition } from '../../areas/activitybar/activityBar'; import { KeybindingsEditor } from './keybindings'; -export function testKeybindings() { - - describe('Keybindings Customisation', () => { - let app: SpectronApplication = new SpectronApplication(LATEST_PATH, '', 0, [WORKSPACE_PATH]); - before(() => app.start()); - after(() => app.stop()); +describe('Keybindings Customisation', () => { + let app: SpectronApplication = new SpectronApplication(LATEST_PATH, '', 0, [WORKSPACE_PATH]); + before(() => app.start()); + after(() => app.stop()); - it(`changes 'workbench.action.toggleSidebarPosition' command key binding and verifies it`, async function () { - let activityBarElement = await app.workbench.activitybar.getActivityBar(ActivityBarPosition.LEFT); - assert.ok(activityBarElement, 'Activity bar should be positioned on the left.'); + it(`changes 'workbench.action.toggleSidebarPosition' command key binding and verifies it`, async function () { + let activityBarElement = await app.workbench.activitybar.getActivityBar(ActivityBarPosition.LEFT); + assert.ok(activityBarElement, 'Activity bar should be positioned on the left.'); - const keybindingsEditor = new KeybindingsEditor(app); - await keybindingsEditor.openKeybindings(); - await keybindingsEditor.updateKeybinding('workbench.action.toggleSidebarPosition', ['Control', 'u', 'NULL'], 'Control+U'); + const keybindingsEditor = new KeybindingsEditor(app); + await keybindingsEditor.openKeybindings(); + await keybindingsEditor.updateKeybinding('workbench.action.toggleSidebarPosition', ['Control', 'u', 'NULL'], 'Control+U'); - await app.client.keys(['Control', 'u', 'NULL']); - activityBarElement = await app.workbench.activitybar.getActivityBar(ActivityBarPosition.RIGHT); - assert.ok(activityBarElement, 'Activity bar was not moved to right after toggling its position.'); - }); + await app.client.keys(['Control', 'u', 'NULL']); + activityBarElement = await app.workbench.activitybar.getActivityBar(ActivityBarPosition.RIGHT); + assert.ok(activityBarElement, 'Activity bar was not moved to right after toggling its position.'); }); -} \ No newline at end of file +}); \ No newline at end of file diff --git a/test/smoke/src/areas/preferences/settings.test.ts b/test/smoke/src/areas/preferences/settings.test.ts index 5139a1acc55b5..2df0eec1ecc59 100644 --- a/test/smoke/src/areas/preferences/settings.test.ts +++ b/test/smoke/src/areas/preferences/settings.test.ts @@ -4,30 +4,27 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; - import { SpectronApplication, LATEST_PATH, WORKSPACE_PATH } from '../../spectron/application'; import { SettingsEditor } from './settings'; -export function testSettings() { - describe('Settings Customisation', () => { - let app: SpectronApplication = new SpectronApplication(LATEST_PATH, '', 0, [WORKSPACE_PATH]); - before(() => app.start()); - after(() => app.stop()); +describe('Settings Customisation', () => { + let app: SpectronApplication = new SpectronApplication(LATEST_PATH, '', 0, [WORKSPACE_PATH]); + before(() => app.start()); + after(() => app.stop()); - it('turns off editor line numbers and verifies the live change', async function () { - await app.workbench.explorer.openFile('app.js'); - let lineNumbers = await app.client.waitForElements('.line-numbers'); - assert.ok(!!lineNumbers.length, 'Line numbers are not present in the editor before disabling them.'); + it('turns off editor line numbers and verifies the live change', async function () { + await app.workbench.explorer.openFile('app.js'); + let lineNumbers = await app.client.waitForElements('.line-numbers'); + assert.ok(!!lineNumbers.length, 'Line numbers are not present in the editor before disabling them.'); - const settingsEditor = new SettingsEditor(app); - await settingsEditor.openUserSettings(); - await settingsEditor.focusEditableSettings(); - await app.client.keys(`"editor.lineNumbers": "off"`); - await app.workbench.saveOpenedFile(); + const settingsEditor = new SettingsEditor(app); + await settingsEditor.openUserSettings(); + await settingsEditor.focusEditableSettings(); + await app.client.keys(`"editor.lineNumbers": "off"`); + await app.workbench.saveOpenedFile(); - await app.workbench.selectTab('app.js'); - lineNumbers = await app.client.waitForElements('.line-numbers', result => !result || result.length === 0); - assert.ok(!lineNumbers.length, 'Line numbers are still present in the editor after disabling them.'); - }); + await app.workbench.selectTab('app.js'); + lineNumbers = await app.client.waitForElements('.line-numbers', result => !result || result.length === 0); + assert.ok(!lineNumbers.length, 'Line numbers are still present in the editor after disabling them.'); }); -} \ No newline at end of file +}); \ No newline at end of file diff --git a/test/smoke/src/areas/search/search.test.ts b/test/smoke/src/areas/search/search.test.ts index 61ecca931d438..52b3f448d38b4 100644 --- a/test/smoke/src/areas/search/search.test.ts +++ b/test/smoke/src/areas/search/search.test.ts @@ -4,51 +4,48 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; - import { SpectronApplication, LATEST_PATH, WORKSPACE_PATH } from '../../spectron/application'; -export function testSearch() { - describe('Search', () => { - let app: SpectronApplication = new SpectronApplication(LATEST_PATH, '', 0, [WORKSPACE_PATH]); - before(() => app.start()); - after(() => app.stop()); - - it('searches for body & checks for correct result number', async function () { - await app.workbench.search.openSearchViewlet(); - await app.workbench.search.searchFor('body'); - const result = await app.workbench.search.getResultText(); - assert.equal(result, '7 results in 4 files'); - }); - - it('searches only for *.js files & checks for correct result number', async function () { - await app.workbench.search.openSearchViewlet(); - await app.workbench.search.searchFor('body'); - await app.workbench.search.setFilesToIncludeTextAndSearch('*.js'); - - const results = await app.workbench.search.getResultText(); - assert.equal(results, '4 results in 1 file'); - }); - - it('dismisses result & checks for correct result number', async function () { - await app.workbench.search.openSearchViewlet(); - await app.workbench.search.searchFor('body'); - - await app.workbench.search.removeFileMatch(1); - - const result = await app.workbench.search.getResultText(); - 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 () { - await app.workbench.search.openSearchViewlet(); - await app.workbench.search.searchFor('body'); - - await app.workbench.search.setReplaceText('ydob'); - await app.workbench.search.replaceFileMatch(1); - await app.workbench.saveOpenedFile(); - - const result = await app.workbench.search.getResultText(); - assert.equal(result, '3 results in 3 files', 'Result number after replacemenet does not match to expected.'); - }); +describe('Search', () => { + let app: SpectronApplication = new SpectronApplication(LATEST_PATH, '', 0, [WORKSPACE_PATH]); + before(() => app.start()); + after(() => app.stop()); + + it('searches for body & checks for correct result number', async function () { + await app.workbench.search.openSearchViewlet(); + await app.workbench.search.searchFor('body'); + const result = await app.workbench.search.getResultText(); + assert.equal(result, '7 results in 4 files'); + }); + + it('searches only for *.js files & checks for correct result number', async function () { + await app.workbench.search.openSearchViewlet(); + await app.workbench.search.searchFor('body'); + await app.workbench.search.setFilesToIncludeTextAndSearch('*.js'); + + const results = await app.workbench.search.getResultText(); + assert.equal(results, '4 results in 1 file'); + }); + + it('dismisses result & checks for correct result number', async function () { + await app.workbench.search.openSearchViewlet(); + await app.workbench.search.searchFor('body'); + + await app.workbench.search.removeFileMatch(1); + + const result = await app.workbench.search.getResultText(); + 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 () { + await app.workbench.search.openSearchViewlet(); + await app.workbench.search.searchFor('body'); + + await app.workbench.search.setReplaceText('ydob'); + await app.workbench.search.replaceFileMatch(1); + await app.workbench.saveOpenedFile(); + + const result = await app.workbench.search.getResultText(); + assert.equal(result, '3 results in 3 files', 'Result number after replacemenet does not match to expected.'); }); -} \ No newline at end of file +}); \ No newline at end of file diff --git a/test/smoke/src/areas/workbench/data-loss.test.ts b/test/smoke/src/areas/workbench/data-loss.test.ts index 4436c3d201d80..c43bf3f3229f8 100644 --- a/test/smoke/src/areas/workbench/data-loss.test.ts +++ b/test/smoke/src/areas/workbench/data-loss.test.ts @@ -4,53 +4,50 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; - import { SpectronApplication, USER_DIR, LATEST_PATH, WORKSPACE_PATH } from '../../spectron/application'; -export function testDataLoss() { - describe('Data Loss', () => { - let app: SpectronApplication = new SpectronApplication(LATEST_PATH, '', 0, [WORKSPACE_PATH], [`--user-data-dir=${USER_DIR}`]); - before(() => app.start()); - after(() => app.stop()); +describe('Data Loss', () => { + let app: SpectronApplication = new SpectronApplication(LATEST_PATH, '', 0, [WORKSPACE_PATH], [`--user-data-dir=${USER_DIR}`]); + before(() => app.start()); + after(() => app.stop()); - // this used to run before each test - // await Util.rimraf(USER_DIR); + // this used to run before each test + // await Util.rimraf(USER_DIR); - it(`verifies that 'hot exit' works for dirty files`, async function () { - const textToType = 'Hello, Code', fileName = 'readme.md', untitled = 'Untitled-1'; - await app.workbench.newUntitledFile(); - await app.client.type(textToType); - await app.workbench.explorer.openFile(fileName); - await app.client.type(textToType); + it(`verifies that 'hot exit' works for dirty files`, async function () { + const textToType = 'Hello, Code', fileName = 'readme.md', untitled = 'Untitled-1'; + await app.workbench.newUntitledFile(); + await app.client.type(textToType); + await app.workbench.explorer.openFile(fileName); + await app.client.type(textToType); - await app.reload(); + await app.reload(); - // check tab presence - assert.ok(await app.workbench.waitForOpen(untitled, true), `${untitled} tab is not present after reopening.`); - assert.ok(await app.workbench.waitForActiveOpen(fileName, true), `${fileName} tab is not present or is not active after reopening.`); - }); + // check tab presence + assert.ok(await app.workbench.waitForOpen(untitled, true), `${untitled} tab is not present after reopening.`); + assert.ok(await app.workbench.waitForActiveOpen(fileName, true), `${fileName} tab is not present or is not active after reopening.`); + }); - it(`verifies that contents of the dirty files are restored after 'hot exit'`, async function () { - // make one dirty file, - // create one untitled file - const textToType = 'Hello, Code'; + it(`verifies that contents of the dirty files are restored after 'hot exit'`, async function () { + // make one dirty file, + // create one untitled file + const textToType = 'Hello, Code'; - // create one untitled file - await app.workbench.newUntitledFile(); - await app.client.type(textToType); + // create one untitled file + await app.workbench.newUntitledFile(); + await app.client.type(textToType); - // make one dirty file, - await app.workbench.explorer.openFile('readme.md'); - await app.client.type(textToType); + // make one dirty file, + await app.workbench.explorer.openFile('readme.md'); + await app.client.type(textToType); - await app.reload(); + await app.reload(); - await app.workbench.selectTab('readme.md'); - let actual = await app.workbench.editor.getEditorFirstLineText(); - assert.ok(actual.startsWith(textToType), `${actual} did not start with ${textToType}`); + await app.workbench.selectTab('readme.md'); + let actual = await app.workbench.editor.getEditorFirstLineText(); + assert.ok(actual.startsWith(textToType), `${actual} did not start with ${textToType}`); - actual = await app.workbench.editor.getEditorFirstLineText(); - assert.ok(actual.startsWith(textToType), `${actual} did not start with ${textToType}`); - }); + actual = await app.workbench.editor.getEditorFirstLineText(); + assert.ok(actual.startsWith(textToType), `${actual} did not start with ${textToType}`); }); -} \ No newline at end of file +}); \ No newline at end of file diff --git a/test/smoke/src/test.ts b/test/smoke/src/test.ts index 14dcb928d09fc..ebe74f44269bf 100644 --- a/test/smoke/src/test.ts +++ b/test/smoke/src/test.ts @@ -3,25 +3,33 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { testSettings } from './areas/preferences/settings.test'; -import { testKeybindings } from './areas/preferences/keybindings.test'; -import { testCSS } from './areas/css/css.test'; -import { testExplorer } from './areas/explorer/explorer.test'; -import { testMultiRoot } from './areas/multiroot/multiroot.test'; -import { testExtensions } from './areas/extensions/extensions.test'; -import { testSearch } from './areas/search/search.test'; -import { testDataLoss } from './areas/workbench/data-loss.test'; -// import { testDataMigration } from './areas/workbench/data-migration.test'; +/** + * WebDriverIO 4.8.0 outputs all kinds of "deprecation" warnings + * for common commands like `keys` and `moveToObject`. + * According to https://github.com/Codeception/CodeceptJS/issues/531, + * these deprecation warnings are for Firefox, and have no alternative replacements. + * Since we can't downgrade WDIO as suggested (it's Spectron's dep, not ours), + * we must suppress the warning with a classic monkey-patch. + * + * @see webdriverio/lib/helpers/depcrecationWarning.js + * @see https://github.com/webdriverio/webdriverio/issues/2076 + */ +// Filter out the following messages: +const wdioDeprecationWarning = /^WARNING: the "\w+" command will be depcrecated soon./; // [sic] +// Monkey patch: +const warn = console.warn; +console.warn = function suppressWebdriverWarnings(message) { + if (wdioDeprecationWarning.test(message)) { return; } + warn.apply(console, arguments); +}; -describe('Smoke:', () => { - - testCSS(); - testExplorer(); - testSettings(); - testKeybindings(); - testMultiRoot(); - testExtensions(); - testSearch(); - testDataLoss(); - // testDataMigration(); -}); \ No newline at end of file +import './areas/css/css.test'; +import './areas/explorer/explorer.test'; +import './areas/preferences/settings.test'; +import './areas/preferences/keybindings.test'; +import './areas/multiroot/multiroot.test'; +import './areas/extensions/extensions.test'; +import './areas/search/search.test'; +import './areas/workbench/data-loss.test'; +// import './areas/workbench/data-migration.test'; + // testDataMigration(); \ No newline at end of file