UNPKG

@theia-extension-tester/tests

Version:

Tests for theia-extension-tester package.

105 lines 4.78 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const page_objects_1 = require("@theia-extension-tester/page-objects"); const File_1 = require("./utils/File"); const path = require("path"); const chai_1 = require("chai"); const root = 'EditorGroup'; const MARKDOWN = path.join(root, "README.md"); const MARKDOWN_SECONDARY = path.join(root, "Example.md"); const ALTERNATIVE_FILE = path.join(root, "Alternative.txt"); describe.skip('EditorGroup', function () { this.timeout(40000); let editorView; let tree; before(function () { return __awaiter(this, void 0, void 0, function* () { editorView = new page_objects_1.EditorView(); yield editorView.closeAllEditors(); tree = yield File_1.getExplorerSection(); yield File_1.deleteFiles(root); yield tree.createFolder(root); yield tree.createFile(MARKDOWN); yield tree.createFile(MARKDOWN_SECONDARY); yield tree.createFile(ALTERNATIVE_FILE); }); }); beforeEach(function () { return __awaiter(this, void 0, void 0, function* () { tree = yield File_1.getExplorerSection(); yield editorView.closeAllEditors(); }); }); after(function () { return __awaiter(this, void 0, void 0, function* () { yield editorView.closeAllEditors(); yield File_1.deleteFiles(root); }); }); function openEditors(files) { return __awaiter(this, void 0, void 0, function* () { for (const group of files) { for (const file of group) { yield tree.openFile(file); yield new page_objects_1.Workbench().executeCommand('Markdown: Open Preview to the Side'); } } yield tree.openFile(MARKDOWN); yield new page_objects_1.Workbench().executeCommand('Markdown: Open Preview to the Side'); const group = yield editorView.getEditorGroup(1); yield tree.openFile(ALTERNATIVE_FILE); let activeEditor = yield editorView.getActiveEditor(); chai_1.expect(yield activeEditor.getTitle()).equals(path.basename(ALTERNATIVE_FILE)); chai_1.expect(yield editorView.getOpenEditorTitles(0)).to.include.members([path.basename(MARKDOWN)]); chai_1.expect(yield editorView.getOpenEditorTitles(1)) .to.include.members([`Preview ${path.basename(MARKDOWN)}`, path.basename(ALTERNATIVE_FILE)]); return group; }); } it('openEditor', function () { return __awaiter(this, void 0, void 0, function* () { }); }); it('closeEditor', function () { return __awaiter(this, void 0, void 0, function* () { yield tree.openFile(MARKDOWN); yield new page_objects_1.Workbench().executeCommand('Markdown: Open Preview to the Side'); const group = yield editorView.getEditorGroup(1); yield tree.openFile(ALTERNATIVE_FILE); let activeEditor = yield editorView.getActiveEditor(); chai_1.expect(yield activeEditor.getTitle()).equals(path.basename(ALTERNATIVE_FILE)); activeEditor = (yield group.openEditor(`Preview ${path.basename(MARKDOWN)}`)); chai_1.expect(yield activeEditor.getTitle()).equals(`Preview ${path.basename(MARKDOWN)}`); }); }); it('closeAllEditors', function () { return __awaiter(this, void 0, void 0, function* () { }); }); it('getOpenEditorTitles', function () { return __awaiter(this, void 0, void 0, function* () { }); }); it('getTabByTitle', function () { return __awaiter(this, void 0, void 0, function* () { }); }); it('getOpenTabs', function () { return __awaiter(this, void 0, void 0, function* () { }); }); it('getActiveTab', function () { return __awaiter(this, void 0, void 0, function* () { }); }); }); //# sourceMappingURL=EditorGroup.test.js.map