fix(basic.gblib): Fixes in WebAutomation.
This commit is contained in:
parent
b576b6f54d
commit
d4cf165165
3 changed files with 9 additions and 15 deletions
|
@ -774,7 +774,7 @@ export class DialogKeywords {
|
||||||
await sleep(DEFAULT_HEAR_POLL_INTERVAL);
|
await sleep(DEFAULT_HEAR_POLL_INTERVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
const answer = min. cbMap[userId].promise;
|
const answer = min.cbMap[userId].promise;
|
||||||
|
|
||||||
if (!kind) {
|
if (!kind) {
|
||||||
result = answer;
|
result = answer;
|
||||||
|
|
|
@ -475,7 +475,7 @@ export class SystemKeywords {
|
||||||
|
|
||||||
// Handles calls for HTML stuff
|
// Handles calls for HTML stuff
|
||||||
|
|
||||||
if (handle) {
|
if (handle && WebAutomationServices.isSelector(file)) {
|
||||||
GBLog.info(`BASIC: Web automation SET ${file}' to '${address}' . `);
|
GBLog.info(`BASIC: Web automation SET ${file}' to '${address}' . `);
|
||||||
await new WebAutomationServices().setElementText({ pid, handle, selector: file, text: address });
|
await new WebAutomationServices().setElementText({ pid, handle, selector: file, text: address });
|
||||||
|
|
||||||
|
@ -718,7 +718,7 @@ export class SystemKeywords {
|
||||||
page = WebAutomationServices.getPageByHandle(handle);
|
page = WebAutomationServices.getPageByHandle(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (page['$eval'] && (file.startsWith('.') || file.startsWith('#'))) {
|
if (page['$eval'] && WebAutomationServices.isSelector(file)) {
|
||||||
const container = page['frame'] ? page['frame'] : page;
|
const container = page['frame'] ? page['frame'] : page;
|
||||||
const originalSelector = file;
|
const originalSelector = file;
|
||||||
|
|
||||||
|
|
|
@ -52,18 +52,11 @@ import { SystemKeywords } from './SystemKeywords.js';
|
||||||
* Web Automation services of conversation to be called by BASIC.
|
* Web Automation services of conversation to be called by BASIC.
|
||||||
*/
|
*/
|
||||||
export class WebAutomationServices {
|
export class WebAutomationServices {
|
||||||
/**
|
static isSelector(name: any) {
|
||||||
* The number used in this execution for HEAR calls (useful for SET SCHEDULE).
|
return name.startsWith('.') || name.startsWith('#');
|
||||||
*/
|
}
|
||||||
hrOn: string;
|
private debugWeb: boolean;
|
||||||
|
private lastDebugWeb: Date;
|
||||||
debugWeb: boolean;
|
|
||||||
lastDebugWeb: Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SYSTEM account maxLines,when used with impersonated contexts (eg. running in SET SCHEDULE).
|
|
||||||
*/
|
|
||||||
maxLines: number = 2000;
|
|
||||||
|
|
||||||
public static cyrb53 = (str, seed = 0) => {
|
public static cyrb53 = (str, seed = 0) => {
|
||||||
let h1 = 0xdeadbeef ^ seed,
|
let h1 = 0xdeadbeef ^ seed,
|
||||||
|
@ -347,6 +340,7 @@ export class WebAutomationServices {
|
||||||
* @example SET page,"selector","text"
|
* @example SET page,"selector","text"
|
||||||
*/
|
*/
|
||||||
public async setElementText({ pid, handle, selector, text }) {
|
public async setElementText({ pid, handle, selector, text }) {
|
||||||
|
text = `${text}`;
|
||||||
const page = WebAutomationServices.getPageByHandle(handle);
|
const page = WebAutomationServices.getPageByHandle(handle);
|
||||||
GBLog.info(`BASIC: Web Automation TYPE on ${selector}: ${text}.`);
|
GBLog.info(`BASIC: Web Automation TYPE on ${selector}: ${text}.`);
|
||||||
const e = await this.getBySelector({ handle, selector });
|
const e = await this.getBySelector({ handle, selector });
|
||||||
|
|
Loading…
Add table
Reference in a new issue