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

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

@ -108,6 +108,7 @@ export default {
width="min(90vw,1000px)" width="min(90vw,1000px)"
:body-style="{ 'padding': 0, 'display': 'flex', 'flex-direction': 'column' }" :body-style="{ 'padding': 0, 'display': 'flex', 'flex-direction': 'column' }"
:closable="false" :closable="false"
class="nc-drawer-expanded-form"
> >
<Header @cancel="onClose" /> <Header @cancel="onClose" />
<div class="!bg-gray-100 rounded flex-1"> <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.get(".nc-add-new-row-btn").click();
cy.wait(1000); cy.wait(1000);
cy.get(".nc-expand-col-Title").find(".nc-cell > input").first().type(cellValue); 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") .find(".ant-btn-primary")
.click(); .click();
cy.toastWait("updated successfully"); cy.toastWait("updated successfully");
cy.getActiveDrawer() cy.getActiveDrawer('.nc-drawer-expanded-form')
.find(".ant-btn") .find(".ant-btn")
.contains("Cancel") .contains("Cancel")
.click(); .click();
@ -184,14 +184,14 @@ function updateRow(index, cellValue) {
.clear() .clear()
.type(cellValue); .type(cellValue);
cy.getActiveDrawer() cy.getActiveDrawer('.nc-drawer-expanded-form')
.find("button") .find("button")
.contains("Save row") .contains("Save row")
.click({ force: true }); .click({ force: true });
// partial toast message // partial toast message
cy.toastWait("updated successfully"); cy.toastWait("updated successfully");
cy.getActiveDrawer() cy.getActiveDrawer('.nc-drawer-expanded-form')
.find("button") .find("button")
.contains("Cancel") .contains("Cancel")
.click({ force: true }); .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(); 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(); return cy.get('.ant-drawer-content:visible').last();
}); });

Loading…
Cancel
Save