Skip to content
Snippets Groups Projects
Commit f45aad92 authored by François Grand's avatar François Grand
Browse files

feat(e2e): add reliable input clearing function

refs #616
parent c994d8bc
No related branches found
No related tags found
2 merge requests!225Release v4.17.0,!219Resolve "Le bouton calculer est activé malgré un champ en erreur"
import { by, element, ElementFinder, browser, protractor, ElementArrayFinder } from "protractor";
import { by, element, ElementFinder, browser, protractor, ElementArrayFinder, Key } from "protractor";
import { scrollPageToTop, scrollToElement } from "./util.po";
export class CalculatorPage {
......@@ -458,4 +458,15 @@ export class CalculatorPage {
getCalculatorHelpButton() {
return element(by.css("#help-calc"));
}
/**
* reliable input clearing
*/
async clearInput(inp: ElementFinder) {
const txt = await inp.getAttribute('value');
const len = txt.length;
for (let n = 0; n < len; n++) {
await inp.sendKeys(Key.BACK_SPACE);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment