From 28ed7c1f09c3814f682ba90725c6231339b23e9e Mon Sep 17 00:00:00 2001 From: root Date: Mon, 17 Oct 2022 09:14:32 +0000 Subject: [PATCH] Empty accessShare functions, ref https://github.com/pondersource/sciencemesh-nextcloud/issues/91 --- README.md | 2 +- clients/client.ts | 1 + clients/owncloud.ts | 4 ++++ clients/reva.ts | 11 +++++++++++ debug.sh | 2 +- ocm.test.ts | 2 ++ 6 files changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ad1eed32..cd396b5e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This test suite tests various implementations of [Open Cloud Mesh (OCM)](https:/ ## Running in Github Actions -The current main branch of this repo runs a gitbub action to test the share-with flow from each of the following servers +The current main branch of this repo runs a github action to test the share-with flow from each of the following servers to the ocm-stub server: * ocm-stub * Nextcloud diff --git a/clients/client.ts b/clients/client.ts index 11146030..16abc55e 100644 --- a/clients/client.ts +++ b/clients/client.ts @@ -16,6 +16,7 @@ export abstract class Client { abstract shareWith(shareWithUser: string, shareWithHost: string, shareWithDomain: string, shareFromDomain: string): Promise abstract acceptPublicLink(url: string, remoteGuiType: string): Promise abstract acceptShare() : Promise + abstract accessShare() : Promise abstract deleteAcceptedShare() : Promise abstract exit () : Promise } \ No newline at end of file diff --git a/clients/owncloud.ts b/clients/owncloud.ts index 49761a0b..9c33e575 100644 --- a/clients/owncloud.ts +++ b/clients/owncloud.ts @@ -100,6 +100,10 @@ export class OwncloudClient extends StubClient { ); } + async accessShare() { + // TODO :implement + } + // Common GUI flow between ownCloud and Nextcloud: async deleteShares(sharedWithYouUrl, contextMenuSelector, unshareSelector, doneSelector) { await this.page.goto(sharedWithYouUrl); diff --git a/clients/reva.ts b/clients/reva.ts index d961ac9b..6ae530de 100644 --- a/clients/reva.ts +++ b/clients/reva.ts @@ -378,6 +378,17 @@ export class RevaClient extends Client { }); await Promise.all(promises); } + + async accessShare() { + const ids = await this.listReceivedOCMShares(); + console.log({ ids }); + const promises = ids.map((id: any) => { + console.log("Accessing share", this.guiDomain, id); + return this.updateReceivedOCMShare(id, ShareState.SHARE_STATE_ACCEPTED); + }); + await Promise.all(promises); + } + async deleteAcceptedShare() { // FIXME: todo } diff --git a/debug.sh b/debug.sh index 3dffd04a..e7c3e8d3 100755 --- a/debug.sh +++ b/debug.sh @@ -9,7 +9,7 @@ # ./scripts/start-to-Nextcloud.sh # And then there are really three ways to add a tester to the testnet -# that lets you poke at the "from" and the "to" system:: +# that lets you poke at the "from" and the "to" system: # 1. The way https://github.com/cs3org/ocm-test-suite/blob/main/.github/workflows/ci.yml and # https://github.com/cs3org/ocm-test-suite/blob/main/scripts/run-test.sh do it: # ./scripts/start-tester-unattended.sh diff --git a/ocm.test.ts b/ocm.test.ts index 9c85dd4d..00532c47 100644 --- a/ocm.test.ts +++ b/ocm.test.ts @@ -96,6 +96,8 @@ for (let i = 0; i < flows.length; i++) { await fromUser.shareWith(params[`To ${to}`].username, params[`To ${to}`].ocmDomain, params[`To ${to}`].guiDomain, params[`From ${from}`].guiDomain); console.log('toUser.acceptShare'); await toUser.acceptShare(); + console.log('toUser.accessShare'); + await toUser.accessShare(); console.log('toUser.deleteAcceptedShare'); await toUser.deleteAcceptedShare(); console.log('done');