Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { visit } from '../../../tasks/navigation';
import {
setGrouping,
waitForGroupingTable,
waitForEntityAnalyticsPageReady,
interceptEntityStoreSearch,
selectGroupingOption,
interceptEntityStoreStatus,
Expand Down Expand Up @@ -63,9 +64,7 @@ describe(
visit(ENTITY_ANALYTICS_HOME_PAGE_URL);
cy.get(PAGE_TITLE).should('exist');
// Resolution is the default grouping
cy.wait('@entityStoreStatus', { timeout: 20000 });
cy.wait('@entityStoreSearch');
waitForGroupingTable();
waitForEntityAnalyticsPageReady();
});

it('displays resolution groups', () => {
Expand Down Expand Up @@ -116,9 +115,7 @@ describe(
interceptEntityStoreSearch();
visit(ENTITY_ANALYTICS_HOME_PAGE_URL);
cy.get(PAGE_TITLE).should('exist');
cy.wait('@entityStoreStatus', { timeout: 20000 });
cy.wait('@entityStoreSearch');
waitForGroupingTable();
waitForEntityAnalyticsPageReady();
});

it('shows group selector with Entity type selected', () => {
Expand Down Expand Up @@ -152,9 +149,7 @@ describe(
interceptEntityStoreSearch();
visit(ENTITY_ANALYTICS_HOME_PAGE_URL);
cy.get(PAGE_TITLE).should('exist');
cy.wait('@entityStoreStatus', { timeout: 20000 });
cy.wait('@entityStoreSearch');
waitForGroupingTable();
waitForEntityAnalyticsPageReady();
});

it('selecting "None" shows flat data table', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@ export const waitForGroupingTable = () => {
cy.get(GROUPING_LEVEL_0).should('exist');
};

/**
* Waits for the entity store status intercept and the initial entity store
* search to both resolve, then confirms the grouping table is ready.
*
* Must be called after `interceptEntityStoreStatus` and
* `interceptEntityStoreSearch` are registered and after `cy.visit`.
*
* The search fires only once the sourcerer / data-view has finished loading,
* which can take well over 5 s in CI — both timeouts are set to 20 s to
* match the patience already applied to `@entityStoreStatus`.
*/
export const waitForEntityAnalyticsPageReady = () => {
cy.wait('@entityStoreStatus', { timeout: 20000 });
cy.wait('@entityStoreSearch', { timeout: 20000 });
waitForGroupingTable();
};

/**
* Intercepts the entity store search API and registers an alias.
* Call this before navigation so Cypress captures the request.
Expand Down
Loading