Skip to content

Commit

Permalink
wait for page load complete
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <[email protected]>
  • Loading branch information
Hailong-am committed Nov 15, 2024
1 parent 0ad1a0c commit 7250334
Showing 1 changed file with 27 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,16 @@ if (Cypress.env('WORKSPACE_ENABLED')) {
miscUtils.visitPage(`w/${workspaceId}/app/workspace_detail`);
// wait for page load
cy.contains('h1', 'Workspace details');
cy.getElementByTestId('recentItemsSectionButton')
.should('exist')
.click({ force: true });
// waiting for page load completely
cy.getElementByTestId('recentItemsSectionButton').should(
'not.have.class',
'headerRecentItemsButton--loadingIndicator',
{
timeout: 10000,
}
);

cy.getElementByTestId('recentItemsSectionButton').click({ force: true });

cy.get('.euiPopover__panel').within(() => {
cy.getElementByTestId('breadcrumbs').within(() => {
Expand Down Expand Up @@ -97,7 +104,14 @@ if (Cypress.env('WORKSPACE_ENABLED')) {
});

// check breadcrumbs in recent popover
cy.getElementByTestId('recentItemsSectionButton').should('exist').click();
cy.getElementByTestId('recentItemsSectionButton').should(
'not.have.class',
'headerRecentItemsButton--loadingIndicator',
{
timeout: 10000,
}
);
cy.getElementByTestId('recentItemsSectionButton').click();

cy.get('.euiPopover__panel').within(() => {
cy.getElementByTestId('breadcrumbs').within(() => {
Expand All @@ -121,9 +135,15 @@ if (Cypress.env('WORKSPACE_ENABLED')) {
});

// check breadcrumbs in recent popover
cy.getElementByTestId('recentItemsSectionButton')
.should('exist')
.click({ force: true });
cy.getElementByTestId('recentItemsSectionButton').should(
'not.have.class',
'headerRecentItemsButton--loadingIndicator',
{
timeout: 10000,
}
);

cy.getElementByTestId('recentItemsSectionButton').click({ force: true });

cy.get('.euiPopover__panel').within(() => {
cy.getElementByTestId('breadcrumbs').within(() => {
Expand Down

0 comments on commit 7250334

Please sign in to comment.