Skip to content

Commit

Permalink
wip hoverThenTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
limonte committed Nov 7, 2021
1 parent 7999b26 commit f8a561e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions test/source/browser/controllable.ts
Expand Up @@ -273,15 +273,19 @@ abstract class ControllableBase {
await this.waitAndClick(`@ui-modal-${type}-${clickBtn}`);
}

public waitAndClick = async (selector: string, { delay = 0.1, timeout = 10000, confirmGone = false, retryErrs = false, sleepWhenDone }:
{ delay?: number, timeout?: number, confirmGone?: boolean, retryErrs?: boolean, sleepWhenDone?: number } = {}) => {
public waitAndClick = async (selector: string, { delay = 0.1, timeout = 10000, hoverThenTimeout = 0, confirmGone = false, retryErrs = false, sleepWhenDone }:
{ delay?: number, timeout?: number, hoverThenTimeout?: number, confirmGone?: boolean, retryErrs?: boolean, sleepWhenDone?: number } = {}) => {
for (const i of [1, 2, 3]) {
this.log(`wait_and_click(i${i}):1:${selector}`);
await this.waitAll(selector, { timeout });
this.log(`wait_and_click(i${i}):2:${selector}`);
await Util.sleep(delay);
this.log(`wait_and_click(i${i}):3:${selector}`);
try {
if (hoverThenTimeout) {
await this.target.hover(this.selector(selector));
await Util.sleep(hoverThenTimeout);
}
this.log(`wait_and_click(i${i}):4:${selector}`);
await this.click(selector);
this.log(`wait_and_click(i${i}):5:${selector}`);
Expand Down
4 changes: 2 additions & 2 deletions test/source/tests/page-recipe/setup-page-recipe.ts
Expand Up @@ -108,9 +108,9 @@ export class SetupPageRecipe extends PageRecipe {
) {
if (!noPrvCreateOrgRule) {
if (usedPgpBefore) {
await settingsPage.waitAndClick('@action-step0foundkey-choose-manual-enter', { retryErrs: true });
await settingsPage.waitAndClick('@action-step0foundkey-choose-manual-enter', { hoverThenTimeout: 5 });
} else {
await settingsPage.waitAndClick('@action-step1easyormanual-choose-manual-enter', { retryErrs: true });
await settingsPage.waitAndClick('@action-step1easyormanual-choose-manual-enter', { hoverThenTimeout: 5 });
}
}
key = key || Config.key(keyTitle);
Expand Down

0 comments on commit f8a561e

Please sign in to comment.