From 7eb790384af500a628c2e8aacbee56abe694787b Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 20 Sep 2022 20:05:14 +0530 Subject: [PATCH] chore(cypress): WIP - add test for nested form Signed-off-by: Pranav C --- .../smartsheet/expanded-form/index.vue | 2 +- .../common/4g_table_view_expanded_form.js | 23 ++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/expanded-form/index.vue b/packages/nc-gui/components/smartsheet/expanded-form/index.vue index 468ceb3c91..578c7e392f 100644 --- a/packages/nc-gui/components/smartsheet/expanded-form/index.vue +++ b/packages/nc-gui/components/smartsheet/expanded-form/index.vue @@ -131,7 +131,7 @@ export default {
-
+
{ // spy on clipboard to verify copied text cy.window().then((win) => { cy.spy(win.navigator.clipboard, 'writeText').as('copy'); - }) + }); // copy url cy.get('.nc-copy-row-url').click(); @@ -81,7 +81,8 @@ export const genTest = (apiType, dbType) => { cy.url() .then((url) => { cy.visit('/' + url.split('/').slice(3).join('/').split('?')[0] + '?rowId=2'); - cy.get('.nc-expanded-form-header').should('exist'); + + return cy.get('.nc-expanded-form-header').should('exist'); }); }); @@ -91,11 +92,27 @@ export const genTest = (apiType, dbType) => { cy.visit('/' + url.split('/').slice(3).join('/').split('?')[0] + '?rowId=99999999'); cy.toastWait('Record not found'); cy.get('.nc-expanded-form-header').should('not.exist'); - cy.get(viewType === 'grid' ? '.nc-grid' : '.nc-gallery').should('exist'); + + return cy.get(viewType === 'grid' ? '.nc-grid' : '.nc-gallery').should('exist'); }); }); + it(`Visit a ${viewType} row url and verify nested expanded form`, () => { + cy.url() + .then((url) => { + cy.visit('/' + url.split('/').slice(3).join('/').split('?')[0] + '?rowId=2'); + cy.get('.nc-expanded-form-header').should('exist'); + + cy.get('.nc-form-fields-container').scrollTo(0, 800); + + // todo: click on a LTAR field to open nested expanded form + // and verify copy url functionality + // cy.get('.name:contains("City List")'). + // return cy.wait(100000) + }); + }); + }; viewTest('grid'); // grid view