Skip to content

Commit

Permalink
Remove clickWithRetries stuff for now
Browse files Browse the repository at this point in the history
  • Loading branch information
brianseeders committed Apr 18, 2022
1 parent 9dc870d commit d1b470c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 52 deletions.
2 changes: 1 addition & 1 deletion test/functional/page_objects/time_picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class TimePickerPageObject extends FtrService {
timeout: 50,
});
if (isShowDatesButton) {
await this.testSubjects.clickWithRetries('superDatePickerShowDatesButton', 0, 50);
await this.testSubjects.click('superDatePickerShowDatesButton', 50);
}
await this.testSubjects.exists('superDatePickerstartDatePopoverButton', { timeout: 1000 });
// Close the start date popover which opens automatically if `superDatePickerShowDatesButton` is clicked
Expand Down
23 changes: 0 additions & 23 deletions test/functional/services/common/find.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,29 +376,6 @@ export class FindService extends FtrService {
});
}

public async clickByCssSelectorWithRetries(
selector: string,
timeout: number = this.defaultFindTimeout,
topOffset?: number,
retries?: number
): Promise<void> {
this.log.debug(
`Find.clickByCssSelectorWithRetries('${selector}') with timeout=${timeout}, retries=${retries}`
);
await this.retry.tryForTime(1000, async () => {
const element = await this.byCssSelector(selector, timeout);
if (element) {
if (typeof retries === 'number') {
await element.clickWithRetries(retries, topOffset);
} else {
await element.click(topOffset);
}
} else {
throw new Error(`Element with css='${selector}' is not found`);
}
});
}

public async clickByDisplayedLinkText(
linkText: string,
timeout: number = this.defaultFindTimeout
Expand Down
15 changes: 0 additions & 15 deletions test/functional/services/common/test_subjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,6 @@ export class TestSubjects extends FtrService {
await this.findService.clickByCssSelector(testSubjSelector(selector), timeout, topOffset);
}

public async clickWithRetries(
selector: string,
retries: number,
timeout: number = this.FIND_TIME,
topOffset?: number
): Promise<void> {
this.log.debug(`TestSubjects.clickWithRetries(${selector})`);
await this.findService.clickByCssSelectorWithRetries(
testSubjSelector(selector),
timeout,
topOffset,
retries
);
}

public async doubleClick(selector: string, timeout: number = this.FIND_TIME): Promise<void> {
this.log.debug(`TestSubjects.doubleClick(${selector})`);
const element = await this.find(selector, timeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,6 @@ export class WebElementWrapper {
});
}

/**
* Clicks on this element, with the specified number of retries.
* https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/webdriver_exports_WebElement.html#click
*
* @return {Promise<void>}
*/
public async clickWithRetries(retries: number, topOffset?: number) {
await this.retryCall(async function click(wrapper) {
await wrapper.scrollIntoViewIfNecessary(topOffset);
await wrapper._webElement.click();
}, retries);
}

/**
* Focuses this element.
*
Expand Down

0 comments on commit d1b470c

Please sign in to comment.