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:
Lee Drengenberg 2020-09-16 12:21:19 -05:00 committed by GitHub
parent 8169ed173b
commit 23a0dcebe2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View file

@ -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();

View file

@ -356,6 +356,7 @@ export function SettingsPageProvider({ getService, getPageObjects }: FtrProvider
}
async clickAddNewIndexPatternButton() {
await PageObjects.common.scrollKibanaBodyTop();
await testSubjects.click('createIndexPatternButton');
}

View file

@ -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();