-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { StatusCodes } from 'http-status-codes'; | ||
import * as fs from 'fs'; | ||
|
||
test.use({ storageState: 'playwright/.auth/user.json' }); | ||
|
||
const PAYLOADS_BASE_PATH = './tests/payloads/credential'; | ||
|
||
let issuerDid: string; | ||
|
||
test(' Issue a jwt credential', async ({ request }) => { | ||
const dids = await (await request.get(`/did/list`)).json(); | ||
issuerDid = dids[0]; | ||
const credentialData = JSON.parse(fs.readFileSync(`${PAYLOADS_BASE_PATH}/credential-issue-jwt.json`, 'utf-8')); | ||
credentialData.issuerDid = issuerDid; | ||
const response = await request.post(`/credential/issue`, { | ||
data: credentialData, | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
}); | ||
expect(response).toBeOK(); | ||
expect(response.status()).toBe(StatusCodes.OK); | ||
Check failure on line 23 in tests/credential/issue-verify-flow.spec.ts GitHub Actions / Build & Test / Build Node.js[chromium] › credential/issue-verify-flow.spec.ts:11:1 › Issue a jwt credential
|
||
}); | ||
|
||
test(' Issue a jsonLD credential', async ({ request }, testInfo) => { | ||
const credentialData = JSON.parse(fs.readFileSync(`${PAYLOADS_BASE_PATH}/credential-issue-jwt.json`, 'utf-8')); | ||
credentialData.issuerDid = issuerDid; | ||
const response = await request.post(`/credential/issue`, { | ||
data: JSON.parse(fs.readFileSync(`${PAYLOADS_BASE_PATH}/credential-issue-jsonld.json`, 'utf-8')), | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
}); | ||
expect(response).toBeOK(); | ||
expect(response.status()).toBe(StatusCodes.OK); | ||
Check failure on line 36 in tests/credential/issue-verify-flow.spec.ts GitHub Actions / Build & Test / Build Node.js[chromium] › credential/issue-verify-flow.spec.ts:26:1 › Issue a jsonLD credential
Check failure on line 36 in tests/credential/issue-verify-flow.spec.ts GitHub Actions / Build & Test / Build Node.js[chromium] › credential/issue-verify-flow.spec.ts:26:1 › Issue a jsonLD credential
Check failure on line 36 in tests/credential/issue-verify-flow.spec.ts GitHub Actions / Build & Test / Build Node.js[chromium] › credential/issue-verify-flow.spec.ts:26:1 › Issue a jsonLD credential
|
||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"issuerDid": "did:cheqd:testnet:ae0f3d22-cb16-4515-930c-b9a7c7bdfdc0", | ||
"subjectDid": "did:key:z6MkqJNR1DHxX2qxqDYx9tNDsXoNRVpaVvJkLPeCYqaARz1n", | ||
"attributes": { | ||
"gender": "male", | ||
"name": "Bob" | ||
}, | ||
"@context": ["https://schema.org"], | ||
"type": ["Person"], | ||
"format": "lds" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"issuerDid": "did:cheqd:testnet:ae0f3d22-cb16-4515-930c-b9a7c7bdfdc0", | ||
"subjectDid": "did:key:z6MkqJNR1DHxX2qxqDYx9tNDsXoNRVpaVvJkLPeCYqaARz1n", | ||
"attributes": { | ||
"gender": "male", | ||
"name": "Bob" | ||
}, | ||
"@context": ["https://schema.org"], | ||
"type": ["Person"], | ||
"format": "jwt" | ||
} |