mirror of https://github.com/apache/superset.git
test: add native filter default value e2e (#17398)
* add native filter default value e2e test * fix lint * remove unnecessary check
This commit is contained in:
parent
96bdcc3493
commit
1e2c83419c
|
@ -93,9 +93,7 @@ describe('Nativefilters Sanity test', () => {
|
||||||
cy.get(nativeFilters.modal.container).should('be.visible');
|
cy.get(nativeFilters.modal.container).should('be.visible');
|
||||||
});
|
});
|
||||||
it('User can add a new native filter', () => {
|
it('User can add a new native filter', () => {
|
||||||
cy.get(nativeFilters.filterFromDashboardView.expand)
|
cy.get(nativeFilters.filterFromDashboardView.expand).click({ force: true });
|
||||||
.should('be.visible')
|
|
||||||
.click();
|
|
||||||
cy.get(nativeFilters.createFilterButton).should('be.visible').click();
|
cy.get(nativeFilters.createFilterButton).should('be.visible').click();
|
||||||
cy.get(nativeFilters.modal.container)
|
cy.get(nativeFilters.modal.container)
|
||||||
.find(nativeFilters.filtersPanel.filterName)
|
.find(nativeFilters.filtersPanel.filterName)
|
||||||
|
@ -208,7 +206,7 @@ describe('Nativefilters Sanity test', () => {
|
||||||
cy.get(nativeFilters.modal.container)
|
cy.get(nativeFilters.modal.container)
|
||||||
.find(nativeFilters.filtersPanel.datasetName)
|
.find(nativeFilters.filtersPanel.datasetName)
|
||||||
.click()
|
.click()
|
||||||
.type("World Bank's Data{enter}");
|
.type('wb_health_population{enter}');
|
||||||
|
|
||||||
cy.get('.loading inline-centered css-101mkpk').should('not.exist');
|
cy.get('.loading inline-centered css-101mkpk').should('not.exist');
|
||||||
// hack for unclickable country_name
|
// hack for unclickable country_name
|
||||||
|
@ -288,6 +286,50 @@ describe('Nativefilters Sanity test', () => {
|
||||||
'By default, each filter loads at most 1000 choices at the initial page load. Check this box if you have more than 1000 filter values and want to enable dynamically searching that loads filter values as users type (may add stress to your database).',
|
'By default, each filter loads at most 1000 choices at the initial page load. Check this box if you have more than 1000 filter values and want to enable dynamically searching that loads filter values as users type (may add stress to your database).',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
it("User can check 'Filter has default value'", () => {
|
||||||
|
cy.get(nativeFilters.filterFromDashboardView.expand).click({ force: true });
|
||||||
|
cy.get(nativeFilters.createFilterButton)
|
||||||
|
.should('be.visible')
|
||||||
|
.click({ force: true });
|
||||||
|
cy.get(nativeFilters.modal.container).should('be.visible');
|
||||||
|
|
||||||
|
cy.get(nativeFilters.modal.container)
|
||||||
|
.find(nativeFilters.filtersPanel.datasetName)
|
||||||
|
.click()
|
||||||
|
.type('wb_health_population{enter}');
|
||||||
|
cy.get(nativeFilters.modal.container)
|
||||||
|
.find(nativeFilters.filtersPanel.filterName)
|
||||||
|
.click()
|
||||||
|
.type('country_name');
|
||||||
|
// hack for unclickable datetime
|
||||||
|
cy.wait(5000);
|
||||||
|
cy.get(nativeFilters.filtersPanel.filterInfoInput)
|
||||||
|
.last()
|
||||||
|
.click({ force: true });
|
||||||
|
cy.get(nativeFilters.filtersPanel.filterInfoInput)
|
||||||
|
.last()
|
||||||
|
.type('country_name');
|
||||||
|
cy.get(nativeFilters.filtersPanel.inputDropdown)
|
||||||
|
.should('be.visible', { timeout: 20000 })
|
||||||
|
.last()
|
||||||
|
.click();
|
||||||
|
cy.contains('Filter has default value').click();
|
||||||
|
cy.contains('Default value is required');
|
||||||
|
cy.get(nativeFilters.modal.defaultValueCheck).should('be.visible');
|
||||||
|
cy.get(nativeFilters.filtersPanel.columnEmptyInput)
|
||||||
|
.last()
|
||||||
|
.type('United States{enter}');
|
||||||
|
cy.get(nativeFilters.modal.footer)
|
||||||
|
.find(nativeFilters.modal.saveButton)
|
||||||
|
.should('be.visible')
|
||||||
|
.click({ force: true });
|
||||||
|
cy.get(nativeFilters.filterFromDashboardView.filterContent).contains(
|
||||||
|
'United States',
|
||||||
|
);
|
||||||
|
cy.get('.line').within(() => {
|
||||||
|
cy.contains('United States').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
xdescribe('Nativefilters', () => {
|
xdescribe('Nativefilters', () => {
|
||||||
|
|
|
@ -325,6 +325,7 @@ export const nativeFilters = {
|
||||||
removeTab: '[aria-label="trash"]',
|
removeTab: '[aria-label="trash"]',
|
||||||
},
|
},
|
||||||
addFilter: dataTestLocator('add-filter-button'),
|
addFilter: dataTestLocator('add-filter-button'),
|
||||||
|
defaultValueCheck: '.ant-checkbox-checked',
|
||||||
},
|
},
|
||||||
filtersPanel: {
|
filtersPanel: {
|
||||||
filterName: dataTestLocator('filters-config-modal__name-input'),
|
filterName: dataTestLocator('filters-config-modal__name-input'),
|
||||||
|
@ -339,6 +340,7 @@ export const nativeFilters = {
|
||||||
expand: dataTestLocator('filter-bar__expand-button'),
|
expand: dataTestLocator('filter-bar__expand-button'),
|
||||||
collapse: dataTestLocator('filter-bar__collapse-button'),
|
collapse: dataTestLocator('filter-bar__collapse-button'),
|
||||||
filterName: dataTestLocator('filter-control-name'),
|
filterName: dataTestLocator('filter-control-name'),
|
||||||
|
filterContent: '.ant-select-selection-item-content',
|
||||||
},
|
},
|
||||||
createFilterButton: dataTestLocator('filter-bar__create-filter'),
|
createFilterButton: dataTestLocator('filter-bar__create-filter'),
|
||||||
removeFilter: '[aria-label="remove"]',
|
removeFilter: '[aria-label="remove"]',
|
||||||
|
|
Loading…
Reference in New Issue