mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[CI] Various lens test/combobox speedups (#130934)
This commit is contained in:
parent
c052e50b54
commit
799ec1b2d4
3 changed files with 26 additions and 15 deletions
|
@ -157,7 +157,7 @@ export class ComboBoxService extends FtrService {
|
|||
* @param comboBoxElement element that wraps up EuiComboBox
|
||||
*/
|
||||
private async waitForOptionsListLoading(comboBoxElement: WebElementWrapper): Promise<void> {
|
||||
await comboBoxElement.waitForDeletedByCssSelector('.euiLoadingSpinner');
|
||||
await comboBoxElement.waitForDeletedByCssSelector('.euiLoadingSpinner', 50);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -255,7 +255,9 @@ export class ComboBoxService extends FtrService {
|
|||
* @param comboBoxElement element that wraps up EuiComboBox
|
||||
*/
|
||||
public async closeOptionsList(comboBoxElement: WebElementWrapper): Promise<void> {
|
||||
const isOptionsListOpen = await this.testSubjects.exists('~comboBoxOptionsList');
|
||||
const isOptionsListOpen = await this.testSubjects.exists('~comboBoxOptionsList', {
|
||||
timeout: 50,
|
||||
});
|
||||
if (isOptionsListOpen) {
|
||||
const input = await comboBoxElement.findByTagName('input');
|
||||
await input.pressKeys(this.browser.keys.ESCAPE);
|
||||
|
@ -268,7 +270,10 @@ export class ComboBoxService extends FtrService {
|
|||
* @param comboBoxElement element that wraps up EuiComboBox
|
||||
*/
|
||||
public async openOptionsList(comboBoxElement: WebElementWrapper): Promise<void> {
|
||||
const isOptionsListOpen = await this.testSubjects.exists('~comboBoxOptionsList');
|
||||
const isOptionsListOpen = await this.testSubjects.exists('~comboBoxOptionsList', {
|
||||
timeout: 50,
|
||||
});
|
||||
|
||||
if (!isOptionsListOpen) {
|
||||
await this.retry.try(async () => {
|
||||
const toggleBtn = await comboBoxElement.findByTestSubject('comboBoxInput');
|
||||
|
|
|
@ -686,17 +686,23 @@ export class WebElementWrapper {
|
|||
* @param {string} className
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
public async waitForDeletedByCssSelector(selector: string): Promise<void> {
|
||||
await this.driver.manage().setTimeouts({ implicit: 1000 });
|
||||
await this.driver.wait(
|
||||
async () => {
|
||||
const found = await this._webElement.findElements(this.By.css(selector));
|
||||
return found.length === 0;
|
||||
},
|
||||
this.timeout,
|
||||
`The element with ${selector} selector was still present after ${this.timeout} sec.`
|
||||
);
|
||||
await this.driver.manage().setTimeouts({ implicit: this.timeout });
|
||||
public async waitForDeletedByCssSelector(
|
||||
selector: string,
|
||||
implicitTimeout = 1000
|
||||
): Promise<void> {
|
||||
try {
|
||||
await this.driver.manage().setTimeouts({ implicit: implicitTimeout });
|
||||
await this.driver.wait(
|
||||
async () => {
|
||||
const found = await this._webElement.findElements(this.By.css(selector));
|
||||
return found.length === 0;
|
||||
},
|
||||
this.timeout,
|
||||
`The element with ${selector} selector was still present after ${this.timeout} sec.`
|
||||
);
|
||||
} finally {
|
||||
await this.driver.manage().setTimeouts({ implicit: this.timeout });
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -737,7 +737,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
|
|||
},
|
||||
|
||||
async openChartSwitchPopover() {
|
||||
if (await testSubjects.exists('lnsChartSwitchList')) {
|
||||
if (await testSubjects.exists('lnsChartSwitchList', { timeout: 50 })) {
|
||||
return;
|
||||
}
|
||||
await retry.try(async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue