From 6a3c46093966281f97c9bd80e20606de603fa91d Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Sun, 11 Aug 2024 20:45:19 +0000 Subject: [PATCH 1/6] fix: config file to disable reva remote host ip discovery --- docker/configs/revad/sciencemesh.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/configs/revad/sciencemesh.toml b/docker/configs/revad/sciencemesh.toml index d0f8aec4..25210435 100644 --- a/docker/configs/revad/sciencemesh.toml +++ b/docker/configs/revad/sciencemesh.toml @@ -183,7 +183,7 @@ refresh = 900 [grpc.services.ocmproviderauthorizer.drivers.json] # this is used by the docker-based test deployment, not in production providers = "/etc/revad/providers.testnet.json" -verify_request_hostname = true +verify_request_hostname = false [grpc.services.userprovider] driver = "nextcloud" From 67cd38111528eab7f4078e88112c2518c4c83812 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Sun, 11 Aug 2024 20:45:31 +0000 Subject: [PATCH 2/6] fix: bug in the ocm path --- dev/ocm-test-suite/invite-link/nextcloud-ocis.sh | 4 ++-- dev/ocm-test-suite/invite-link/ocis-nextcloud.sh | 4 ++-- dev/ocm-test-suite/invite-link/ocis-owncloud.sh | 4 ++-- dev/ocm-test-suite/invite-link/owncloud-ocis.sh | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dev/ocm-test-suite/invite-link/nextcloud-ocis.sh b/dev/ocm-test-suite/invite-link/nextcloud-ocis.sh index a19601f2..5fc22b23 100755 --- a/dev/ocm-test-suite/invite-link/nextcloud-ocis.sh +++ b/dev/ocm-test-suite/invite-link/nextcloud-ocis.sh @@ -230,8 +230,8 @@ changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance1--webdav--ho changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--domain--|" "revanextcloud1.docker" changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--homepage--|" "revanextcloud1.docker" -changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--|" "revanextcloud1.docker/ocm/" -changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--path--|" "revanextcloud1.docker" +changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--|" "revanextcloud1.docker" +changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--path--|" "revanextcloud1.docker/ocm/" changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--host--|" "revanextcloud1.docker" changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--webdav--|" "nextcloud1.docker" changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--webdav--path--|" "nextcloud1.docker/remote.php/webdav/" diff --git a/dev/ocm-test-suite/invite-link/ocis-nextcloud.sh b/dev/ocm-test-suite/invite-link/ocis-nextcloud.sh index d3f02a44..aca61992 100755 --- a/dev/ocm-test-suite/invite-link/ocis-nextcloud.sh +++ b/dev/ocm-test-suite/invite-link/ocis-nextcloud.sh @@ -230,8 +230,8 @@ changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance1--webdav--ho changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--domain--|" "revanextcloud1.docker" changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--homepage--|" "revanextcloud1.docker" -changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--|" "revanextcloud1.docker/ocm/" -changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--path--|" "revanextcloud1.docker" +changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--|" "revanextcloud1.docker" +changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--path--|" "revanextcloud1.docker/ocm/" changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--host--|" "revanextcloud1.docker" changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--webdav--|" "nextcloud1.docker" changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--webdav--path--|" "nextcloud1.docker/remote.php/webdav/" diff --git a/dev/ocm-test-suite/invite-link/ocis-owncloud.sh b/dev/ocm-test-suite/invite-link/ocis-owncloud.sh index 24df0603..221f2513 100755 --- a/dev/ocm-test-suite/invite-link/ocis-owncloud.sh +++ b/dev/ocm-test-suite/invite-link/ocis-owncloud.sh @@ -229,8 +229,8 @@ changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance1--webdav--ho changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--domain--|" "revaowncloud1.docker" changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--homepage--|" "revaowncloud1.docker" -changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--|" "revaowncloud1.docker/ocm/" -changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--path--|" "revaowncloud1.docker" +changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--|" "revaowncloud1.docker" +changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--path--|" "revaowncloud1.docker/ocm/" changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--host--|" "revaowncloud1.docker" changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--webdav--|" "owncloud1.docker" changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--webdav--path--|" "owncloud1.docker/remote.php/webdav/" diff --git a/dev/ocm-test-suite/invite-link/owncloud-ocis.sh b/dev/ocm-test-suite/invite-link/owncloud-ocis.sh index 2fc103e7..409ce358 100755 --- a/dev/ocm-test-suite/invite-link/owncloud-ocis.sh +++ b/dev/ocm-test-suite/invite-link/owncloud-ocis.sh @@ -230,8 +230,8 @@ changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance1--webdav--ho changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--domain--|" "revaowncloud1.docker" changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--homepage--|" "revaowncloud1.docker" -changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--|" "revaowncloud1.docker/ocm/" -changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--path--|" "revaowncloud1.docker" +changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--|" "revaowncloud1.docker" +changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--path--|" "revaowncloud1.docker/ocm/" changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--ocm--host--|" "revaowncloud1.docker" changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--webdav--|" "owncloud1.docker" changeInFile "${ENV_ROOT}/temp/ocis/ocmproviders.json" "|--instance2--webdav--path--|" "owncloud1.docker/remote.php/webdav/" From 4c3b31f8206a9eb52903fa9c315ee746b80f790f Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Mon, 12 Aug 2024 17:27:37 +0000 Subject: [PATCH 3/6] fix: ocis to oc/nc invite flow --- .../invite-link/nextcloud-v27-to-ocis-5.cy.js | 28 ++++---- .../invite-link/owncloud-v10-to-ocis-5.cy.js | 68 +++++-------------- .../cypress/e2e/utils/nextcloud-v27.js | 29 +++++++- .../cypress/e2e/utils/ocis-5.js | 4 +- .../cypress/e2e/utils/owncloud.js | 4 +- 5 files changed, 61 insertions(+), 72 deletions(-) diff --git a/cypress/ocm-test-suite/cypress/e2e/invite-link/nextcloud-v27-to-ocis-5.cy.js b/cypress/ocm-test-suite/cypress/e2e/invite-link/nextcloud-v27-to-ocis-5.cy.js index d18b7171..3514d6ba 100644 --- a/cypress/ocm-test-suite/cypress/e2e/invite-link/nextcloud-v27-to-ocis-5.cy.js +++ b/cypress/ocm-test-suite/cypress/e2e/invite-link/nextcloud-v27-to-ocis-5.cy.js @@ -1,12 +1,12 @@ import { - verifyFederatedContactV27, + createInviteTokenV27, createScienceMeshShareV27, renameFileV27 } from '../utils/nextcloud-v27' import { - openScienceMeshAppV5, - createLegacyInviteLinkV5, + acceptInviteLinkV5, + verifyFederatedContactV5, acceptShareV5, verifyShareV5 } from '../utils/ocis-5' @@ -14,11 +14,10 @@ import { describe('Invite link federated sharing via ScienceMesh functionality for oCIS', () => { it('Send invitation from Nextcloud v27 to oCIS v5', () => { - cy.loginOcis('https://ocis1.docker', 'einstein', 'relativity') - - openScienceMeshAppV5() + cy.loginNextcloud('https://nextcloud1.docker', 'marie', 'radioactivity') + cy.visit('https://nextcloud1.docker/index.php/apps/sciencemesh/contacts') - createLegacyInviteLinkV5('nextcloud1.docker', 'ocis1.docker').then( + createInviteTokenV27('revanextcloud1.docker').then( (result) => { // save invite link to file. cy.writeFile('invite-link-nc-ocis.txt', result) @@ -28,17 +27,14 @@ describe('Invite link federated sharing via ScienceMesh functionality for oCIS', it('Accept invitation from Nextcloud v27 to oCIS v5', () => { - // load invite link from file. - cy.readFile('invite-link-nc-ocis.txt').then((url) => { + // load invite token from file. + cy.readFile('invite-link-nc-ocis.txt').then((token) => { - // accept invitation from Nextcloud 1. - cy.loginNextcloudCore(url, 'marie', 'radioactivity') + cy.loginOcis('https://ocis1.docker', 'einstein', 'relativity') - cy.get('input[id="accept-button"]', { timeout: 10000 }) - .click() + acceptInviteLinkV5(token) - // validate 'Albert Einstein' is shown as a contact. - verifyFederatedContactV27('nextcloud1.docker', 'Albert Einstein', 'ocis1.docker') + verifyFederatedContactV5('marie', 'revanextcloud1.docker') }) }) @@ -47,7 +43,7 @@ describe('Invite link federated sharing via ScienceMesh functionality for oCIS', cy.loginNextcloud('https://nextcloud1.docker', 'marie', 'radioactivity') renameFileV27('welcome.txt', 'invite-link-nc-ocis.txt') - createScienceMeshShareV27('nextcloud1.docker', 'Albert Einstein', 'ocis1.docker', 'invite-link-nc-ocis.txt') + createScienceMeshShareV27('nextcloud1.docker', 'Albert Einstein', 'https://ocis1.docker', 'invite-link-nc-ocis.txt') }) it('Receive ScienceMesh share from Nextcloud v27 to oCIS v5', () => { diff --git a/cypress/ocm-test-suite/cypress/e2e/invite-link/owncloud-v10-to-ocis-5.cy.js b/cypress/ocm-test-suite/cypress/e2e/invite-link/owncloud-v10-to-ocis-5.cy.js index 9845d8f4..89f16404 100644 --- a/cypress/ocm-test-suite/cypress/e2e/invite-link/owncloud-v10-to-ocis-5.cy.js +++ b/cypress/ocm-test-suite/cypress/e2e/invite-link/owncloud-v10-to-ocis-5.cy.js @@ -1,71 +1,39 @@ -import { createInviteToken, createScienceMeshShare, renameFile } from '../utils/owncloud' import { - openScienceMeshAppV5, - createLegacyInviteLinkV5, + createInviteToken, + createScienceMeshShare, + renameFile +} from '../utils/owncloud' +import { + acceptInviteLinkV5, + verifyFederatedContactV5, acceptShareV5, verifyShareV5 } from '../utils/ocis-5' describe('Invite link federated sharing via ScienceMesh functionality for ownCloud', () => { - // Temporary diablle this scenario beacuase of: https://github.com/pondersource/dev-stock/issues/129#issuecomment-2254133337 - // until that issue resolves, try to initiate invites from oCIS. - // it('Send invitation from ownCloud v10 to oCIS v5', () => { - - // cy.loginOwncloud('https://owncloud1.docker', 'marie', 'radioactivity') - // cy.visit('https://owncloud1.docker/index.php/apps/sciencemesh/') - - // createInviteToken('revaowncloud1.docker').then( - // (result) => { - // // save invite link to file. - // cy.writeFile('invite-link-oc-ocis.txt', result) - // } - // ) - // }) - - // it('Accept invitation from ownCloud v10 to oCIS v5', () => { - - // // load invite token from file. - // cy.readFile('invite-link-oc-ocis.txt').then((token) => { - - // cy.loginOcis('https://ocis1.docker', 'einstein', 'relativity') - - // acceptInviteLinkV5(token) + it('Send invitation from ownCloud v10 to oCIS v5', () => { - // verifyFederatedContactV5('marie', 'revaowncloud1.docker') - // }) - // }) - - it('Send invitation from oCIS v5 to ownCloud v10', () => { - - cy.loginOcis('https://ocis1.docker', 'einstein', 'relativity') - - openScienceMeshAppV5() + cy.loginOwncloud('https://owncloud1.docker', 'marie', 'radioactivity') + cy.visit('https://owncloud1.docker/index.php/apps/sciencemesh/') - createLegacyInviteLinkV5('owncloud1.docker', 'ocis1.docker').then( + createInviteToken('revaowncloud1.docker').then( (result) => { // save invite link to file. - cy.writeFile('invite-link-ocis-oc.txt', result) + cy.writeFile('invite-link-oc-ocis.txt', result) } ) }) - it('Accept invitation from oCIS v5 to ownCloud v10', () => { - - // load invite link from file. - cy.readFile('invite-link-ocis-oc.txt').then((url) => { + it('Accept invitation from ownCloud v10 to oCIS v5', () => { - // accept invitation from ownCloud 1. - cy.loginOwncloudCore(url, 'marie', 'radioactivity') + // load invite token from file. + cy.readFile('invite-link-oc-ocis.txt').then((token) => { - cy.get('input[id="accept-button"]', { timeout: 10000 }) - .click() + cy.loginOcis('https://ocis1.docker', 'einstein', 'relativity') - // validate 'Albert Einstein' is shown as a contact. - cy.visit('https://owncloud1.docker/index.php/apps/sciencemesh/contacts') + acceptInviteLinkV5(token) - cy.get('table[id="contact-table"]') - .find('p[class="displayname"]') - .should("have.text", "Albert Einstein"); + verifyFederatedContactV5('marie', 'revaowncloud1.docker') }) }) diff --git a/cypress/ocm-test-suite/cypress/e2e/utils/nextcloud-v27.js b/cypress/ocm-test-suite/cypress/e2e/utils/nextcloud-v27.js index 71fb5b55..7a2d7350 100644 --- a/cypress/ocm-test-suite/cypress/e2e/utils/nextcloud-v27.js +++ b/cypress/ocm-test-suite/cypress/e2e/utils/nextcloud-v27.js @@ -39,9 +39,25 @@ export function createShareLinkV27(fileName) { }) } +export function createInviteTokenV27(senderDomain) { + + cy.get('button[id="token-generator"]').should('be.visible').click() + + return cy.get('input[class="generated-token-link"]') + .invoke('val') + .then( + sometext => { + // extract token from url. + const token = sometext.replace('https://meshdir.docker/meshdir?token=', ''); + + return token.replace(`&providerDomain=${senderDomain}`, '') + } + ); +} + export function createInviteLinkV27(targetDomain) { - cy.get('button[id="token-generator"]').click() + cy.get('button[id="token-generator"]').should('be.visible').click() return cy.get('input[class="generated-token-link"]') .invoke('val') @@ -95,7 +111,16 @@ export function getScienceMeshContactIdFromDisplayNameV27(domain, displayName, c .invoke('text') .then( usernameWithDomain => { - return usernameWithDomain + // get the index of the last @ + var lastIndex = usernameWithDomain.lastIndexOf('@'); + var username = usernameWithDomain.substr(0, lastIndex) + var domain = usernameWithDomain.substr(lastIndex) + + // remove https:// or http:// from domain (reva likes to show username@https://domain sometimes) + // I'm too afraid to explain the regex here let's just say its from here: + domain = domain.replace(/^\/\/|^.*?:(\/\/)?/, ''); + + return username + '@' + domain } ) } diff --git a/cypress/ocm-test-suite/cypress/e2e/utils/ocis-5.js b/cypress/ocm-test-suite/cypress/e2e/utils/ocis-5.js index 05a2f384..93245706 100644 --- a/cypress/ocm-test-suite/cypress/e2e/utils/ocis-5.js +++ b/cypress/ocm-test-suite/cypress/e2e/utils/ocis-5.js @@ -58,9 +58,9 @@ export function acceptInviteLinkV5(token) { }) getScienceMeshAcceptInvitePartV5('label', 'institution').within(() => { - cy.get('div[class="vs__actions"').click() + cy.get('div[class="vs__actions"').should('be.visible').click() - cy.get('ul[role="listbox"]').find('li').first().click() + cy.get('ul[role="listbox"]').find('li').first().should('be.visible').click() }) getScienceMeshAcceptInvitePartV5('span', 'accept').click() diff --git a/cypress/ocm-test-suite/cypress/e2e/utils/owncloud.js b/cypress/ocm-test-suite/cypress/e2e/utils/owncloud.js index 30faad31..92f77595 100644 --- a/cypress/ocm-test-suite/cypress/e2e/utils/owncloud.js +++ b/cypress/ocm-test-suite/cypress/e2e/utils/owncloud.js @@ -64,7 +64,7 @@ export function createShareLink(fileName) { export function createInviteToken(senderDomain) { - cy.get('button[id="token-generator"]').click() + cy.get('button[id="token-generator"]').should('be.visible').click() return cy.get('input[class="generated-token-link"]') .invoke('val') @@ -80,7 +80,7 @@ export function createInviteToken(senderDomain) { export function createInviteLink(targetDomain) { - cy.get('button[id="token-generator"]').click() + cy.get('button[id="token-generator"]').should('be.visible').click() return cy.get('input[class="generated-token-link"]') .invoke('val') From b02ba91cbc5c9ed7bab2d7b9ab1f4b33858b9053 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Mon, 12 Aug 2024 17:34:41 +0000 Subject: [PATCH 4/6] add: link to stackoverflow regex answer --- cypress/ocm-test-suite/cypress/e2e/utils/nextcloud-v27.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/ocm-test-suite/cypress/e2e/utils/nextcloud-v27.js b/cypress/ocm-test-suite/cypress/e2e/utils/nextcloud-v27.js index 7a2d7350..322d5c9f 100644 --- a/cypress/ocm-test-suite/cypress/e2e/utils/nextcloud-v27.js +++ b/cypress/ocm-test-suite/cypress/e2e/utils/nextcloud-v27.js @@ -117,7 +117,7 @@ export function getScienceMeshContactIdFromDisplayNameV27(domain, displayName, c var domain = usernameWithDomain.substr(lastIndex) // remove https:// or http:// from domain (reva likes to show username@https://domain sometimes) - // I'm too afraid to explain the regex here let's just say its from here: + // I'm too afraid to explain the regex here let's just say its from here: https://stackoverflow.com/a/8206299/8549230 domain = domain.replace(/^\/\/|^.*?:(\/\/)?/, ''); return username + '@' + domain From a50814cedfe6f074e60ff582e2561d54db9a6e6e Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Mon, 12 Aug 2024 17:46:28 +0000 Subject: [PATCH 5/6] fix: owncloud clicking problem with file actions --- cypress/ocm-test-suite/cypress/e2e/utils/owncloud.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cypress/ocm-test-suite/cypress/e2e/utils/owncloud.js b/cypress/ocm-test-suite/cypress/e2e/utils/owncloud.js index 92f77595..b0a97cbc 100644 --- a/cypress/ocm-test-suite/cypress/e2e/utils/owncloud.js +++ b/cypress/ocm-test-suite/cypress/e2e/utils/owncloud.js @@ -19,6 +19,7 @@ export function createShare(fileName, username, domain) { // ensure selecting remote, instead of email or group. cy.get('*[class^=ui-autocomplete]') .contains('span[class="autocomplete-item-typeInfo"]', 'Federated') + .should('be.visible') .click() } @@ -35,6 +36,7 @@ export function createShareGroup(fileName, group) { // ensure selecting remote, instead of email or group. cy.get('*[class^=ui-autocomplete]') .contains('span[class="autocomplete-item-typeInfo"]', 'Group') + .should('be.visible') .click() } @@ -48,6 +50,7 @@ export function createShareLink(fileName) { .should('be.visible') .find('*[class^="oc-dialog-buttonrow"]') .find('button[class="primary"]') + .should('be.visible') .click() return cy.get('*[data-original-title^="Copy to clipboard"]') @@ -129,16 +132,17 @@ export function openSharingPanel(fileName) { cy.get('#app-sidebar') .get('[data-tabid="shareTabView"]') + .should('be.visible') .click() } export function triggerActionInFileMenu (fileName, actionId) { triggerActionForFile(fileName,'menu') - getRowForFile(fileName).find('*[class^="filename"]').find('*[class^="fileActionsMenu"]').find(`[data-action="${CSS.escape(actionId)}"]`).should('exist').click() + getRowForFile(fileName).find('*[class^="filename"]').find('*[class^="fileActionsMenu"]').find(`[data-action="${CSS.escape(actionId)}"]`).should('be.visible').click() } -export const triggerActionForFile = (filename, actionId) => getActionsForFile(filename).find(`[data-action="${CSS.escape(actionId)}"]`).should('exist').click() +export const triggerActionForFile = (filename, actionId) => getActionsForFile(filename).find(`[data-action="${CSS.escape(actionId)}"]`).should('be.visible').as('action-btn').click() -export const getActionsForFile = (filename) => getRowForFile(filename).find('*[class^="filename"]').find('*[class^="name"]').find('*[class^="fileactions"]') +export const getActionsForFile = (filename) => getRowForFile(filename).find('*[class^="filename"]').find('*[class^="name"]').find('*[class^="fileactions"]').should('be.visible') export const getRowForFile = (filename) => cy.get(`[data-file="${CSS.escape(filename)}"]`) From 275e469e98ce50b5018bc8d3957618611652d662 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Tue, 13 Aug 2024 07:02:55 +0000 Subject: [PATCH 6/6] fix: little bug in the domain substr starting index, omit @ from domain --- cypress/ocm-test-suite/cypress/e2e/utils/nextcloud-v27.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/ocm-test-suite/cypress/e2e/utils/nextcloud-v27.js b/cypress/ocm-test-suite/cypress/e2e/utils/nextcloud-v27.js index 322d5c9f..2c4a8778 100644 --- a/cypress/ocm-test-suite/cypress/e2e/utils/nextcloud-v27.js +++ b/cypress/ocm-test-suite/cypress/e2e/utils/nextcloud-v27.js @@ -114,7 +114,7 @@ export function getScienceMeshContactIdFromDisplayNameV27(domain, displayName, c // get the index of the last @ var lastIndex = usernameWithDomain.lastIndexOf('@'); var username = usernameWithDomain.substr(0, lastIndex) - var domain = usernameWithDomain.substr(lastIndex) + var domain = usernameWithDomain.substr(lastIndex + 1) // remove https:// or http:// from domain (reva likes to show username@https://domain sometimes) // I'm too afraid to explain the regex here let's just say its from here: https://stackoverflow.com/a/8206299/8549230