Skip to content

Commit

Permalink
Fixes tests for vis type persistence change (opensearch-project#600) (o…
Browse files Browse the repository at this point in the history
…pensearch-project#601)

Signed-off-by: Ashwin Pc <[email protected]>
(cherry picked from commit 13d3e2d)

Co-authored-by: Ashwin P Chandran <[email protected]>
Signed-off-by: [email protected] <[email protected]>
  • Loading branch information
2 people authored and leanneeliatra committed Sep 15, 2023
1 parent c1bca3a commit 11bb757
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ if (Cypress.env('VISBUILDER_ENABLED')) {
// Add Vis Builder Visualisation to dashboard
cy.getElementByTestId('dashboardEditMode').click();
cy.getElementByTestId('dashboardAddPanelButton').click();
cy.getElementByTestId('savedObjectFinderSearchInput').type(
`${VB_LINE_VIS_TITLE}{enter}`
);
cy.getElementByTestId('savedObjectFinderFilterButton').click();
cy.getElementByTestId(
'savedObjectFinderFilter-visualization-visbuilder'
).click();
cy.getElementByTestId(
`savedObjectTitle${toTestId(VB_LINE_VIS_TITLE)}`
).click();
Expand Down
6 changes: 4 additions & 2 deletions cypress/utils/dashboards/vis_builder/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Cypress.Commands.add('vbSelectDataSource', (dataSource) => {
.click(opts);
});

Cypress.Commands.add('vbSelectVisType', (type) => {
Cypress.Commands.add('vbSelectVisType', (type, confirm = false) => {
const opts = { log: false };

Cypress.log({
Expand All @@ -32,7 +32,9 @@ Cypress.Commands.add('vbSelectVisType', (type) => {

cy.getElementByTestId('chartPicker', opts).click(opts);
cy.get('[data-test-subj^=visType-', opts).contains(type, opts).click(opts);
cy.getElementByTestId('confirmModalConfirmButton', opts).click(opts);
if (confirm) {
cy.getElementByTestId('confirmModalConfirmButton', opts).click(opts);
}
});

Cypress.Commands.add('vbEditAgg', (fields = []) => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/utils/dashboards/vis_builder/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { BASE_PATH } from '../../base_constants';

export const VB_DEBOUNCE = 200; // Debounce time for VisBuilder fields in ms
export const VB_DEBOUNCE = 300; // Debounce time for VisBuilder fields in ms

export const VB_INDEX_DATA = 'vis-builder.data.txt';
export const VB_INDEX_DOC_COUNT = '10,000';
Expand Down

0 comments on commit 11bb757

Please sign in to comment.