Skip to content

Commit 04cb861

Browse files
committed
remove screenCapturer
1 parent 6ec806c commit 04cb861

14 files changed

Lines changed: 1 addition & 136 deletions

File tree

test/smoke/src/api.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { ScreenCapturer } from './helpers/screenshot';
76
import { Driver, Element } from './driver';
87

98
export class API {
@@ -15,7 +14,6 @@ export class API {
1514

1615
constructor(
1716
private driver: Driver,
18-
private screenCapturer: ScreenCapturer,
1917
waitTime: number
2018
) {
2119
this.retryCount = (waitTime * 1000) / this.retryDuration;
@@ -99,7 +97,6 @@ export class API {
9997

10098
while (true) {
10199
if (trial > retryCount) {
102-
await this.screenCapturer.capture('timeout');
103100
throw new Error(`${timeoutMessage}: Timed out after ${(retryCount * this.retryDuration) / 1000} seconds.`);
104101
}
105102

test/smoke/src/application.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { API } from './api';
7-
import { ScreenCapturer } from './helpers/screenshot';
87
import { Workbench } from './areas/workbench/workbench';
98
import * as fs from 'fs';
109
import * as cp from 'child_process';
@@ -36,7 +35,6 @@ export class SpectronApplication {
3635

3736
private _api: API;
3837
private _workbench: Workbench;
39-
private _screenCapturer: ScreenCapturer;
4038
private codeInstance: Code | undefined;
4139
private keybindings: any[];
4240
private stopLogCollection: (() => Promise<void>) | undefined;
@@ -53,10 +51,6 @@ export class SpectronApplication {
5351
return this._api;
5452
}
5553

56-
get screenCapturer(): ScreenCapturer {
57-
return this._screenCapturer;
58-
}
59-
6054
get workbench(): Workbench {
6155
return this._workbench;
6256
}
@@ -81,7 +75,6 @@ export class SpectronApplication {
8175

8276
set suiteName(suiteName: string) {
8377
this._suiteName = suiteName;
84-
this._screenCapturer.suiteName = suiteName;
8578
}
8679

8780
async start(waitForWelcome: boolean = true): Promise<any> {
@@ -135,10 +128,8 @@ export class SpectronApplication {
135128
verbose: this.options.verbose
136129
});
137130

138-
this._screenCapturer = new ScreenCapturer(null as any, this._suiteName, '');
139-
140131
const driver = new CodeDriver(this.codeInstance.driver, this.options.verbose);
141-
this._api = new API(driver, this.screenCapturer, this.options.waitTime);
132+
this._api = new API(driver, this.options.waitTime);
142133
this._workbench = new Workbench(this._api, this.keybindings, this.userDataPath);
143134
}
144135

test/smoke/src/areas/css/css.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ export function setup() {
2626
await app.workbench.editor.waitForTypeInEditor('style.css', '.foo{}');
2727

2828
await app.api.waitForElement(Problems.getSelectorInEditor(ProblemSeverity.WARNING));
29-
await app.screenCapturer.capture('CSS Warning in editor');
3029

3130
await app.workbench.problems.showProblemsView();
3231
await app.api.waitForElement(Problems.getSelectorInProblemsView(ProblemSeverity.WARNING));
33-
await app.screenCapturer.capture('CSS Warning in problems view');
3432
await app.workbench.problems.hideProblemsView();
3533
});
3634

@@ -41,12 +39,10 @@ export function setup() {
4139
await app.workbench.editor.waitForTypeInEditor('style.css', '.foo{}');
4240

4341
await app.api.waitForElement(Problems.getSelectorInEditor(ProblemSeverity.ERROR));
44-
await app.screenCapturer.capture('CSS Error in editor');
4542

4643
const problems = new Problems(app.api, app.workbench);
4744
await problems.showProblemsView();
4845
await app.api.waitForElement(Problems.getSelectorInProblemsView(ProblemSeverity.ERROR));
49-
await app.screenCapturer.capture('CSS Error in probles view');
5046
await problems.hideProblemsView();
5147
});
5248
});

test/smoke/src/areas/debug/debug.test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export function setup() {
3131
fs.writeFileSync(launchJsonPath, JSON.stringify(config, undefined, 4), 'utf8');
3232

3333
await app.workbench.editor.waitForEditorContents('launch.json', contents => /"protocol": "inspector"/.test(contents));
34-
await app.screenCapturer.capture('launch.json file');
3534

3635
assert.equal(config.configurations[0].request, 'launch');
3736
assert.equal(config.configurations[0].type, 'node');
@@ -47,7 +46,6 @@ export function setup() {
4746

4847
await app.workbench.quickopen.openFile('index.js');
4948
await app.workbench.debug.setBreakpointOnLine(6);
50-
await app.screenCapturer.capture('breakpoints are set');
5149
});
5250

5351
let port: number;
@@ -58,15 +56,12 @@ export function setup() {
5856
await new Promise(c => setTimeout(c, 100));
5957

6058
port = await app.workbench.debug.startDebugging();
61-
await app.screenCapturer.capture('debugging has started');
6259

6360
await new Promise((c, e) => {
6461
const request = http.get(`http://localhost:${port}`);
6562
request.on('error', e);
6663
app.workbench.debug.waitForStackFrame(sf => sf.name === 'index.js' && sf.lineNumber === 6, 'looking for index.js and line 6').then(c, e);
6764
});
68-
69-
await app.screenCapturer.capture('debugging is paused');
7065
});
7166

7267
it('focus stack frames and variables', async function () {
@@ -88,15 +83,12 @@ export function setup() {
8883
const app = this.app as SpectronApplication;
8984

9085
await app.workbench.debug.stepIn();
91-
await app.screenCapturer.capture('debugging has stepped in');
9286

9387
const first = await app.workbench.debug.waitForStackFrame(sf => sf.name === 'response.js', 'looking for response.js');
9488
await app.workbench.debug.stepOver();
95-
await app.screenCapturer.capture('debugging has stepped over');
9689

9790
await app.workbench.debug.waitForStackFrame(sf => sf.name === 'response.js' && sf.lineNumber === first.lineNumber + 1, `looking for response.js and line ${first.lineNumber + 1}`);
9891
await app.workbench.debug.stepOut();
99-
await app.screenCapturer.capture('debugging has stepped out');
10092

10193
await app.workbench.debug.waitForStackFrame(sf => sf.name === 'index.js' && sf.lineNumber === 7, `looking for index.js and line 7`);
10294
});
@@ -105,15 +97,13 @@ export function setup() {
10597
const app = this.app as SpectronApplication;
10698

10799
await app.workbench.debug.continue();
108-
await app.screenCapturer.capture('debugging has continued');
109100

110101
await new Promise((c, e) => {
111102
const request = http.get(`http://localhost:${port}`);
112103
request.on('error', e);
113104
app.workbench.debug.waitForStackFrame(sf => sf.name === 'index.js' && sf.lineNumber === 6, `looking for index.js and line 6`).then(c, e);
114105
});
115106

116-
await app.screenCapturer.capture('debugging is paused');
117107
});
118108

119109
it('debug console', async function () {
@@ -126,7 +116,6 @@ export function setup() {
126116
const app = this.app as SpectronApplication;
127117

128118
await app.workbench.debug.stopDebugging();
129-
await app.screenCapturer.capture('debugging has stopped');
130119
});
131120
});
132121
}

test/smoke/src/areas/editor/editor.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export function setup() {
3535
await app.workbench.quickopen.openFile('www');
3636
await app.workbench.editor.rename('www', 7, 'app', 'newApp');
3737
await app.workbench.editor.waitForEditorContents('www', contents => contents.indexOf('newApp') > -1);
38-
await app.screenCapturer.capture('Rename result');
3938
});
4039

4140
// it('folds/unfolds the code correctly', async function () {

test/smoke/src/areas/extensions/extensions.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export function setup() {
3131
await app.workbench.runCommand('Smoke Test Check');
3232

3333
const statusbarText = await app.workbench.statusbar.getStatusbarTextByTitle('smoke test');
34-
await app.screenCapturer.capture('Statusbar');
3534
assert.equal(statusbarText, 'VS Code Smoke Test Check');
3635
});
3736
});

test/smoke/src/areas/git/git.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export function setup() {
3232
await app.workbench.scm.refreshSCMViewlet();
3333
await app.workbench.scm.waitForChange('app.js', 'Modified');
3434
await app.workbench.scm.waitForChange('index.jade', 'Modified');
35-
await app.screenCapturer.capture('changes');
3635
});
3736

3837
it('opens diff editor', async function () {

test/smoke/src/areas/multiroot/multiroot.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export function setup() {
3030
it('shows workspace name in title', async function () {
3131
const app = this.app as SpectronApplication;
3232
const title = await app.api.getTitle();
33-
await app.screenCapturer.capture('window title');
3433
assert.ok(title.indexOf('smoketest (Workspace)') >= 0);
3534
});
3635
});

test/smoke/src/areas/preferences/preferences.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,10 @@ export function setup() {
1919

2020
await app.workbench.explorer.openFile('app.js');
2121
await app.api.waitForElements('.line-numbers', false, elements => !!elements.length);
22-
await app.screenCapturer.capture('app.js has line numbers');
2322

2423
await app.workbench.settingsEditor.addUserSetting('editor.lineNumbers', '"off"');
2524
await app.workbench.editors.selectTab('app.js');
2625
await app.api.waitForElements('.line-numbers', false, result => !result || result.length === 0);
27-
28-
await app.screenCapturer.capture('line numbers hidden');
2926
});
3027

3128
it(`changes 'workbench.action.toggleSidebarPosition' command key binding and verifies it`, async function () {

test/smoke/src/areas/workbench/data-loss.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,19 @@ export function setup() {
1818
const untitled = 'Untitled-1';
1919
const textToTypeInUntitled = 'Hello, Unitled Code';
2020
await app.workbench.editor.waitForTypeInEditor(untitled, textToTypeInUntitled);
21-
await app.screenCapturer.capture('Untitled file before reload');
2221

2322
const readmeMd = 'readme.md';
2423
const textToType = 'Hello, Code';
2524
await app.workbench.explorer.openFile(readmeMd);
2625
await app.workbench.editor.waitForTypeInEditor(readmeMd, textToType);
27-
await app.screenCapturer.capture(`${readmeMd} before reload`);
2826

2927
await app.reload();
30-
await app.screenCapturer.capture('After reload');
3128

3229
await app.workbench.editors.waitForActiveTab(readmeMd, true);
33-
await app.screenCapturer.capture(`${readmeMd} after reload`);
3430
await app.workbench.editor.waitForEditorContents(readmeMd, c => c.indexOf(textToType) > -1);
3531

3632
await app.workbench.editors.waitForTab(untitled, true);
3733
await app.workbench.editors.selectTab(untitled, true);
38-
await app.screenCapturer.capture('Untitled file after reload');
3934
await app.workbench.editor.waitForEditorContents(untitled, c => c.indexOf(textToTypeInUntitled) > -1);
4035
});
4136
});

0 commit comments

Comments
 (0)