UNPKG

@redhat-developer/page-objects

Version:

Page Object API implementation for a VS Code editor used by ExTester framework.

79 lines 3.32 kB
"use strict"; /** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License", destination); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.BreakpointSectionItem = void 0; const CustomTreeItem_1 = require("../custom/CustomTreeItem"); const SectionBreakpoint_1 = require("./SectionBreakpoint"); class BreakpointSectionItem extends CustomTreeItem_1.CustomTreeItem { constructor(element, viewPart) { super(element, viewPart); } /** * Get breakpoint element which has context menu. * @returns SectionBreakpoint page object */ async getBreakpoint() { return new SectionBreakpoint_1.SectionBreakpoint(BreakpointSectionItem.locators.BreakpointSectionItem.breakpoint.constructor, this); } /** * Get status of the breakpoint. * @returns boolean indicating status */ async isBreakpointEnabled() { const locator = BreakpointSectionItem.locators.BreakpointSectionItem.breakpointCheckbox; const el = await this.findElement(locator.constructor); return await locator.value(el); } /** * Change breakpoint status to desired state. * @param value new state */ async setBreakpointEnabled(value) { if ((await this.isBreakpointEnabled()) === value) { return; } const locator = BreakpointSectionItem.locators.BreakpointSectionItem.breakpointCheckbox; const el = await this.findElement(locator.constructor); await el.click(); } async getLabel() { const locator = BreakpointSectionItem.locators.BreakpointSectionItem.label; const el = await this.findElement(locator.constructor); return await locator.value(el); } /** * Get breakpoint file path. Empty string is returned if path is not specified. * @returns file path of breakpoint or empty string */ async getBreakpointFilePath() { const locator = BreakpointSectionItem.locators.BreakpointSectionItem.filePath; const el = await this.findElement(locator.constructor); return await locator.value(el); } /** * Get line number of the breakpoint. * @returns number indicating line position in file */ async getBreakpointLine() { const locator = BreakpointSectionItem.locators.BreakpointSectionItem.lineNumber; const el = await this.findElement(locator.constructor); return Number.parseInt(await locator.value(el)); } } exports.BreakpointSectionItem = BreakpointSectionItem; //# sourceMappingURL=BreakpointSectionItem.js.map