Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] [VisBuilder] Fixes tests for vis type persistence change #601

Merged
merged 1 commit into from
Apr 4, 2023
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 @@ -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