scroll to top of #kibana-body before trying to click createIndexButton (#77550)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
8169ed173b
commit
23a0dcebe2
|
@ -496,6 +496,10 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo
|
||||||
const input = await find.byCssSelector('.euiFilePicker__input');
|
const input = await find.byCssSelector('.euiFilePicker__input');
|
||||||
await input.type(path);
|
await input.type(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async scrollKibanaBodyTop() {
|
||||||
|
await browser.setScrollToById('kibana-body', 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new CommonPage();
|
return new CommonPage();
|
||||||
|
|
|
@ -356,6 +356,7 @@ export function SettingsPageProvider({ getService, getPageObjects }: FtrProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickAddNewIndexPatternButton() {
|
async clickAddNewIndexPatternButton() {
|
||||||
|
await PageObjects.common.scrollKibanaBodyTop();
|
||||||
await testSubjects.click('createIndexPatternButton');
|
await testSubjects.click('createIndexPatternButton');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -480,6 +480,12 @@ export async function BrowserProvider({ getService }: FtrProviderContext) {
|
||||||
return this.getScrollTop();
|
return this.getScrollTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async setScrollToById(elementId: string, xCoord: number, yCoord: number) {
|
||||||
|
await driver.executeScript(
|
||||||
|
`document.getElementById("${elementId}").scrollTo(${xCoord},${yCoord})`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public async setScrollLeft(scrollSize: number | string) {
|
public async setScrollLeft(scrollSize: number | string) {
|
||||||
await driver.executeScript('document.body.scrollLeft = ' + scrollSize);
|
await driver.executeScript('document.body.scrollLeft = ' + scrollSize);
|
||||||
return this.getScrollLeft();
|
return this.getScrollLeft();
|
||||||
|
|
Loading…
Reference in a new issue