blob: 2d8147e2cf4c59f6124f0ceaf85a8d46752f5fa7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
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> {
const 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> {
const error = await this.webdriver.findElement(By.css("p[role=alert]"));
return error.getText();
}
}
|