feat: date input check using element information
This commit is contained in:
@@ -286,11 +286,11 @@ export class WorkflowGenerator {
|
|||||||
const selector = await this.generateSelector(page, coordinates, ActionType.Click);
|
const selector = await this.generateSelector(page, coordinates, ActionType.Click);
|
||||||
logger.log('debug', `Element's selector: ${selector}`);
|
logger.log('debug', `Element's selector: ${selector}`);
|
||||||
|
|
||||||
|
const elementInfo = await getElementInformation(page, coordinates, '', false);
|
||||||
|
console.log("Element info: ", elementInfo);
|
||||||
|
|
||||||
// Check if clicked element is a date input
|
// Check if clicked element is a date input
|
||||||
const isDateInput = await page.evaluate(({x, y}) => {
|
const isDateInput = elementInfo?.tagName === 'INPUT' && elementInfo?.attributes?.type === 'date';
|
||||||
const element = document.elementFromPoint(x, y);
|
|
||||||
return element instanceof HTMLInputElement && element.type === 'date';
|
|
||||||
}, coordinates);
|
|
||||||
|
|
||||||
if (isDateInput) {
|
if (isDateInput) {
|
||||||
// Notify client to show datepicker overlay
|
// Notify client to show datepicker overlay
|
||||||
|
|||||||
Reference in New Issue
Block a user