Browse Source

chore(cypress): improve menu selection by filtering by unique classname

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3597/head
Pranav C 2 years ago
parent
commit
1e436f6651
  1. 3
      packages/nc-gui/components/smartsheet-toolbar/ColumnFilter.vue
  2. 11
      scripts/cypress/support/commands.js

3
packages/nc-gui/components/smartsheet-toolbar/ColumnFilter.vue

@ -158,6 +158,7 @@ defineExpose({
placeholder="Group op"
@click.stop
@change="saveOrUpdate(filter, i)"
dropdown-class-name="nc-dropdown-filter-logical-op-group"
>
<a-select-option v-for="op in logicalOps" :key="op.value" :value="op.value" class="">
{{ op.text }}
@ -205,6 +206,7 @@ defineExpose({
:disabled="filter.readOnly"
@click.stop
@change="filterUpdateCondition(filter, i)"
dropdown-class-name="nc-dropdown-filter-logical-op"
>
<a-select-option v-for="op in logicalOps" :key="op.value" :value="op.value">
{{ op.text }}
@ -231,6 +233,7 @@ defineExpose({
:disabled="filter.readOnly"
hide-details
@change="filterUpdateCondition(filter, i)"
dropdown-class-name="nc-dropdown-filter-comp-op"
>
<a-select-option v-for="compOp in comparisonOpList" :key="compOp.value" :value="compOp.value" class="">
{{ compOp.text }}

11
scripts/cypress/support/commands.js

@ -286,9 +286,9 @@ Cypress.Commands.add('getActiveModal', () => {
return cy.get('.ant-modal-content:visible').last();
});
Cypress.Commands.add('getActiveMenu', (overlayClassName) => {
if (overlayClassName) {
return cy.get(`${overlayClassName} .ant-dropdown-content:visible`);
Cypress.Commands.add('getActiveMenu', (overlaySelector) => {
if (overlaySelector) {
return cy.get(`${overlaySelector} .ant-dropdown-content:visible`);
}
return cy.get('.ant-dropdown-content:visible').last();
});
@ -297,7 +297,10 @@ Cypress.Commands.add('getActivePopUp', () => {
return cy.get('.ant-menu-submenu-popup:visible').last();
});
Cypress.Commands.add('getActiveSelection', () => {
Cypress.Commands.add('getActiveSelection', (selector) => {
if(selector) {
return cy.get(`${selector}.ant-select-dropdown:visible`).last();
}
return cy.get('.ant-select-dropdown:visible').last();
});

Loading…
Cancel
Save