Skip to content

Commit

Permalink
Adds sleep to functional test UI interactions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeramysoucy committed Aug 1, 2022
1 parent 1949640 commit 77fab8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions x-pack/test/functional/apps/spaces/spaces_selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ export default function spaceSelectorFunctionalTests({
await PageObjects.spaceSelector.goToSpecificSpace(space5Id);
await PageObjects.spaceSelector.expectHomePage(space5Id);

await PageObjects.spaceSelector.openSpacesNav();
await PageObjects.spaceSelector.goToSpecificSpace(defaultSpaceId);
await PageObjects.spaceSelector.expectHomePage(defaultSpaceId);
// await PageObjects.spaceSelector.openSpacesNav();
// await PageObjects.spaceSelector.goToSpecificSpace(defaultSpaceId);
// await PageObjects.spaceSelector.expectHomePage(defaultSpaceId);

await PageObjects.spaceSelector.openSpacesNav();
await PageObjects.spaceSelector.goToSpecificSpace(anotherSpaceId);
Expand Down
11 changes: 8 additions & 3 deletions x-pack/test/functional/page_objects/space_selector_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export class SpaceSelectorPageObject extends FtrService {
} else {
expect(url).to.contain(`/s/${spaceId}${route}`);
}
await this.common.sleep(1000);
});
}

Expand All @@ -58,6 +59,7 @@ export class SpaceSelectorPageObject extends FtrService {
} else {
expect(url).to.contain(`/s/${spaceId}`);
}
await this.common.sleep(1000);
});
}

Expand All @@ -66,6 +68,7 @@ export class SpaceSelectorPageObject extends FtrService {
return await this.retry.try(async () => {
await this.testSubjects.click('spacesNavSelector');
await this.find.byCssSelector('#headerSpacesMenuContent');
await this.common.sleep(1000);
});
}

Expand Down Expand Up @@ -197,10 +200,12 @@ export class SpaceSelectorPageObject extends FtrService {
await this.testSubjects.click('space-avatar-space_b');
}

async goToSpecificSpace(spaceName: string) {
async goToSpecificSpace(spaceId: string) {
return await this.retry.try(async () => {
this.log.info(`SpaceSelectorPage:goToSpecificSpace(${spaceName})`);
await this.testSubjects.click(`${spaceName}-selectableSpaceItem`);
this.log.info(`SpaceSelectorPage:goToSpecificSpace(${spaceId})`);
// await this.testSubjects.click(`${spaceId}-selectableSpaceItem`);
const spaceOption = await this.testSubjects.find(`${spaceId}-selectableSpaceItem`);
await spaceOption?.click();
await this.common.sleep(1000);
});
}
Expand Down

0 comments on commit 77fab8b

Please sign in to comment.