Browse Source

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

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3597/head
Pranav C 2 years ago
parent
commit
6c8171dd5b
  1. 3
      packages/nc-gui/components/general/HelpAndSupport.vue
  2. 1
      packages/nc-gui/components/smartsheet/expanded-form/index.vue
  3. 8
      scripts/cypress/integration/common/8a_webhook.js
  4. 5
      scripts/cypress/support/commands.js

3
packages/nc-gui/components/general/HelpAndSupport.vue

@ -27,11 +27,12 @@ const openSwaggerLink = () => {
<a-drawer
v-bind="$attrs"
v-model:visible="showDrawer"
class="h-full relative"
class="h-full relative nc-help-and-support"
placement="right"
size="small"
:closable="false"
:body-style="{ padding: '12px 24px 0 24px', background: '#fafafa' }"
>
<div class="flex flex-col w-full h-full p-4 pb-0">
<!-- Help center -->

1
packages/nc-gui/components/smartsheet/expanded-form/index.vue

@ -108,6 +108,7 @@ export default {
width="min(90vw,1000px)"
:body-style="{ 'padding': 0, 'display': 'flex', 'flex-direction': 'column' }"
:closable="false"
class="nc-drawer-expanded-form"
>
<Header @cancel="onClose" />
<div class="!bg-gray-100 rounded flex-1">

8
scripts/cypress/integration/common/8a_webhook.js

@ -161,12 +161,12 @@ function addNewRow(index, cellValue) {
cy.get(".nc-add-new-row-btn").click();
cy.wait(1000);
cy.get(".nc-expand-col-Title").find(".nc-cell > input").first().type(cellValue);
cy.getActiveDrawer()
cy.getActiveDrawer('.nc-drawer-expanded-form')
.find(".ant-btn-primary")
.click();
cy.toastWait("updated successfully");
cy.getActiveDrawer()
cy.getActiveDrawer('.nc-drawer-expanded-form')
.find(".ant-btn")
.contains("Cancel")
.click();
@ -184,14 +184,14 @@ function updateRow(index, cellValue) {
.clear()
.type(cellValue);
cy.getActiveDrawer()
cy.getActiveDrawer('.nc-drawer-expanded-form')
.find("button")
.contains("Save row")
.click({ force: true });
// partial toast message
cy.toastWait("updated successfully");
cy.getActiveDrawer()
cy.getActiveDrawer('.nc-drawer-expanded-form')
.find("button")
.contains("Cancel")
.click({ force: true });

5
scripts/cypress/support/commands.js

@ -304,7 +304,10 @@ Cypress.Commands.add('getActiveSelection', (selector) => {
return cy.get('.ant-select-dropdown:visible').last();
});
Cypress.Commands.add('getActiveDrawer', () => {
Cypress.Commands.add('getActiveDrawer', (selector) => {
if(selector) {
return cy.get(`${selector} .ant-drawer-content:visible`).last();
}
return cy.get('.ant-drawer-content:visible').last();
});

Loading…
Cancel
Save