[Logs UI] Increase keypress delay in functional tests (#41777)

* [Logs UI] Increase keypress delay in functional tests

* Re-enable moveLogColumn test

* Use charByChar instead of arbitrary key delays

* Remove contradictory expect statement

* Revert to 500ms keypress delay
This commit is contained in:
Zacqary Adam Xeper 2019-07-29 12:56:38 -05:00 committed by GitHub
parent 8e8c323459
commit 299718990e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -98,8 +98,7 @@ export default ({ getPageObjects, getService }: KibanaFunctionalTestDefaultProvi
await infraSourceConfigurationFlyout.addTimestampLogColumn();
await infraSourceConfigurationFlyout.addFieldLogColumn('host.name');
// TODO: make test more robust
// await infraSourceConfigurationFlyout.moveLogColumn(0, 1);
await infraSourceConfigurationFlyout.moveLogColumn(0, 1);
await infraSourceConfigurationFlyout.saveConfiguration();
await infraSourceConfigurationFlyout.closeFlyout();
@ -108,9 +107,7 @@ export default ({ getPageObjects, getService }: KibanaFunctionalTestDefaultProvi
it('renders the changed log columns with their headers', async () => {
const columnHeaderLabels = await infraLogStream.getColumnHeaderLabels();
// TODO: make test more robust
// expect(columnHeaderLabels).to.eql(['host.name', 'Timestamp', '']);
expect(columnHeaderLabels).to.eql(['Timestamp', 'host.name', '']);
expect(columnHeaderLabels).to.eql(['host.name', 'Timestamp', '']);
const logStreamEntries = await infraLogStream.getStreamEntries();

View file

@ -83,6 +83,8 @@ export function InfraSourceConfigurationFlyoutProvider({
}
},
async moveLogColumn(sourceIndex: number, destinationIndex: number) {
const KEY_PRESS_DELAY_MS = 500; // This may need to be high for Jenkins; 100 works on desktop
const logColumnPanel = (await this.getLogColumnPanels())[sourceIndex];
const moveLogColumnHandle = await testSubjects.findDescendant(
'moveLogColumnHandle',
@ -92,7 +94,7 @@ export function InfraSourceConfigurationFlyoutProvider({
const movementDifference = destinationIndex - sourceIndex;
await moveLogColumnHandle.pressKeys(browser.keys.SPACE);
for (let i = 0; i < Math.abs(movementDifference); i++) {
await new Promise(res => setTimeout(res, 100));
await new Promise(res => setTimeout(res, KEY_PRESS_DELAY_MS));
if (movementDifference > 0) {
await moveLogColumnHandle.pressKeys(browser.keys.ARROW_DOWN);
} else {
@ -100,6 +102,7 @@ export function InfraSourceConfigurationFlyoutProvider({
}
}
await moveLogColumnHandle.pressKeys(browser.keys.SPACE);
await new Promise(res => setTimeout(res, KEY_PRESS_DELAY_MS));
},
/**