Skip to content

Commit

Permalink
add suppress observer (#969)
Browse files Browse the repository at this point in the history
Signed-off-by: Qingyang(Abby) Hu <[email protected]>
  • Loading branch information
abbyhu2000 authored Jan 22, 2024
1 parent 8cd68dc commit 73f6db1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ describe('table visualization in embedded mode', () => {
'115',
];

const suppressResizeObserverIssue = () => {
// exception is thrown on loading EuiDataGrid in cypress only, ignore for now
cy.on('uncaught:exception', (err) => {
if (err.message.includes('ResizeObserver loop')) return false;
});
};

before(() => {
cy.deleteIndex(TABLE_INDEX_ID);
cy.deleteIndexPattern(TABLE_INDEX_PATTERN);
Expand Down Expand Up @@ -153,6 +160,7 @@ describe('table visualization in embedded mode', () => {
expect(data).to.deep.eq(expectedData);
});
cy.tbClickTableCellAction(2, 0, 0, 'expand', 0, true);
suppressResizeObserverIssue();
cy.tbClickFilterFromExpand('filter out');
cy.reload();
cy.tbGetTableDataFromVisualization().then((data) => {
Expand Down
10 changes: 5 additions & 5 deletions cypress/utils/plugins/observability-dashboards/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const testIndexDataSet = [
},
];

export const supressResizeObserverIssue = () => {
export const suppressResizeObserverIssue = () => {
// exception is thrown on loading EuiDataGrid in cypress only, ignore for now
cy.on('uncaught:exception', (err) => {
if (err.message.includes('ResizeObserver loop')) return false;
Expand Down Expand Up @@ -185,7 +185,7 @@ export const landOnEventVisualizations = () => {
cy.get('button[id="main-content-vis"]', { timeout: TIMEOUT_DELAY })
.contains('Visualizations')
.click();
supressResizeObserverIssue();
suppressResizeObserverIssue();
cy.wait(delayTime);
};

Expand Down Expand Up @@ -256,7 +256,7 @@ export const moveToCreatePage = () => {
})
.eq(0)
.click();
supressResizeObserverIssue();
suppressResizeObserverIssue();
cy.wait(delayTime * 2);
cy.get('[data-test-subj="createPageTitle"]', {
timeout: TIMEOUT_DELAY,
Expand All @@ -267,7 +267,7 @@ export const moveToApplication = (name) => {
cy.visit(`${BASE_PATH}/app/observability-applications#`, {
waitForGetTenant: true,
});
supressResizeObserverIssue();
suppressResizeObserverIssue();
cy.wait(delayTime * 2);
cy.get(`[data-test-subj="${name}ApplicationLink"]`, {
timeout: TIMEOUT_DELAY,
Expand All @@ -286,7 +286,7 @@ export const moveToEditPage = () => {
cy.get('[data-test-subj="editApplicationButton"]', {
timeout: TIMEOUT_DELAY,
}).click();
supressResizeObserverIssue();
suppressResizeObserverIssue();
cy.wait(delayTime);
cy.get('[data-test-subj="createPageTitle"]', {
timeout: TIMEOUT_DELAY,
Expand Down

0 comments on commit 73f6db1

Please sign in to comment.