-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
258 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
packages/page-objects/src/components/sidebar/tree/debug/WatchSection.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/** | ||
* 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. | ||
*/ | ||
|
||
import { Key, WebElement } from 'selenium-webdriver'; | ||
import { ViewContent } from '../../ViewContent'; | ||
import { GenericCustomTreeSection } from '../custom/CustomTreeSection'; | ||
import { WatchSectionItem } from './WatchSectionItem'; | ||
|
||
export class WatchSection extends GenericCustomTreeSection<WatchSectionItem> { | ||
constructor(panel: WebElement, viewContent: ViewContent) { | ||
super(panel, viewContent, WatchSectionItem); | ||
} | ||
|
||
/** | ||
* Add item to Watch section. | ||
* @param name | ||
*/ | ||
async addItem(name: string): Promise<void> { | ||
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 + Key.ENTER); | ||
} | ||
|
||
/** | ||
* Click on 'Refresh' button. | ||
*/ | ||
async refresh(): Promise<void> { | ||
await (await this.getAction(WatchSection.locators.WatchSection.refresh))?.click(); | ||
} | ||
|
||
/** | ||
* Remove all items in Watch seection by using 'Remove All Expression' button. | ||
*/ | ||
async removeAllExpressions(): Promise<void> { | ||
await (await this.getAction(WatchSection.locators.WatchSection.removeAll))?.click(); | ||
} | ||
|
||
/** | ||
* Collapse all items in Watch section by using 'Collapse All' button. | ||
*/ | ||
async collapseAll(): Promise<void> { | ||
await (await this.getAction(WatchSection.locators.WatchSection.collapseAll))?.click(); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
packages/page-objects/src/components/sidebar/tree/debug/WatchSectionItem.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* 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. | ||
*/ | ||
|
||
import { WebElement } from 'selenium-webdriver'; | ||
import { TreeSection } from '../TreeSection'; | ||
import { CustomTreeItem } from '../custom/CustomTreeItem'; | ||
|
||
export class WatchSectionItem extends CustomTreeItem { | ||
constructor(element: WebElement, viewPart: TreeSection) { | ||
super(element, viewPart); | ||
} | ||
|
||
/** | ||
* Get label of the Watch section item. | ||
* @returns a promise resolving to Watch section item label string | ||
*/ | ||
async getLabel(): Promise<string> { | ||
const name = await this.findElement(WatchSectionItem.locators.WatchSectionItem.label); | ||
return await name?.getAttribute('textContent'); | ||
} | ||
|
||
/** | ||
* Get value of the Watch section item. | ||
* @returns a promise resolving to Watch section value label string | ||
*/ | ||
async getValue(): Promise<string> { | ||
const value = await this.findElement(WatchSectionItem.locators.WatchSectionItem.value); | ||
return await value.getText(); | ||
} | ||
|
||
/** | ||
* Remove item from Watch section. | ||
*/ | ||
async remove(): Promise<void> { | ||
const button = await this.getActionButton(WatchSectionItem.locators.WatchSectionItem.remove); | ||
await button?.click(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters