Skip to content

Commit

Permalink
final version of tests (walletsdk still unreachable)
Browse files Browse the repository at this point in the history
  • Loading branch information
todorkoleviohk committed Mar 27, 2024
1 parent ed3a16f commit 2ad7508
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 28 deletions.

This file was deleted.

10 changes: 0 additions & 10 deletions integration-tests/e2e-tests/features/provide_proof.feature

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@proof
@anoncred
Feature: Provide AnonCred proof
The Edge Agent should be able to provide verifiable AnonCred proof to Cloud Agent

Scenario: Edge Agent with a credential should provide AnonCred proof to Cloud Agent
Given Cloud Agent is connected to Edge Agent
And Edge Agent has 1 anonymous credentials issued by Cloud Agent
When Cloud Agent requests presentation of AnonCred proof
And Edge Agent presents the proof
Then Cloud Agent should see the presented proof is verified

11 changes: 11 additions & 0 deletions integration-tests/e2e-tests/features/provide_proof_jwt.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@proof
@jwt
Feature: Provide JWT proof
The Edge Agent should provide JWT proof to Cloud Agent

Scenario: Edge Agent with a credential should provide JWT proof to Cloud Agent
Given Cloud Agent is connected to Edge Agent
And Edge Agent has 1 credentials issued by Cloud Agent
When Cloud Agent requests presentation of JWT proof
And Edge Agent presents the proof
Then Cloud Agent should see the presented proof is verified
2 changes: 1 addition & 1 deletion integration-tests/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "index.ts",
"scripts": {
"clean": "rimraf target",
"test:sdk": "yarn clean && cucumber-js -b --tags '@connectionx'"
"test:sdk": "yarn clean && cucumber-js -b"
},
"repository": {
"type": "git",
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/e2e-tests/src/steps/CloudAgentSteps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ When("{actor} offers an anonymous credential", async function(cloudAgent: Actor)
await CloudAgentWorkflow.offerAnonymousCredential(cloudAgent)
})

When("{actor} asks for present-proof", async function (cloudAgent: Actor) {
await CloudAgentWorkflow.askForPresentProof(cloudAgent)
When("{actor} requests presentation of JWT proof", async function (cloudAgent: Actor) {
await CloudAgentWorkflow.askForPresentProofJwt(cloudAgent)
})

When("{actor} asks for presentation of AnonCred proof", async function (cloudAgent: Actor) {
When("{actor} requests presentation of AnonCred proof", async function (cloudAgent: Actor) {
await CloudAgentWorkflow.askForPresentProofAnonCreds(cloudAgent)
})

Expand All @@ -47,7 +47,7 @@ Then("{actor} should see the credential was accepted", async (cloudAgent: Actor)
await CloudAgentWorkflow.verifyCredentialState(cloudAgent, recordId, "CredentialSent")
})

Then("{actor} should see the present-proof is verified", async (cloudAgent: Actor) => {
Then("{actor} should see the presented proof is verified", async (cloudAgent: Actor) => {
await CloudAgentWorkflow.verifyPresentProof(cloudAgent, "PresentationVerified")
})

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/e2e-tests/src/steps/EdgeAgentSteps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ When("{actor} accepts the credential",
await EdgeAgentWorkflow.acceptCredential(edgeAgent)
})

When("{actor} sends the present-proof",
When("{actor} presents the proof",
async function (edgeAgent: Actor) {
await EdgeAgentWorkflow.waitForProofRequest(edgeAgent)
await EdgeAgentWorkflow.presentProof(edgeAgent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class CloudAgentWorkflow {
)
}

static async askForPresentProof(cloudAgent: Actor) {
static async askForPresentProofJwt(cloudAgent: Actor) {
const presentProofRequest = new RequestPresentationInput()
presentProofRequest.connectionId = await cloudAgent.answer(
Notepad.notes().get("connectionId")
Expand All @@ -145,6 +145,8 @@ export class CloudAgentWorkflow {

static async askForPresentProofAnonCreds(cloudAgent: Actor) {

// TODO: use 'anoncredsPresentationRequestV1' model
// 'anoncredsPresentationRequestV1' was unavailable at the time of this work, constructing payload from scratch:
const cred_def_id = CloudAgentConfiguration.agentUrl +
"credential-definition-registry/definitions/" +
CloudAgentConfiguration.anoncredDefinitionGuid +
Expand Down

0 comments on commit 2ad7508

Please sign in to comment.