A fork of https://github.com/ueokande/vim-vixen
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.
22 lines
762 B
22 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(); |
|
} |
|
}
|
|
|