Skip to content
Draft
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 @@ -49,13 +49,6 @@ 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(() => {
CURRENT_TENANT.newTenant = 'global';
cy.fleshTenantSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,18 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { CommonUI } from '@opensearch-dashboards-test/opensearch-dashboards-test-library';
import {
BASE_PATH,
TABLE_INDEX_ID,
TABLE_PATH_INDEX_DATA,
TABLE_INDEX_PATTERN,
TABLE_PATH_SO_DATA,
TABLE_VIS_APP_PATH,
TABLE_INDEX_START_TIME,
TABLE_INDEX_END_TIME,
toTestId,
} from '../../../../../utils/constants';
import { CURRENT_TENANT } from '../../../../../utils/commands';

const commonUI = new CommonUI(cy);

describe('table visualization - auto column resizing', () => {
const TABLE_RESIZE_VIS_TITLE = 'Table Column Auto Resize Test';

before(() => {
CURRENT_TENANT.newTenant = 'global';
cy.fleshTenantSettings();
Expand All @@ -43,7 +36,9 @@ describe('table visualization - auto column resizing', () => {
cy.visit(`${BASE_PATH}/app/visualize`);
cy.get('[data-test-subj="newItemButton"]').click();
cy.get('[data-test-subj="visType-table"]').click();
cy.get('[data-test-subj="savedObjectFinderSearchInput"]').type(TABLE_INDEX_ID);
cy.get('[data-test-subj="savedObjectFinderSearchInput"]').type(
TABLE_INDEX_ID
);
cy.get(`[data-test-subj="savedObjectTitle${TABLE_INDEX_ID}"]`).click();
cy.setTopNavDate(TABLE_INDEX_START_TIME, TABLE_INDEX_END_TIME);
});
Expand Down Expand Up @@ -98,7 +93,10 @@ describe('table visualization - auto column resizing', () => {

it('Should show tooltips for headers', () => {
// Headers should have tooltips
cy.get('.tableVisContainer').find('thead th .header-text').first().trigger('mouseover');
cy.get('.tableVisContainer')
.find('thead th .header-text')
.first()
.trigger('mouseover');
cy.get('.euiToolTipPopover').should('be.visible');
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ describe('Compare queries', () => {
it('Should get comparison results', () => {
// Navigate directly to single query comparison page
cy.visit(
`${BASE_PATH}/app/${SEARCH_RELEVANCE_PLUGIN_NAME}#/experiment/create/singleQueryComparison`
`${BASE_PATH}/app/${SEARCH_RELEVANCE_PLUGIN_NAME}#/experiment/create/queryAnalysis`
);
cy.wait(5000);

// Type search text in search box
cy.get('input[type="search"]', { timeout: 30000 }).type(SAMPLE_SEARCH_TEXT, {
force: true,
});
cy.get('input[type="search"]', { timeout: 30000 }).type(
SAMPLE_SEARCH_TEXT,
{
force: true,
}
);

// Select index 1
cy.get('div.search-relevance-config:nth-child(1) select').select(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ describe('Query Set Creation', () => {
`${BASE_PATH}/app/${SEARCH_RELEVANCE_PLUGIN_NAME}#/querySet/create`
);
cy.wait(5000); // Increase wait time to ensure form is fully loaded
cy.waitForLoader();
});

it('Should fail query set creation with more than 1000 queries', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ describe('Experiment Create', () => {
`${BASE_PATH}/app/${SEARCH_RELEVANCE_PLUGIN_NAME}#/querySet/create`
);
cy.wait(3000);
cy.waitForLoader();

// Use textarea selector with longer timeout
cy.get('[data-test-subj="querySetDescriptionInput"]')
Expand All @@ -62,7 +61,6 @@ describe('Experiment Create', () => {
`${BASE_PATH}/app/${SEARCH_RELEVANCE_PLUGIN_NAME}#/searchConfiguration/create`
);
cy.wait(3000);
cy.waitForLoader();

cy.get('[data-test-subj="searchConfigurationNameInput"]').type(configName1);
cy.get('[data-test-subj="codeEditorContainer"]').click();
Expand All @@ -81,7 +79,6 @@ describe('Experiment Create', () => {
`${BASE_PATH}/app/${SEARCH_RELEVANCE_PLUGIN_NAME}#/searchConfiguration/create`
);
cy.wait(3000);
cy.waitForLoader();

cy.get('[data-test-subj="searchConfigurationNameInput"]').type(configName2);
cy.get('[data-test-subj="codeEditorContainer"]').click();
Expand All @@ -100,7 +97,6 @@ describe('Experiment Create', () => {
`${BASE_PATH}/app/${SEARCH_RELEVANCE_PLUGIN_NAME}#/judgment/create`
);
cy.wait(3000);
cy.waitForLoader();

cy.get('input[name="name"]').type(judgmentName);
cy.get('select').first().select('UBI_JUDGMENT');
Expand All @@ -120,17 +116,15 @@ describe('Experiment Create', () => {
cy.get('.euiCard').should('have.length', 4);

// Verify each card's title
cy.contains('.euiCard', 'Single Query Comparison').should('exist');
cy.contains('.euiCard', 'Query Analysis').should('exist');
cy.contains('.euiCard', 'Query Set Comparison').should('exist');
cy.contains('.euiCard', 'Search Evaluation').should('exist');
cy.contains('.euiCard', 'Hybrid Search Optimizer').should('exist');
});

it('Should display correct descriptions for each card', () => {
// Verify card descriptions
cy.contains('Test two search configurations with a single query').should(
'exist'
);
cy.contains('Run and analyze a single query').should('exist');
cy.contains('Perform a comparison across an entire set of queries').should(
'exist'
);
Expand All @@ -147,8 +141,8 @@ describe('Experiment Create', () => {

it('Should navigate to correct routes when clicked', () => {
// Click Single Query Comparison card and verify navigation
cy.contains('.euiCard', 'Single Query Comparison').click();
cy.url().should('include', '/experiment/create/singleQueryComparison');
cy.contains('.euiCard', 'Query Analysis').click();
cy.url().should('include', '/experiment/create/queryAnalysis');

// Navigate back and test other cards
cy.go('back');
Expand Down Expand Up @@ -178,7 +172,6 @@ describe('Experiment Create', () => {
`${BASE_PATH}/app/${SEARCH_RELEVANCE_PLUGIN_NAME}#/experiment/create/querySetComparison`
);
cy.wait(3000);
cy.waitForLoader();

// Select query set from dropdown
cy.get('[data-test-subj="comboBoxInput"]').first().click();
Expand Down Expand Up @@ -209,7 +202,6 @@ describe('Experiment Create', () => {
`${BASE_PATH}/app/${SEARCH_RELEVANCE_PLUGIN_NAME}#/experiment/create/searchEvaluation`
);
cy.wait(3000);
cy.waitForLoader();

// Select query set from dropdown
cy.get('[data-test-subj="comboBoxInput"]').first().click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ Cypress.Commands.add('removeIndexAlias', (alias) => {
});
});

Cypress.Commands.add("dismissToast", () => {
cy.get("body").then(($body) => {
Cypress.Commands.add('dismissToast', () => {
cy.get('body').then(($body) => {
if ($body.find(`[data-test-subj="toastCloseButton"]`).length) {
cy.get(`[data-test-subj="toastCloseButton"]`).click({ force: true });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const enableWorkbenchUI = () => {
// Visit the settings page with retry logic
cy.visit('app/management/opensearch-dashboards/settings', { timeout: 20000 });
cy.wait(3000); // Wait for page to stabilize
cy.waitForLoader();

// Check current state of the toggle with increased timeout
cy.get(
Expand Down
Loading