UNPKG

@theia-extension-tester/tests

Version:

Tests for theia-extension-tester package.

110 lines 4.71 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 chai_1 = require("chai"); const page_objects_1 = require("@theia-extension-tester/page-objects"); describe('Workbench', function () { var _a; this.timeout(40000); let workbench; const expectedWorkbenchPath = (_a = process.env['THEIA_EXPECTED_WORKBENCH_PATH']) !== null && _a !== void 0 ? _a : '/projects'; beforeEach(function () { workbench = new page_objects_1.Workbench(); page_objects_1.Workbench.openFolder = undefined; }); it('getTitleBar', function () { return __awaiter(this, void 0, void 0, function* () { const item = yield workbench.getTitleBar().getItem('File'); chai_1.expect(item).not.to.be.undefined; }); }); it('getActivityBar', function () { return __awaiter(this, void 0, void 0, function* () { const item = yield workbench.getActivityBar().getViewControl('Explorer'); chai_1.expect(item).not.to.be.undefined; yield item.openView(); }); }); it('getSideBar', function () { return __awaiter(this, void 0, void 0, function* () { const item = workbench.getSideBar().getTitlePart(); chai_1.expect(yield item.getTitle()).includes('Explorer'); }); }); it('getStatusBar', function () { return __awaiter(this, void 0, void 0, function* () { const status = workbench.getStatusBar(); yield status.isDisplayed(); }); }); it.skip('getBottomBar', function () { return __awaiter(this, void 0, void 0, function* () { }); }); it('getEditorView', function () { return __awaiter(this, void 0, void 0, function* () { const item = workbench.getEditorView(); yield item.getOpenEditorTitles(); }); }); it.skip('getNotifications', function () { return __awaiter(this, void 0, void 0, function* () { }); }); it('openNotificationsCenter', function () { return __awaiter(this, void 0, void 0, function* () { const center = yield workbench.openNotificationsCenter(); try { chai_1.expect(yield center.isDisplayed()); } finally { yield center.close(); } }); }); it.skip('openSettings', function () { return __awaiter(this, void 0, void 0, function* () { }); }); it('openCommandPrompt', function () { return __awaiter(this, void 0, void 0, function* () { const item = yield workbench.openCommandPrompt(); try { chai_1.expect(item).not.to.be.undefined; chai_1.expect(yield item.getText()).equals('>'); } finally { yield item.cancel(); } }); }); it('executeCommand', function () { return __awaiter(this, void 0, void 0, function* () { yield workbench.executeCommand('Cut'); yield workbench.executeCommand('>Cut'); }); }); it.skip('openFolderPath', function () { return __awaiter(this, void 0, void 0, function* () { chai_1.expect(yield workbench.getOpenFolderPath()).equals(expectedWorkbenchPath); }); }); it.skip('openFolderPath - another view opened', function () { return __awaiter(this, void 0, void 0, function* () { const debug = yield workbench.getActivityBar().getViewControl('Debug'); chai_1.expect(debug).not.to.be.undefined; const title = yield debug.getTitle(); yield debug.openView(); const workspace = yield workbench.getOpenFolderPath(); chai_1.expect(workspace).equals(expectedWorkbenchPath); chai_1.expect(yield workbench.getSideBar().getTitlePart().getTitle()).equals(title); yield debug.closeView(); }); }); }); //# sourceMappingURL=Workbench.test.js.map