Skip to content

Commit 2532e5e

Browse files
authored
fix: re-enable skipped UI tests (#34)
1 parent 69ef4bd commit 2532e5e

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

settings.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
"typescript.updateImportsOnFileMove.enabled": "always",
33
"workbench.editor.enablePreview": true,
44
"git.autoRepositoryDetection": false,
5-
"terminal.integrated.sendKeybindingsToShell": true
5+
"terminal.integrated.sendKeybindingsToShell": true,
6+
"workbench.remoteIndicator.showExtensionRecommendations": false,
7+
"extensions.ignoreRecommendations": true
68
}

src/ui-test/bottomBar.test.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { BottomBarPanel, MarkerType, OutputView, ProblemsView, TerminalView, VSBrowser } from 'vscode-extension-tester';
18+
import { BottomBarPanel, EditorView, MarkerType, OutputView, ProblemsView, TerminalView, VSBrowser } from 'vscode-extension-tester';
1919
import * as path from 'path';
2020
import { expect } from 'chai';
2121

@@ -65,6 +65,10 @@ describe('Bottom Bar Example Tests', function () {
6565
}, 15000);
6666
});
6767

68+
after(async function () {
69+
await new EditorView().closeAllEditors();
70+
});
71+
6872
// These tests use getAllVisibleMarkers() and are unreliable and should not be included.
6973
//
7074
// now we can look at the error markers
@@ -136,8 +140,7 @@ describe('Bottom Bar Example Tests', function () {
136140
});
137141

138142
// lets test the output view now
139-
// TODO: Fix
140-
describe.skip('Output View', function () {
143+
describe('Output View', function () {
141144
let view: OutputView;
142145

143146
before(async function () {
@@ -156,28 +159,29 @@ describe('Bottom Bar Example Tests', function () {
156159
});
157160

158161
it('Clear the output channel', async function () {
162+
const delimiter = process.platform === 'win32' ? '\r\n' : '\n';
159163
await view.clearText();
160164
const text = await view.getText();
161165

162166
// now the log is technically empty, it just contains a newline character
163-
expect(text).equals('\n');
167+
expect(text).equals(delimiter);
164168
});
165169
});
166170

167-
// TODO: Fix
168-
describe.skip('Terminal View', function () {
171+
describe('Terminal View', function () {
169172
let view: TerminalView;
170173

171174
before(async function () {
172175
view = await bottomBar.openTerminalView();
173176
});
174177

175-
it.skip('Execute a command', async function () {
176-
await view.executeCommand('echo "hello world\\!"', 2000);
178+
it('Execute a command', async function () {
179+
const delimiter = process.platform === 'win32' ? '\r\n' : '\n';
180+
await view.executeCommand('echo "hello world"', 2_000);
177181

178182
// now there should be a line saying 'hello world!' in the terminal
179183
const text = await view.getText();
180-
const textFound = text.split('\n').some((line) => line === 'hello world!');
184+
const textFound = text.split(delimiter).some((line) => line === 'hello world');
181185

182186
expect(textFound).is.true;
183187
});

src/ui-test/modalDialog.test.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,19 @@
1616
*/
1717

1818
import { expect } from 'chai';
19-
import { EditorView, ModalDialog, TextEditor, Workbench } from 'vscode-extension-tester';
19+
import { EditorView, InputBox, ModalDialog, TextEditor, Workbench } from 'vscode-extension-tester';
2020

2121
// Example of handling a modal dialog
22-
// TODO: Fix
23-
describe.skip('Sample Modal Dialog Tests', () => {
22+
describe('Sample Modal Dialog Tests', () => {
2423
let dialog: ModalDialog;
2524

2625
before(async () => {
2726
// we need to open some modal dialog first, so lets try to close an unsaved file
2827
// create a new file
2928
await new Workbench().executeCommand('create new file');
29+
const input = await InputBox.create();
30+
await input.selectQuickPick('Text File');
31+
await input.getDriver().sleep(500);
3032
// make some changes
3133
const editor = new TextEditor();
3234
await editor.typeTextAt(1, 1, 'text');

src/ui-test/settingsEditor.test.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
import { expect } from 'chai';
1919
import { CheckboxSetting, SettingsEditor, Workbench } from 'vscode-extension-tester';
2020

21-
// TODO: Fix
22-
describe.skip('Settings Editor sample tests', () => {
21+
describe('Settings Editor sample tests', () => {
2322
let settings: SettingsEditor;
2423

2524
before(async () => {

0 commit comments

Comments
 (0)