You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

23 lines
762 B

import { Lanthan } from 'lanthan';
import { WebDriver, By } from 'selenium-webdriver';
export default class JSONOptionPage {
private webdriver: WebDriver;
constructor(lanthan: Lanthan) {
this.webdriver = lanthan.getWebDriver();
}
async updateSettings(value: string): Promise<void> {
let textarea = await this.webdriver.findElement(By.css('textarea'));
await this.webdriver.executeScript(`document.querySelector('textarea').value = '${value}'`)
await textarea.sendKeys(' ');
await this.webdriver.executeScript(() => document.querySelector('textarea')!!.blur());
}
async getErrorMessage(): Promise<string> {
let error = await this.webdriver.findElement(By.css('.settings-ui-input-error'));
return error.getText();
}
}