mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
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
3 changed files with 11 additions and 0 deletions
|
@ -496,6 +496,10 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo
|
|||
const input = await find.byCssSelector('.euiFilePicker__input');
|
||||
await input.type(path);
|
||||
}
|
||||
|
||||
async scrollKibanaBodyTop() {
|
||||
await browser.setScrollToById('kibana-body', 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return new CommonPage();
|
||||
|
|
|
@ -356,6 +356,7 @@ export function SettingsPageProvider({ getService, getPageObjects }: FtrProvider
|
|||
}
|
||||
|
||||
async clickAddNewIndexPatternButton() {
|
||||
await PageObjects.common.scrollKibanaBodyTop();
|
||||
await testSubjects.click('createIndexPatternButton');
|
||||
}
|
||||
|
||||
|
|
|
@ -480,6 +480,12 @@ export async function BrowserProvider({ getService }: FtrProviderContext) {
|
|||
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) {
|
||||
await driver.executeScript('document.body.scrollLeft = ' + scrollSize);
|
||||
return this.getScrollLeft();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue