Merge from vscode 718331d6f3ebd1b571530ab499edb266ddd493d5

This commit is contained in:
ADS Merger
2020-02-08 04:50:58 +00:00
parent 8c61538a27
commit 2af13c18d2
752 changed files with 16458 additions and 10063 deletions

View File

@@ -28,9 +28,6 @@ export function setup() {
});
it('verifies that warning becomes an error once setting changed', async function () {
// settings might take a while to update?
this.timeout(40000);
const app = this.app as Application;
await app.workbench.settingsEditor.addUserSetting('css.lint.emptyRules', '"error"');
await app.workbench.quickopen.openFile('style.css');

View File

@@ -1,122 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import * as http from 'http';
import * as path from 'path';
import * as fs from 'fs';
import * as stripJsonComments from 'strip-json-comments';
import { Application } from '../../../../automation';
export function setup() {
describe('Debug', () => {
it('configure launch json', async function () {
const app = this.app as Application;
await app.workbench.debug.openDebugViewlet();
await app.workbench.quickopen.openFile('app.js');
await app.workbench.quickopen.runCommand('Debug: Open launch.json');
const launchJsonPath = path.join(app.workspacePathOrFolder, '.vscode', 'launch.json');
const content = fs.readFileSync(launchJsonPath, 'utf8');
const config = JSON.parse(stripJsonComments(content));
config.configurations[0].protocol = 'inspector';
fs.writeFileSync(launchJsonPath, JSON.stringify(config, undefined, 4), 'utf8');
// force load from disk since file events are sometimes missing
await app.workbench.quickopen.runCommand('File: Revert File');
await app.workbench.editor.waitForEditorContents('launch.json', contents => /"protocol": "inspector"/.test(contents));
assert.equal(config.configurations[0].request, 'launch');
assert.equal(config.configurations[0].type, 'node');
if (process.platform === 'win32') {
assert.equal(config.configurations[0].program, '${workspaceFolder}\\bin\\www');
} else {
assert.equal(config.configurations[0].program, '${workspaceFolder}/bin/www');
}
});
it('breakpoints', async function () {
const app = this.app as Application;
await app.workbench.quickopen.openFile('index.js');
await app.workbench.debug.setBreakpointOnLine(6);
});
let port: number;
it('start debugging', async function () {
const app = this.app as Application;
port = await app.workbench.debug.startDebugging();
await new Promise((c, e) => {
const request = http.get(`http://localhost:${port}`);
request.on('error', e);
app.workbench.debug.waitForStackFrame(sf => /index\.js$/.test(sf.name) && sf.lineNumber === 6, 'looking for index.js and line 6').then(c, e);
});
});
it('focus stack frames and variables', async function () {
const app = this.app as Application;
await app.workbench.debug.waitForVariableCount(4, 5);
await app.workbench.debug.focusStackFrame('layer.js', 'looking for layer.js');
await app.workbench.debug.waitForVariableCount(5, 6);
await app.workbench.debug.focusStackFrame('route.js', 'looking for route.js');
await app.workbench.debug.waitForVariableCount(3, 4);
await app.workbench.debug.focusStackFrame('index.js', 'looking for index.js');
await app.workbench.debug.waitForVariableCount(4, 5);
});
it('stepOver, stepIn, stepOut', async function () {
const app = this.app as Application;
await app.workbench.debug.stepIn();
const first = await app.workbench.debug.waitForStackFrame(sf => /response\.js$/.test(sf.name), 'looking for response.js');
await app.workbench.debug.stepOver();
await app.workbench.debug.waitForStackFrame(sf => /response\.js$/.test(sf.name) && sf.lineNumber === first.lineNumber + 1, `looking for response.js and line ${first.lineNumber + 1}`);
await app.workbench.debug.stepOut();
await app.workbench.debug.waitForStackFrame(sf => /index\.js$/.test(sf.name) && sf.lineNumber === 7, `looking for index.js and line 7`);
});
it('continue', async function () {
const app = this.app as Application;
await app.workbench.debug.continue();
await new Promise((c, e) => {
const request = http.get(`http://localhost:${port}`);
request.on('error', e);
app.workbench.debug.waitForStackFrame(sf => /index\.js$/.test(sf.name) && sf.lineNumber === 6, `looking for index.js and line 6`).then(c, e);
});
});
it('debug console', async function () {
const app = this.app as Application;
await app.workbench.debug.waitForReplCommand('2 + 2', r => r === '4');
});
it('debug console link', async function () {
const app = this.app as Application;
await app.workbench.debug.waitForReplCommand('"./app.js:5:1"', r => r.includes('app.js'));
await app.workbench.debug.waitForLink();
});
it('stop debugging', async function () {
const app = this.app as Application;
await app.workbench.debug.stopDebugging();
});
});
}

View File

@@ -1,80 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as cp from 'child_process';
import { Application } from '../../../../automation';
const DIFF_EDITOR_LINE_INSERT = '.monaco-diff-editor .editor.modified .line-insert';
const SYNC_STATUSBAR = 'div[id="workbench.parts.statusbar"] .statusbar-item[title$="Synchronize Changes"]';
export function setup() {
describe('Git', () => {
before(async function () {
const app = this.app as Application;
cp.execSync('git config user.name testuser', { cwd: app.workspacePathOrFolder });
cp.execSync('git config user.email monacotools@microsoft.com', { cwd: app.workspacePathOrFolder });
});
it('reflects working tree changes', async function () {
const app = this.app as Application;
await app.workbench.scm.openSCMViewlet();
await app.workbench.quickopen.openFile('app.js');
await app.workbench.editor.waitForTypeInEditor('app.js', '.foo{}');
await app.workbench.editors.saveOpenedFile();
await app.workbench.quickopen.openFile('index.pug');
await app.workbench.editor.waitForTypeInEditor('index.pug', 'hello world');
await app.workbench.editors.saveOpenedFile();
await app.workbench.scm.refreshSCMViewlet();
await app.workbench.scm.waitForChange('app.js', 'Modified');
await app.workbench.scm.waitForChange('index.pug', 'Modified');
});
it('opens diff editor', async function () {
const app = this.app as Application;
await app.workbench.scm.openSCMViewlet();
await app.workbench.scm.openChange('app.js');
await app.code.waitForElement(DIFF_EDITOR_LINE_INSERT);
});
it('stages correctly', async function () {
const app = this.app as Application;
await app.workbench.scm.openSCMViewlet();
await app.workbench.scm.waitForChange('app.js', 'Modified');
await app.workbench.scm.stage('app.js');
await app.workbench.scm.openChange('app.js');
await new Promise(c => setTimeout(c, 1000));
await app.workbench.scm.unstage('app.js');
});
it(`stages, commits changes and verifies outgoing change`, async function () {
const app = this.app as Application;
await app.workbench.scm.openSCMViewlet();
await app.workbench.scm.waitForChange('app.js', 'Modified');
await app.workbench.scm.openChange('app.js');
await app.workbench.scm.stage('app.js');
await app.workbench.scm.commit('first commit');
await app.code.waitForTextContent(SYNC_STATUSBAR, ' 0↓ 1↑');
await app.workbench.quickopen.runCommand('Git: Stage All Changes');
await app.workbench.scm.waitForChange('index.pug', 'Index Modified');
await app.workbench.scm.commit('second commit');
await app.code.waitForTextContent(SYNC_STATUSBAR, ' 0↓ 2↑');
cp.execSync('git reset --hard origin/master', { cwd: app.workspacePathOrFolder });
});
});
}

View File

@@ -12,7 +12,7 @@ export function setup() {
await app.workbench.editors.newUntitledFile();
const untitled = 'Untitled-1';
const textToTypeInUntitled = 'Hello, Untitled Code';
const textToTypeInUntitled = 'Hello from Untitled';
await app.workbench.editor.waitForTypeInEditor(untitled, textToTypeInUntitled);
const readmeMd = 'readme.md';
@@ -25,8 +25,8 @@ export function setup() {
await app.workbench.editors.waitForActiveTab(readmeMd, true);
await app.workbench.editor.waitForEditorContents(readmeMd, c => c.indexOf(textToType) > -1);
await app.workbench.editors.waitForTab(untitled, true);
await app.workbench.editors.selectTab(untitled, true);
await app.workbench.editors.waitForTab(untitled);
await app.workbench.editors.selectTab(untitled);
await app.workbench.editor.waitForEditorContents(untitled, c => c.indexOf(textToTypeInUntitled) > -1);
});
});

View File

@@ -8,7 +8,6 @@ import { join } from 'path';
export function setup(stableCodePath: string, testDataPath: string) {
describe('Data Migration: This test MUST run before releasing by providing the --stable-build command line argument', () => {
it(`verifies opened editors are restored`, async function () {
if (!stableCodePath) {
@@ -66,7 +65,7 @@ export function setup(stableCodePath: string, testDataPath: string) {
await stableApp.workbench.editors.newUntitledFile();
const untitled = 'Untitled-1';
const textToTypeInUntitled = 'Hello, Untitled Code';
const textToTypeInUntitled = 'Hello from Untitled';
await stableApp.workbench.editor.waitForTypeInEditor(untitled, textToTypeInUntitled);
const readmeMd = 'readme.md';
@@ -86,7 +85,7 @@ export function setup(stableCodePath: string, testDataPath: string) {
await insidersApp.workbench.editor.waitForEditorContents(readmeMd, c => c.indexOf(textToType) > -1);
await insidersApp.workbench.editors.waitForTab(untitled, true);
await insidersApp.workbench.editors.selectTab(untitled, true);
await insidersApp.workbench.editors.selectTab(untitled);
await insidersApp.workbench.editor.waitForEditorContents(untitled, c => c.indexOf(textToTypeInUntitled) > -1);
await insidersApp.stop();