Skip to content

Commit

Permalink
tests(prism-agent): fix failing e2e Prism DID scenarios (#402)
Browse files Browse the repository at this point in the history
* tests: make gradle test pass cucumber option

* tests: update expecgted field in list DID response

* tests: fix broken publish DID scenario

* Update infra local .env version

* tests: fix DID prerequisite for some test steps
  • Loading branch information
patlo-iog authored Mar 1, 2023
1 parent 4ee0943 commit 447817d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions infrastructure/local/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MERCURY_MEDIATOR_VERSION=0.2.0
IRIS_SERVICE_VERSION=0.1.0
PRISM_AGENT_VERSION=0.43.0
PRISM_NODE_VERSION=v2.0.0
PRISM_AGENT_VERSION=0.45.1
PRISM_NODE_VERSION=v2.1.0
PORT=80
NETWORK=prism
1 change: 1 addition & 0 deletions tests/e2e-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ serenity {

tasks.test {
testLogging.showStandardStreams = true
systemProperty("cucumber.filter.tags", System.getProperty("cucumber.filter.tags"))
}
5 changes: 5 additions & 0 deletions tests/e2e-tests/src/test/kotlin/features/CommonSteps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import common.Agents.Mallory
import common.Agents.createAgents
import common.Utils.lastResponseList
import features.connection.ConnectionSteps
import features.did.PublishDidSteps
import features.issue_credentials.IssueCredentialsSteps
import io.cucumber.java.Before
import io.cucumber.java.ParameterType
Expand Down Expand Up @@ -55,8 +56,12 @@ class CommonSteps {
if (receivedCredential != null) {
holder.remember("issuedCredential", receivedCredential)
} else {
val publishDidSteps = PublishDidSteps()
val issueSteps = IssueCredentialsSteps()
actorsHaveExistingConnection(issuer, holder)
publishDidSteps.createsUnpublishedDid(holder)
publishDidSteps.createsUnpublishedDid(issuer)
publishDidSteps.hePublishesDidToLedger(issuer)
issueSteps.acmeOffersACredential(issuer, holder)
issueSteps.bobRequestsTheCredential(holder)
issueSteps.acmeIssuesTheCredential(issuer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class ManageDidSteps {
fun seeTheListContainsAllCreatedDids(actor: Actor) {
val expectedDidsCount = actor.recall<Int>("number")
val expectedDids = actor.recall<List<String>>("createdDids")
val managedDidList = lastResponseList("", ManagedDid::class)
val managedDidList = lastResponseList("contents", ManagedDid::class)
Assertions.assertThat(managedDidList)
.filteredOn {
expectedDids.contains(it.longFormDid) && it.status == "CREATED"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package features.did

import api_models.*
import common.Utils.lastResponseList
import common.Utils.lastResponseObject
import common.Utils.wait
import io.cucumber.java.en.Given
Expand Down Expand Up @@ -48,7 +47,7 @@ class PublishDidSteps {
val longFormDid = lastResponseObject("longFormDid", String::class)

actor.attemptsTo(
Get.resource("/did-registrar/dids"),
Get.resource("/did-registrar/dids/$longFormDid"),
)
actor.should(
ResponseConsequence.seeThatResponse {
Expand All @@ -57,9 +56,7 @@ class PublishDidSteps {
)
actor.remember(
"shortFormDid",
lastResponseList("", ManagedDid::class).find {
it.longFormDid == longFormDid
}!!.did,
lastResponseObject("", ManagedDid::class).did,
)
actor.remember("longFormDid", longFormDid)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Examples:
| documentTemplate.services[0].type | 400 |
| documentTemplate.services[0].serviceEndpoint | 400 |

@skip @bug
Scenario Outline: Wrong formatted fields to create manage DID should fail
Given Acme tries to create a managed DID with value <value> in <field>
Then He sees the request has failed with error status <error>
Expand Down

0 comments on commit 447817d

Please sign in to comment.