Skip to content

Commit

Permalink
Merge pull request #144 from pondersource/nextcloud-ocmstub-sharewith
Browse files Browse the repository at this point in the history
Nextcloud ocmstub sharewith
  • Loading branch information
MahdiBaghbani authored Nov 18, 2024
2 parents 29db942 + 9421df5 commit 27d5cf2
Show file tree
Hide file tree
Showing 41 changed files with 220 additions and 133 deletions.
60 changes: 53 additions & 7 deletions .github/workflows/ocm-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
},
{
platform: nextcloud,
version: v28.0.7
version: v28.0.12
},
{
platform: owncloud,
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
},
{
platform: nextcloud,
version: v28.0.7
version: v28.0.12
},
{
platform: owncloud,
Expand All @@ -102,7 +102,7 @@ jobs:
},
{
platform: nextcloud,
version: v28.0.7
version: v28.0.12
},
{
platform: owncloud,
Expand All @@ -129,7 +129,7 @@ jobs:
}
- sender: {
platform: nextcloud,
version: v28.0.7
version: v28.0.12
}
receiver: {
platform: seafile,
Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:
}
receiver: {
platform: nextcloud,
version: v28.0.7
version: v28.0.12
}
- sender: {
platform: seafile,
Expand Down Expand Up @@ -209,7 +209,7 @@ jobs:
},
{
platform: nextcloud,
version: v28.0.7
version: v28.0.12
},
{
platform: owncloud,
Expand All @@ -223,7 +223,7 @@ jobs:
},
{
platform: nextcloud,
version: v28.0.7
version: v28.0.12
},
{
platform: owncloud,
Expand Down Expand Up @@ -318,3 +318,49 @@ jobs:
with:
name: invite-link from ${{ matrix.sender.platform }} ${{ matrix.sender.version }} to ${{ matrix.receiver.platform }} ${{ matrix.receiver.version }}
path: ./cypress/ocm-test-suite/cypress/videos

share-with-signed-http:
if: ${{ always() }}
needs: [login]
strategy:
fail-fast: false
max-parallel: 4
matrix:
sender: [
{
platform: ocmstub,
version: "1.0"
},
]
receiver: [
{
platform: ocmstub,
version: "1.0"
},
]

# The OS to run tests on, (I believe for OCM testing OS is really not that important).
runs-on: ubuntu-22.04

# Steps represent a sequence of tasks that will be executed as part of the job.
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- name: Checkout.
uses: actions/checkout@v4

- name: Pull images.
shell: bash
run: |
./docker/pull/ocm-test-suite/${{ matrix.sender.platform }}.sh ${{ matrix.sender.version }}
./docker/pull/ocm-test-suite/${{ matrix.receiver.platform }}.sh ${{ matrix.receiver.version }}
- name: Run tests.
shell: bash
run: ./dev/ocm-test-suite.sh share-with-signed-http ${{ matrix.sender.platform }} ${{ matrix.sender.version }} ci electron ${{ matrix.receiver.platform }} ${{ matrix.receiver.version }}

- name: Upload Cypress video artifacts.
uses: actions/upload-artifact@v4
if: always()
with:
name: share-with from ${{ matrix.sender.platform }} ${{ matrix.sender.version }} to ${{ matrix.receiver.platform }} ${{ matrix.receiver.version }}
path: ./cypress/ocm-test-suite/cypress/videos
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,23 @@ Docker images we use in development.
# EFSS versions
## Nextcloud version

***tag: latest, v28.0.7***
***tag: latest, v30.0.0***

upstream: [Nextcloud Server Official](https://github.com/nextcloud/server)

branch: [v28.0.7](https://github.com/nextcloud/server/releases/tag/v28.0.7)
branch: [v30.0.0](https://github.com/nextcloud/server/releases/tag/v30.0.0)

***tag: v29.0.8***

upstream: [Nextcloud Server Official](https://github.com/nextcloud/server)

branch: [v29.0.8](https://github.com/nextcloud/server/releases/tag/v29.0.8)

***tag: v28.0.12***

upstream: [Nextcloud Server Official](https://github.com/nextcloud/server)

branch: [v28.0.12](https://github.com/nextcloud/server/releases/tag/v28.0.12)

***tag: v27.1.10***

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
import {
createShareV27,
renameFileV27,
navigationSwitchLeftSideV27,
selectAppFromLeftSideV27,
} from '../utils/nextcloud-v27'

describe('OCM federated sharing functionality for Nextcloud and OcmStub', () => {
it('Send federated share <file> from Nextcloud v27 to OcmStub 1.0', () => {
describe('Native federated sharing functionality for Nextcloud', () => {
it('Send federated share <file> from Nextcloud v27 to Nextcloud v27', () => {
// share from Nextcloud 1.
cy.loginNextcloud('https://nextcloud1.docker', 'einstein', 'relativity')

renameFileV27('welcome.txt', 'nc1-to-nc2-share.txt')
createShareV27('nc1-to-nc2-share.txt', 'michiel', 'nextcloud2.docker')
renameFileV27('welcome.txt', 'nc1-to-os1-share.txt')
createShareV27('nc1-to-os1-share.txt', 'michiel', 'ocmstub1.docker')
})

it('Receive federated share <file> from Nextcloud v27 to OcmStub 1.0', () => {
// accept share from OcmStub 2.
cy.loginOcmStub('https://ocmstub2.docker/?')
// accept share from OcmStub 1.
cy.loginOcmStub('https://ocmstub1.docker/?')

cy.contains('"shareWith": "michiel@https://ocmstub2.docker"').should('be.visible')
cy.contains('"shareWith": "michiel@https://ocmstub1.docker"').should('be.visible')
cy.contains('"shareType": "user"').should('be.visible')
cy.contains('"name": "nc1-to-os2-share.txt"').should('be.visible')
cy.contains('"name": "nc1-to-os1-share.txt"').should('be.visible')
cy.contains('"resourceType": "file"').should('be.visible')
cy.contains('"owner": "einstein@https://nextcloud1.docker/"').should('be.visible')
cy.contains('"sharedBy": "einstein@https://nextcloud1.docker/"').should('be.visible')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
import { createShareV28, renameFileV28 } from '../utils/nextcloud-v28'
import {
createShareV28,
renameFileV28
} from '../utils/nextcloud-v28'

describe('Native federated sharing functionality for Nextcloud v28', () => {
it('Send federated share <file> from Nextcloud to Nextcloud', () => {
// share from Nextcloud 1.
cy.loginNextcloud('https://nextcloud1.docker', 'einstein', 'relativity')

renameFileV28('welcome.txt', 'nc1-to-os2-share.txt')
createShareV28('nc1-to-os2-share.txt', 'michiel', 'ocmstub2.docker')
renameFileV28('welcome.txt', 'nc1-to-os1-share.txt')
createShareV28('nc1-to-os1-share.txt', 'michiel', 'ocmstub1.docker')
})

it('Receive federated share <file> from Nextcloud v28 to OcmStub 1.0', () => {
// accept share from OcmStub 2.
cy.loginOcmStub('https://ocmstub2.docker/?')
// accept share from OcmStub 1.
cy.loginOcmStub('https://ocmstub1.docker/?')

cy.contains('"shareWith": "michiel@https://ocmstub2.docker"').should('be.visible')
cy.contains('"shareWith": "michiel@https://ocmstub1.docker"').should('be.visible')
cy.contains('"shareType": "user"').should('be.visible')
cy.contains('"name": "nc1-to-os2-share.txt"').should('be.visible')
cy.contains('"name": "nc1-to-os1-share.txt"').should('be.visible')
cy.contains('"resourceType": "file"').should('be.visible')
cy.contains('"owner": "einstein@https://nextcloud1.docker/"').should('be.visible')
cy.contains('"sharedBy": "einstein@https://nextcloud1.docker/"').should('be.visible')
cy.contains('"ownerDisplayName": "einstein"').should('be.visible')
cy.contains('"description": ""').should('be.visible')
cy.contains('"shareWith": "michiel@https://ocmstub2.docker"').should('be.visible')
cy.contains('"protocol": { "name": "webdav", "options": { "sharedSecret": "').should('be.visible')
cy.contains('"permissions": "{http://open-cloud-mesh.org/ns}share-permissions"').should('be.visible')
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Native federated sharing functionality for OcmStub', () => {
cy.contains('yes shareWith').should('be.visible')
})

it('Receive federated share <file> from Nextcloud v27 to OcmStub 1.0', () => {
it('Receive federated share <file> from OcmStub 1.0 to OcmStub 1.0', () => {
// accept share from OcmStub 2.
cy.loginOcmStub('https://ocmstub2.docker/?')

Expand All @@ -13,9 +13,8 @@ describe('Native federated sharing functionality for OcmStub', () => {
cy.contains('"name": "Test share from stub"').should('be.visible')
cy.contains('"resourceType": "file"').should('be.visible')
cy.contains('"owner": "[email protected]"').should('be.visible')
cy.contains('"sharedBy": "[email protected]"').should('be.visible')
cy.contains('"sender": "[email protected]"').should('be.visible')
cy.contains('"ownerDisplayName": "einstein"').should('be.visible')
cy.contains('"protocol": { "name": "webdav", "options": { "sharedSecret": "').should('be.visible')
// cy.contains('"permissions": "{http://open-cloud-mesh.org/ns}share-permissions"').should('be.visible')
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
selectAppFromLeftSide
} from '../utils/owncloud'

describe('OCM federated sharing functionality for ownCloud and OcmStub', () => {
it('Send federated share <file> from ownCloud v10 to OcmStub 1.0', () => {
describe('Native federated sharing functionality for ownCloud', () => {
it('Send federated share <file> from ownCloud v10 to ownCloud v10', () => {
// share from ownCloud 1.
cy.loginOwncloud('https://owncloud1.docker', 'marie', 'radioactivity')

Expand All @@ -25,6 +25,7 @@ describe('OCM federated sharing functionality for ownCloud and OcmStub', () => {
cy.contains('"sharedBy": "einstein@https://owncloud1.docker/"').should('be.visible')
cy.contains('"ownerDisplayName": "einstein"').should('be.visible')
cy.contains('"description": ""').should('be.visible')
cy.contains('"shareWith": "michiel@https://ocmstub2.docker"').should('be.visible')
cy.contains('"protocol": { "name": "webdav", "options": { "sharedSecret": "').should('be.visible')
cy.contains('"permissions": "{http://open-cloud-mesh.org/ns}share-permissions"').should('be.visible')
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('OCM federated sharing functionality for Seafile 11 and OcmStub', () => {
it('Send federated share <file> from Seafile 11 to OcmStub 1.0', () => {
describe('Native federated sharing functionality for Seafile', () => {
it('Send federated share <file> from Seafile 11 to Seafile 11', () => {
// share from Seafile 1.
cy.loginSeafile('http://seafile1.docker', '[email protected]', 'xu')

Expand Down Expand Up @@ -48,7 +48,7 @@ describe('OCM federated sharing functionality for Seafile 11 and OcmStub', () =>
.click()

cy.get('*[role^="dialog"]')
.contains(/^ocmstub\w+/)
.contains(/^seafile\w+/)
.click()

cy.get('*[id^="share-to-other-server-panel"]')
Expand All @@ -70,7 +70,7 @@ describe('OCM federated sharing functionality for Seafile 11 and OcmStub', () =>

})

it('Receive federated share <file> from Seafile 11 to OcmStub 1.0', () => {
it('Receive federated share <file> from ownCloud v10 to OcmStub 1.0', () => {
// accept share from OcmStub 2.
cy.loginOcmStub('https://ocmstub2.docker/?')

Expand All @@ -82,6 +82,7 @@ describe('OCM federated sharing functionality for Seafile 11 and OcmStub', () =>
cy.contains('"sharedBy": "einstein@https://seafile1.docker/"').should('be.visible')
cy.contains('"ownerDisplayName": "einstein"').should('be.visible')
cy.contains('"description": ""').should('be.visible')
cy.contains('"shareWith": "michiel@https://ocmstub2.docker"').should('be.visible')
cy.contains('"protocol": { "name": "webdav", "options": { "sharedSecret": "').should('be.visible')
cy.contains('"permissions": "{http://open-cloud-mesh.org/ns}share-permissions"').should('be.visible')
})
Expand Down
5 changes: 2 additions & 3 deletions cypress/ocm-test-suite/cypress/e2e/utils/nextcloud-v28.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ export function createShareV28(fileName, username, domain) {
// ensure selecting remote [sharetype="6"] instead of email!
cy.get(`[user="${username}"]`).should('be.visible').click()

// cy.get('[data-cy-files-sharing-share-editor-action="save"]').click({ scrollBehavior: 'nearest' })
cy.get('*[class^="sharingTabDetailsView"]')
.find('*[class^="sharingTabDetailsView__footer"]')
.find('*[class^="button-group"]')
.find('*[class^="button-vue button-vue--text-only button-vue--vue-primary"]')
.find('[data-cy-files-sharing-share-editor-action="save"]')
.should('be.visible')
.click()
.click({ scrollBehavior: 'nearest' })

// HACK: Save the share and then update it, as permissions changes are currently not saved for new share.
// updateShareV28(fileName, 0) // @MahdiBaghbani: not sure about this yet.
Expand Down
17 changes: 17 additions & 0 deletions dev/ocm-test-suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,23 @@ case "${TEST_CASE}" in
esac
;;

"share-with-signed-http")
case "${EFSS_PLATFORM_1}-${EFSS_PLATFORM_2}" in

"nextcloud-ocmstub")
"${ENV_ROOT}/dev/ocm-test-suite/share-with-signed-http/nextcloud-ocmstub.sh" "${EFSS_PLATFORM_1_VERSION}" "${EFSS_PLATFORM_2_VERSION}" "${SCRIPT_MODE}" "${BROWSER_PLATFORM}"
;;

"ocmstub-ocmstub")
"${ENV_ROOT}/dev/ocm-test-suite/share-with-signed-http/ocmstub-ocmstub.sh" "${EFSS_PLATFORM_1_VERSION}" "${EFSS_PLATFORM_2_VERSION}" "${SCRIPT_MODE}" "${BROWSER_PLATFORM}"
;;

*)
echo -n "unknown share-with"
;;
esac
;;

"share-link")
case "${EFSS_PLATFORM_1}-${EFSS_PLATFORM_2}" in

Expand Down
4 changes: 2 additions & 2 deletions dev/ocm-test-suite/invite-link/nextcloud-nextcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ export ENV_ROOT=${ENV_ROOT}

# nextcloud version:
# - v27.1.10
# - v28.0.7
# - v28.0.12
EFSS_PLATFORM_1_VERSION=${1:-"v27.1.10"}

# nextcloud version:
# - v27.1.10
# - v28.0.7
# - v28.0.12
EFSS_PLATFORM_2_VERSION=${2:-"v27.1.10"}

# script mode: dev, ci. default is dev.
Expand Down
2 changes: 1 addition & 1 deletion dev/ocm-test-suite/invite-link/nextcloud-ocis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export ENV_ROOT=${ENV_ROOT}

# nextcloud version:
# - v27.1.10
# - v28.0.7
# - v28.0.12
EFSS_PLATFORM_1_VERSION=${1:-"v27.1.10"}

# oCIS version:
Expand Down
2 changes: 1 addition & 1 deletion dev/ocm-test-suite/invite-link/nextcloud-owncloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export ENV_ROOT=${ENV_ROOT}

# nextcloud version:
# - v27.1.10
# - v28.0.7
# - v28.0.12
EFSS_PLATFORM_1_VERSION=${1:-"v27.1.10"}

# owncloud version:
Expand Down
2 changes: 1 addition & 1 deletion dev/ocm-test-suite/invite-link/ocis-nextcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ EFSS_PLATFORM_1_VERSION=${1:-"5.0.6"}

# nextcloud version:
# - v27.1.10
# - v28.0.7
# - v28.0.12
EFSS_PLATFORM_2_VERSION=${2:-"v27.1.10"}

# script mode: dev, ci. default is dev.
Expand Down
4 changes: 2 additions & 2 deletions dev/ocm-test-suite/invite-link/owncloud-nextcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ EFSS_PLATFORM_1_VERSION=${1:-"v10.14.0"}

# nextcloud version:
# - v27.1.10
# - v28.0.7
EFSS_PLATFORM_2_VERSION=${2:-"v28.0.7"}
# - v28.0.12
EFSS_PLATFORM_2_VERSION=${2:-"v28.0.12"}

# script mode: dev, ci. default is dev.
SCRIPT_MODE=${3:-"dev"}
Expand Down
2 changes: 1 addition & 1 deletion dev/ocm-test-suite/login/nextcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export ENV_ROOT=${ENV_ROOT}

# nextcloud version:
# - v27.1.10
# - v28.0.7
# - v28.0.12
EFSS_PLATFORM_VERSION=${1:-"v27.1.10"}

# script mode: dev, ci. default is dev.
Expand Down
Loading

0 comments on commit 27d5cf2

Please sign in to comment.