systelab-components-wdio-test
Version:
Widgets to be use in the E2E Tests based in WDIO
28 lines (27 loc) • 757 B
JavaScript
import { Widget } from "./widget.js";
import { Browser } from '../wdio/browser.js';
export class Spinner extends Widget {
async clear() {
return this.byTagName('input').clear();
}
async setText(text) {
return this.byTagName('input').write(text);
}
async getText() {
return this.byTagName('input').getValue();
}
async getValue() {
return +(await this.getText());
}
async setValue(value) {
await this.clear();
await this.setText(value.toString());
await Browser.pressTab();
}
async increase() {
return this.byClassName('input-group-append').click();
}
async decrease() {
return this.byClassName('input-group-prepend').click();
}
}