mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
test: add native filter e2e test part3 (#17343)
* add 2 stable test * fix lint
This commit is contained in:
parent
d0085b1b29
commit
ab1fcf3068
@ -195,6 +195,99 @@ describe('Nativefilters Sanity test', () => {
|
|||||||
.click();
|
.click();
|
||||||
cy.get(nativeFilters.modal.container).should('not.exist');
|
cy.get(nativeFilters.modal.container).should('not.exist');
|
||||||
});
|
});
|
||||||
|
it('User can undo deleting a native filter', () => {
|
||||||
|
cy.get(nativeFilters.filterFromDashboardView.expand)
|
||||||
|
.should('be.visible')
|
||||||
|
.click();
|
||||||
|
cy.get(nativeFilters.createFilterButton).should('be.visible').click();
|
||||||
|
cy.get(nativeFilters.modal.container).should('be.visible');
|
||||||
|
cy.get(nativeFilters.modal.container)
|
||||||
|
.find(nativeFilters.filtersPanel.filterName)
|
||||||
|
.click()
|
||||||
|
.type('Country name');
|
||||||
|
cy.get(nativeFilters.modal.container)
|
||||||
|
.find(nativeFilters.filtersPanel.datasetName)
|
||||||
|
.click()
|
||||||
|
.type("World Bank's Data{enter}");
|
||||||
|
|
||||||
|
cy.get('.loading inline-centered css-101mkpk').should('not.exist');
|
||||||
|
// hack for unclickable country_name
|
||||||
|
cy.wait(5000);
|
||||||
|
cy.get(nativeFilters.filtersPanel.filterInfoInput)
|
||||||
|
.last()
|
||||||
|
.should('be.visible')
|
||||||
|
.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.get(nativeFilters.modal.footer)
|
||||||
|
.contains('Save')
|
||||||
|
.should('be.visible')
|
||||||
|
.click();
|
||||||
|
cy.get(nativeFilters.filterFromDashboardView.filterName)
|
||||||
|
.should('be.visible')
|
||||||
|
.contains('Country name');
|
||||||
|
cy.get(nativeFilters.createFilterButton).should('be.visible').click();
|
||||||
|
cy.get(nativeFilters.modal.container).should('be.visible');
|
||||||
|
cy.get(nativeFilters.filtersList.removeIcon).first().click();
|
||||||
|
cy.contains('Undo?').click();
|
||||||
|
});
|
||||||
|
it('Verify setting options and tooltips for value filter', () => {
|
||||||
|
cy.get(nativeFilters.filterFromDashboardView.expand).click({ force: true });
|
||||||
|
cy.get(nativeFilters.createFilterButton).should('be.visible').click();
|
||||||
|
cy.get(nativeFilters.modal.container).should('be.visible');
|
||||||
|
cy.get(nativeFilters.filterConfigurationSections.collapseExpandButton)
|
||||||
|
.last()
|
||||||
|
.click();
|
||||||
|
[
|
||||||
|
'Filter has default value',
|
||||||
|
'Multiple select',
|
||||||
|
'Required',
|
||||||
|
'Filter is hierarchical',
|
||||||
|
'Default to first item',
|
||||||
|
'Inverse selection',
|
||||||
|
'Search all filter options',
|
||||||
|
'Pre-filter available values',
|
||||||
|
'Sort filter values',
|
||||||
|
].forEach(el => {
|
||||||
|
cy.contains(el);
|
||||||
|
});
|
||||||
|
cy.get(nativeFilters.filterConfigurationSections.checkedCheckbox).contains(
|
||||||
|
'Multiple select',
|
||||||
|
);
|
||||||
|
cy.get(nativeFilters.filterConfigurationSections.infoTooltip)
|
||||||
|
.eq(0)
|
||||||
|
.trigger('mouseover');
|
||||||
|
cy.contains('Allow selecting multiple values');
|
||||||
|
|
||||||
|
cy.get(nativeFilters.filterConfigurationSections.infoTooltip)
|
||||||
|
.eq(1)
|
||||||
|
.trigger('mouseover');
|
||||||
|
cy.contains('User must select a value before applying the filter');
|
||||||
|
|
||||||
|
cy.get(nativeFilters.filterConfigurationSections.infoTooltip)
|
||||||
|
.eq(2)
|
||||||
|
.trigger('mouseover');
|
||||||
|
cy.contains(
|
||||||
|
'Select first item by default (when using this option, default value can’t be set)',
|
||||||
|
);
|
||||||
|
|
||||||
|
cy.get(nativeFilters.filterConfigurationSections.infoTooltip)
|
||||||
|
.eq(3)
|
||||||
|
.trigger('mouseover');
|
||||||
|
cy.contains('Exclude selected values');
|
||||||
|
|
||||||
|
cy.get(nativeFilters.filterConfigurationSections.infoTooltip)
|
||||||
|
.eq(4)
|
||||||
|
.trigger('mouseover');
|
||||||
|
cy.contains(
|
||||||
|
'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).',
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
xdescribe('Nativefilters', () => {
|
xdescribe('Nativefilters', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user