@redhat-developer/page-objects
Version:
Page Object API implementation for a VS Code editor used by ExTester framework.
58 lines • 2.46 kB
JavaScript
/**
* 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.WatchSection = void 0;
const selenium_webdriver_1 = require("selenium-webdriver");
const CustomTreeSection_1 = require("../custom/CustomTreeSection");
const WatchSectionItem_1 = require("./WatchSectionItem");
class WatchSection extends CustomTreeSection_1.GenericCustomTreeSection {
constructor(panel, viewContent) {
super(panel, viewContent, WatchSectionItem_1.WatchSectionItem);
}
/**
* Add item to Watch section.
* @param name
*/
async addItem(name) {
await (await this.getAction(WatchSection.locators.WatchSection.addExpression))?.click();
await new Promise((res) => setTimeout(res, 1000));
const textInput = await this.findElement(WatchSection.locators.WatchSection.input);
await textInput.clear();
await textInput.sendKeys(name + selenium_webdriver_1.Key.ENTER);
}
/**
* Click on 'Refresh' button.
*/
async refresh() {
await (await this.getAction(WatchSection.locators.WatchSection.refresh))?.click();
}
/**
* Remove all items in Watch seection by using 'Remove All Expression' button.
*/
async removeAllExpressions() {
await (await this.getAction(WatchSection.locators.WatchSection.removeAll))?.click();
}
/**
* Collapse all items in Watch section by using 'Collapse All' button.
*/
async collapseAll() {
await (await this.getAction(WatchSection.locators.WatchSection.collapseAll))?.click();
}
}
exports.WatchSection = WatchSection;
//# sourceMappingURL=WatchSection.js.map
;