From 3974c877af720da5beb2c6cf93c7d2fdac5118e6 Mon Sep 17 00:00:00 2001
From: braks <78412429+bcakmakoglu@users.noreply.github.com>
Date: Fri, 7 Oct 2022 11:41:39 +0200
Subject: [PATCH] refactor(tests): add cy selectors and update share link test
---
.../smartsheet/toolbar/ShareView.vue | 19 +++++++++-----
.../integration/common/4b_table_view_share.js | 26 +++++++------------
2 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue b/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue
index bd52538985..69411de2e7 100644
--- a/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue
+++ b/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue
@@ -198,7 +198,10 @@ watch(passwordProtected, (value) => {
width="min(100vw,720px)"
wrap-class-name="nc-modal-share-view"
>
-
+
{{ sharedViewUrl }}
@@ -218,8 +221,8 @@ watch(passwordProtected, (value) => {
Use Survey Mode
@@ -227,12 +230,13 @@ watch(passwordProtected, (value) => {
-
+
Use Theme
{
-
{{ $t('msg.info.beforeEnablePwd') }}
+
+ {{ $t('msg.info.beforeEnablePwd') }}
-
+
{{ $t('placeholder.password.save') }}
@@ -268,8 +273,8 @@ watch(passwordProtected, (value) => {
{{ $t('labels.downloadAllowed') }}
diff --git a/scripts/cypress/integration/common/4b_table_view_share.js b/scripts/cypress/integration/common/4b_table_view_share.js
index fa2fe4eeb5..c7757c841f 100644
--- a/scripts/cypress/integration/common/4b_table_view_share.js
+++ b/scripts/cypress/integration/common/4b_table_view_share.js
@@ -12,26 +12,18 @@ const generateLinkWithPwd = () => {
.contains("This view is shared via a private link")
.should("be.visible");
- cy.getActiveModal(".nc-modal-share-view")
- .find(`[data-cy="nc-share-view-checkbox-password"]`)
- .should("exist")
- .click();
- cy.getActiveModal(".nc-modal-share-view")
- .find('input[type="password"]')
- .clear()
- .type("1");
- cy.getActiveModal(".nc-modal-share-view")
- .find('button:contains("Save password")')
- .click();
+ // enable checkbox & feed pwd, save
+ cy.get('[data-cy="nc-modal-share-view__with-password"]').click();
+ cy.get('[data-cy="nc-modal-share-view__password"]').clear().type('1')
+ cy.get('[data-cy="nc-modal-share-view__save-password"]').click();
cy.toastWait("Successfully updated");
// copy link text, visit URL
- cy.getActiveModal(".nc-modal-share-view")
- .find(".nc-share-link-box")
- .then(($obj) => {
- linkText = $obj.text().trim();
- cy.log(linkText);
- });
+ cy.get('[data-cy="nc-modal-share-view__link"]').then(($el) => {
+ linkText = $el.text();
+ // todo: visit url?
+ cy.log(linkText);
+ })
};
export const genTest = (apiType, dbType) => {