aps-data-api
Version:
package for data extraction from APS company for omnimetic project
23 lines (17 loc) • 545 B
text/typescript
import fs from 'fs';
import { KeyInput } from 'puppeteer';
import { BrowserInterface, LooseObject } from '../typings';
export class Workflow {
browser: BrowserInterface.Browser;
config: LooseObject;
page: BrowserInterface.Page;
async click(key: KeyInput) {
await this.page.keyboard.press(key);
}
readConfig(workFlowConfigFilePath: string) {
return JSON.parse(fs.readFileSync(workFlowConfigFilePath).toString());
}
async typeValueForField(cssId: string, value: string) {
await this.page.type(cssId, value);
}
}