feat: accept getList in getRect and getElementInfo
This commit is contained in:
@@ -541,7 +541,7 @@ export class WorkflowGenerator {
|
||||
* @returns {Promise<string|null>}
|
||||
*/
|
||||
private generateSelector = async (page: Page, coordinates: Coordinates, action: ActionType) => {
|
||||
const elementInfo = await getElementInformation(page, coordinates, this.listSelector);
|
||||
const elementInfo = await getElementInformation(page, coordinates, this.listSelector, this.getList);
|
||||
const selectorBasedOnCustomAction = (this.getList === true)
|
||||
? await getNonUniqueSelectors(page, coordinates)
|
||||
: await getSelectors(page, coordinates);
|
||||
@@ -569,9 +569,9 @@ export class WorkflowGenerator {
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
public generateDataForHighlighter = async (page: Page, coordinates: Coordinates) => {
|
||||
const rect = await getRect(page, coordinates, this.listSelector);
|
||||
const rect = await getRect(page, coordinates, this.listSelector, this.getList);
|
||||
const displaySelector = await this.generateSelector(page, coordinates, ActionType.Click);
|
||||
const elementInfo = await getElementInformation(page, coordinates, this.listSelector);
|
||||
const elementInfo = await getElementInformation(page, coordinates, this.listSelector, this.getList);
|
||||
if (rect) {
|
||||
if (this.getList === true) {
|
||||
if (this.listSelector !== '') {
|
||||
|
||||
@@ -17,6 +17,7 @@ export const getElementInformation = async (
|
||||
page: Page,
|
||||
coordinates: Coordinates,
|
||||
listSelector: string,
|
||||
getList: boolean
|
||||
) => {
|
||||
try {
|
||||
if (listSelector !== '') {
|
||||
@@ -155,7 +156,7 @@ export const getElementInformation = async (
|
||||
* @category WorkflowManagement-Selectors
|
||||
* @returns {Promise<Rectangle|undefined|null>}
|
||||
*/
|
||||
export const getRect = async (page: Page, coordinates: Coordinates, listSelector: string) => {
|
||||
export const getRect = async (page: Page, coordinates: Coordinates, listSelector: string, getList: boolean) => {
|
||||
try {
|
||||
if (listSelector !== '') {
|
||||
const rect = await page.evaluate(
|
||||
|
||||
Reference in New Issue
Block a user