diff --git a/package.json b/package.json index b6270ed1c..da661bd8d 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "lint": "eslint --max-warnings=0 src && prettier --check '**/*.{js,ts,cjs,mjs,json}'", "test": "npm run test:unit && npm run test:e2e", "test:unit": "cross-env NODE_OPTIONS='--experimental-vm-modules' jest --verbose", - "test:e2e": "npx playwright test -c playwright.config.ts", + "test:e2e": "TEST_MODE_PARALLEL=true npx playwright test -c playwright.config.ts && npx playwright test -c playwright.config.ts", "typeorm": "typeorm-ts-node-esm -d ./dist/database/ormconfig.js", "generate": "npm run typeorm migration:generate .", "migrate": "npm run typeorm migration:run" diff --git a/playwright.config.ts b/playwright.config.ts index 5720304dd..3ee03c09b 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -49,13 +49,13 @@ export default defineConfig({ // Whether to run tests in parallel // Docs: https://playwright.dev/docs/api/class-testconfig#test-config-fully-parallel - fullyParallel: false, + fullyParallel: process.env.TEST_MODE_PARALLEL === 'true' ? true : false, // Number of parallel workers OR %age of logical CPUs to use // Github Actions runners have 2 logical CPU cores // Defaults to half of the logical CPU cores available // Docs: https://playwright.dev/docs/api/class-testconfig#test-config-workers - workers: process.env.CI ? 1 : undefined, + workers: process.env.TEST_MODE_PARALLEL ? 4 : 1, // Limit the numbers of failures to set a fail-fast strategy on CI // Docs: https://playwright.dev/docs/api/class-testconfig#test-config-max-failures @@ -63,39 +63,64 @@ export default defineConfig({ // Configure project specific settings // Docs: https://playwright.dev/docs/test-projects - projects: [ - { - name: 'Setup unauthenticated user', - testMatch: /no-auth\.setup\.ts/, - }, - { - name: 'Setup authenticated user', - testMatch: /auth\.setup\.ts/, - }, - { - name: 'Logged In User Tests', - ...(process.env.RELEASE === 'true' ? {} : { testIgnore: /.*\.release\.spec\.ts/ }), - use: { - ...devices['Desktop Chrome'], - // Use prepared auth state. - storageState: STORAGE_STATE_AUTHENTICATED, - extraHTTPHeaders: { - // Add x-api-key token to all authenticated requests. - 'x-api-key': `${process.env.TEST_USER_API_KEY}`, - }, - }, - dependencies: ['Setup authenticated user'], - }, - { - name: 'Non-Logged In User Tests', - testMatch: /.*\.no-auth.spec.ts/, - use: { - ...devices['Desktop Chrome'], - storageState: STORAGE_STATE_UNAUTHENTICATED, - }, - dependencies: ['Setup unauthenticated user'], - }, - ], + projects: + process.env.TEST_MODE_PARALLEL === 'true' + ? [ + { + name: 'Setup unauthenticated user', + testMatch: /no-auth\.setup\.ts/, + }, + { + name: 'Setup authenticated user', + testMatch: /auth\.setup\.ts/, + }, + { + name: 'Parallel Logged In User Tests', + ...(process.env.RELEASE === 'true' ? {} : { testIgnore: /.*\.release\.spec\.ts/ }), + use: { + ...devices['Desktop Chrome'], + // Use prepared auth state. + storageState: STORAGE_STATE_AUTHENTICATED, + extraHTTPHeaders: { + // Add x-api-key token to all authenticated requests. + 'x-api-key': `${process.env.TEST_USER_API_KEY}`, + }, + }, + testDir: './tests/e2e/parallel', + dependencies: ['Setup authenticated user'], + }, + { + name: 'Non-Logged In User Tests', + testMatch: /.*\.no-auth.spec.ts/, + use: { + ...devices['Desktop Chrome'], + storageState: STORAGE_STATE_UNAUTHENTICATED, + }, + testDir: './tests/e2e/parallel', + dependencies: ['Setup unauthenticated user'], + }, + ] + : [ + { + name: 'Setup authenticated user', + testMatch: /auth\.setup\.ts/, + }, + { + name: 'Logged In User Tests', + ...(process.env.RELEASE === 'true' ? {} : { testIgnore: /.*\.release\.spec\.ts/ }), + use: { + ...devices['Desktop Chrome'], + // Use prepared auth state. + storageState: STORAGE_STATE_AUTHENTICATED, + extraHTTPHeaders: { + // Add x-api-key token to all authenticated requests. + 'x-api-key': `${process.env.TEST_USER_API_KEY}`, + }, + }, + testDir: './tests/e2e/sequential', + dependencies: ['Setup authenticated user'], + }, + ], // Timeout for each test in milliseconds // Docs: https://playwright.dev/docs/test-timeouts diff --git a/tests/e2e/credential/issue-negative.spec.ts b/tests/e2e/credential/issue-negative.spec.ts deleted file mode 100644 index ee96f1c7b..000000000 --- a/tests/e2e/credential/issue-negative.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { - CONTENT_TYPE, - PAYLOADS_PATH, - STORAGE_STATE_AUTHENTICATED, - DEFAULT_DOES_NOT_HAVE_PERMISSIONS, -} from '../constants'; -import * as fs from 'fs'; -import { test, expect } from '@playwright/test'; -import { StatusCodes } from 'http-status-codes'; -import { UnsuccessfulResponseBody } from '@cheqd/credential-service/src/types/shared.js'; - -test.use({ storageState: STORAGE_STATE_AUTHENTICATED }); - -test('[Negative] It cannot issue credential in mainnet network for user with testnet role', async ({ request }) => { - const response = await request.post(`/credential/issue`, { - data: JSON.parse( - fs.readFileSync(`${PAYLOADS_PATH.CREDENTIAL}/issue-credential-without-permissions.json`, 'utf-8') - ), - headers: { 'Content-Type': CONTENT_TYPE.APPLICATION_JSON }, - }); - expect(response).not.toBeOK(); - expect(response.status()).toBe(StatusCodes.FORBIDDEN); - const { error } = (await response.json()) as UnsuccessfulResponseBody; - expect(error).toEqual(expect.stringContaining(DEFAULT_DOES_NOT_HAVE_PERMISSIONS)); -}); diff --git a/tests/e2e/credential/issue-verify-flow.spec.ts b/tests/e2e/credential/issue-verify-flow.spec.ts deleted file mode 100644 index 2f210e2ec..000000000 --- a/tests/e2e/credential/issue-verify-flow.spec.ts +++ /dev/null @@ -1,130 +0,0 @@ -import type { VerifiableCredential } from '@veramo/core'; - -import { test, expect } from '@playwright/test'; -import { StatusCodes } from 'http-status-codes'; -import * as fs from 'fs'; -import { CONTENT_TYPE, DEACTIVATED_TESTNET_DID, PAYLOADS_PATH } from '../constants'; - -test.use({ storageState: 'playwright/.auth/user.json' }); - -let jwtCredential: VerifiableCredential, jsonldCredential: VerifiableCredential; - -test(' Issue a jwt credential', async ({ request }) => { - const credentialData = JSON.parse( - fs.readFileSync(`${PAYLOADS_PATH.CREDENTIAL}/credential-issue-jwt.json`, 'utf-8') - ); - const response = await request.post(`/credential/issue`, { - data: JSON.stringify(credentialData), - headers: { - 'Content-Type': CONTENT_TYPE.APPLICATION_JSON, - }, - }); - jwtCredential = await response.json(); - expect(response).toBeOK(); - expect(response.status()).toBe(StatusCodes.OK); - expect(jwtCredential.proof.type).toBe('JwtProof2020'); - expect(jwtCredential.proof).toHaveProperty('jwt'); - expect(typeof jwtCredential.issuer === 'string' ? jwtCredential.issuer : jwtCredential.issuer.id).toBe( - credentialData.issuerDid - ); - expect(jwtCredential.type).toContain('VerifiableCredential'); - expect(jwtCredential.credentialSubject).toMatchObject({ - ...credentialData.attributes, - id: credentialData.subjectDid, - }); -}); - -test(' Verify a jwt credential', async ({ request }) => { - const response = await request.post(`/credential/verify`, { - data: JSON.stringify({ - credential: jwtCredential.proof.jwt, - }), - headers: { - 'Content-Type': CONTENT_TYPE.APPLICATION_JSON, - }, - }); - const result = await response.json(); - expect(response).toBeOK(); - expect(response.status()).toBe(StatusCodes.OK); - expect(result.verified).toBe(true); -}); - -test(' Issue a jwt credential with a deactivated DID', async ({ request }) => { - const credentialData = JSON.parse( - fs.readFileSync(`${PAYLOADS_PATH.CREDENTIAL}/credential-issue-jwt.json`, 'utf-8') - ); - credentialData.issuerDid = DEACTIVATED_TESTNET_DID; - const response = await request.post(`/credential/issue`, { - data: JSON.stringify(credentialData), - headers: { - 'Content-Type': CONTENT_TYPE.APPLICATION_JSON, - }, - }); - expect(response.status()).toBe(StatusCodes.BAD_REQUEST); -}); - -test(' Issue a jsonLD credential', async ({ request }) => { - const credentialData = JSON.parse( - fs.readFileSync(`${PAYLOADS_PATH.CREDENTIAL}/credential-issue-jsonld.json`, 'utf-8') - ); - const response = await request.post(`/credential/issue`, { - data: JSON.stringify(credentialData), - headers: { - 'Content-Type': 'application/json', - }, - }); - jsonldCredential = await response.json(); - expect(response).toBeOK(); - expect(response.status()).toBe(StatusCodes.OK); - expect(jsonldCredential.proof.type).toBe('Ed25519Signature2018'); - expect(jsonldCredential.proof).toHaveProperty('jws'); - expect(typeof jwtCredential.issuer === 'string' ? jwtCredential.issuer : jwtCredential.issuer.id).toBe( - credentialData.issuerDid - ); - expect(jwtCredential.type).toContain('VerifiableCredential'); - expect(jwtCredential.credentialSubject).toMatchObject({ - ...credentialData.attributes, - id: credentialData.subjectDid, - }); -}); - -test(' Verify a jsonld credential', async ({ request }) => { - const response = await request.post(`/credential/verify`, { - data: JSON.stringify({ - credential: jsonldCredential, - fetchRemoteContexts: true, - }), - headers: { - 'Content-Type': CONTENT_TYPE.APPLICATION_JSON, - }, - }); - const result = await response.json(); - expect(response).toBeOK(); - expect(response.status()).toBe(StatusCodes.OK); - expect(result.verified).toBe(true); -}); - -test(' Issue a jwt credential to a verida DID holder', async ({ request }) => { - const credentialData = JSON.parse( - fs.readFileSync(`${PAYLOADS_PATH.CREDENTIAL}/credential-issue-vda.json`, 'utf-8') - ); - const response = await request.post(`/credential/issue`, { - data: JSON.stringify(credentialData), - headers: { - 'Content-Type': CONTENT_TYPE.APPLICATION_JSON, - }, - }); - const credential = await response.json(); - expect(response).toBeOK(); - expect(response.status()).toBe(StatusCodes.OK); - expect(credential.proof.type).toBe('JwtProof2020'); - expect(credential.proof).toHaveProperty('jwt'); - expect(typeof credential.issuer === 'string' ? credential.issuer : credential.issuer.id).toBe( - credentialData.issuerDid - ); - expect(credential.type).toContain('VerifiableCredential'); - expect(credential.credentialSubject).toMatchObject({ - ...credentialData.attributes, - id: credentialData.subjectDid, - }); -}); diff --git a/tests/e2e/credential/reinstate-negative.spec.ts b/tests/e2e/credential/reinstate-negative.spec.ts deleted file mode 100644 index 43cb0dd9d..000000000 --- a/tests/e2e/credential/reinstate-negative.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { - CONTENT_TYPE, - PAYLOADS_PATH, - STORAGE_STATE_AUTHENTICATED, - DEFAULT_DOES_NOT_HAVE_PERMISSIONS, -} from '../constants'; -import * as fs from 'fs'; -import { test, expect } from '@playwright/test'; -import { StatusCodes } from 'http-status-codes'; -import { UnsuccessfulResponseBody } from '@cheqd/credential-service/src/types/shared.js'; - -test.use({ storageState: STORAGE_STATE_AUTHENTICATED }); - -test('[Negative] It cannot reinstate credential in mainnet network for user with testnet role', async ({ request }) => { - const response = await request.post(`/credential/reinstate`, { - data: JSON.parse( - fs.readFileSync(`${PAYLOADS_PATH.CREDENTIAL}/reinstate-credential-without-permissions.json`, 'utf-8') - ), - headers: { 'Content-Type': CONTENT_TYPE.APPLICATION_JSON }, - }); - expect(response).not.toBeOK(); - expect(response.status()).toBe(StatusCodes.FORBIDDEN); - const { error } = (await response.json()) as UnsuccessfulResponseBody; - expect(error).toEqual(expect.stringContaining(DEFAULT_DOES_NOT_HAVE_PERMISSIONS)); -}); diff --git a/tests/e2e/credential-status/check.spec.ts b/tests/e2e/parallel/credential-status/check.spec.ts similarity index 99% rename from tests/e2e/credential-status/check.spec.ts rename to tests/e2e/parallel/credential-status/check.spec.ts index c1967456b..89e963327 100644 --- a/tests/e2e/credential-status/check.spec.ts +++ b/tests/e2e/parallel/credential-status/check.spec.ts @@ -5,7 +5,7 @@ import { NOT_EXISTENT_STATUS_LIST_NAME, DEFAULT_STATUS_LIST_UNENCRYPTED_NAME, STORAGE_STATE_AUTHENTICATED, -} from '../constants'; +} from '../../constants'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; diff --git a/tests/e2e/credential-status/create-encrypted.spec.ts b/tests/e2e/parallel/credential-status/create-encrypted.spec.ts similarity index 97% rename from tests/e2e/credential-status/create-encrypted.spec.ts rename to tests/e2e/parallel/credential-status/create-encrypted.spec.ts index 373a8c2c8..333c127ac 100644 --- a/tests/e2e/credential-status/create-encrypted.spec.ts +++ b/tests/e2e/parallel/credential-status/create-encrypted.spec.ts @@ -3,7 +3,7 @@ import { PAYLOADS_PATH, STORAGE_STATE_AUTHENTICATED, DEFAULT_DOES_NOT_HAVE_PERMISSIONS, -} from '../constants'; +} from '../../constants'; import * as fs from 'fs'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; diff --git a/tests/e2e/credential-status/create-unencrypted.spec.ts b/tests/e2e/parallel/credential-status/create-unencrypted.spec.ts similarity index 97% rename from tests/e2e/credential-status/create-unencrypted.spec.ts rename to tests/e2e/parallel/credential-status/create-unencrypted.spec.ts index 0cfa908ea..033d497d5 100644 --- a/tests/e2e/credential-status/create-unencrypted.spec.ts +++ b/tests/e2e/parallel/credential-status/create-unencrypted.spec.ts @@ -3,7 +3,7 @@ import { PAYLOADS_PATH, STORAGE_STATE_AUTHENTICATED, DEFAULT_DOES_NOT_HAVE_PERMISSIONS, -} from '../constants'; +} from '../../constants'; import * as fs from 'fs'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; diff --git a/tests/e2e/credential-status/search-no-auth.spec.ts b/tests/e2e/parallel/credential-status/search-no-auth.spec.ts similarity index 99% rename from tests/e2e/credential-status/search-no-auth.spec.ts rename to tests/e2e/parallel/credential-status/search-no-auth.spec.ts index fb5b94514..1a53250cf 100644 --- a/tests/e2e/credential-status/search-no-auth.spec.ts +++ b/tests/e2e/parallel/credential-status/search-no-auth.spec.ts @@ -6,7 +6,7 @@ import { STORAGE_STATE_UNAUTHENTICATED, DEFAULT_STATUS_LIST_UNENCRYPTED_NAME, DEFAULT_TESTNET_DID_IDENTIFIER, -} from '../constants'; +} from '../../constants'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; diff --git a/tests/e2e/credential-status/update-encrypted.spec.ts b/tests/e2e/parallel/credential-status/update-encrypted.spec.ts similarity index 97% rename from tests/e2e/credential-status/update-encrypted.spec.ts rename to tests/e2e/parallel/credential-status/update-encrypted.spec.ts index 16cb03228..6b139a02f 100644 --- a/tests/e2e/credential-status/update-encrypted.spec.ts +++ b/tests/e2e/parallel/credential-status/update-encrypted.spec.ts @@ -3,7 +3,7 @@ import { PAYLOADS_PATH, STORAGE_STATE_AUTHENTICATED, DEFAULT_DOES_NOT_HAVE_PERMISSIONS, -} from '../constants'; +} from '../../constants'; import * as fs from 'fs'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; diff --git a/tests/e2e/credential-status/update-unencrypted.spec.ts b/tests/e2e/parallel/credential-status/update-unencrypted.spec.ts similarity index 97% rename from tests/e2e/credential-status/update-unencrypted.spec.ts rename to tests/e2e/parallel/credential-status/update-unencrypted.spec.ts index 48b8507af..7bd907a2c 100644 --- a/tests/e2e/credential-status/update-unencrypted.spec.ts +++ b/tests/e2e/parallel/credential-status/update-unencrypted.spec.ts @@ -3,7 +3,7 @@ import { PAYLOADS_PATH, STORAGE_STATE_AUTHENTICATED, DEFAULT_DOES_NOT_HAVE_PERMISSIONS, -} from '../constants'; +} from '../../constants'; import * as fs from 'fs'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; diff --git a/tests/e2e/credential/revoke-negative.spec.ts b/tests/e2e/parallel/credential/revoke-negative.spec.ts similarity index 97% rename from tests/e2e/credential/revoke-negative.spec.ts rename to tests/e2e/parallel/credential/revoke-negative.spec.ts index 5166bd54b..0dd2cd979 100644 --- a/tests/e2e/credential/revoke-negative.spec.ts +++ b/tests/e2e/parallel/credential/revoke-negative.spec.ts @@ -3,7 +3,7 @@ import { PAYLOADS_PATH, STORAGE_STATE_AUTHENTICATED, DEFAULT_DOES_NOT_HAVE_PERMISSIONS, -} from '../constants'; +} from '../../constants'; import * as fs from 'fs'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; diff --git a/tests/e2e/credential/suspend-negative.spec.ts b/tests/e2e/parallel/credential/suspend-negative.spec.ts similarity index 97% rename from tests/e2e/credential/suspend-negative.spec.ts rename to tests/e2e/parallel/credential/suspend-negative.spec.ts index c098c3140..4296299ff 100644 --- a/tests/e2e/credential/suspend-negative.spec.ts +++ b/tests/e2e/parallel/credential/suspend-negative.spec.ts @@ -3,7 +3,7 @@ import { PAYLOADS_PATH, STORAGE_STATE_AUTHENTICATED, DEFAULT_DOES_NOT_HAVE_PERMISSIONS, -} from '../constants'; +} from '../../constants'; import * as fs from 'fs'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; diff --git a/tests/e2e/credential/verify-no-auth.spec.ts b/tests/e2e/parallel/credential/verify-no-auth.spec.ts similarity index 99% rename from tests/e2e/credential/verify-no-auth.spec.ts rename to tests/e2e/parallel/credential/verify-no-auth.spec.ts index 4a6efb932..4dd52ab8c 100644 --- a/tests/e2e/credential/verify-no-auth.spec.ts +++ b/tests/e2e/parallel/credential/verify-no-auth.spec.ts @@ -1,4 +1,4 @@ -import { CONTENT_TYPE, INVALID_JWT_TOKEN, GENERATED_PATH, STORAGE_STATE_UNAUTHENTICATED } from '../constants'; +import { CONTENT_TYPE, INVALID_JWT_TOKEN, GENERATED_PATH, STORAGE_STATE_UNAUTHENTICATED } from '../../constants'; import * as fs from 'fs'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; diff --git a/tests/e2e/did/create-negative.spec.ts b/tests/e2e/parallel/did/create-negative.spec.ts similarity index 99% rename from tests/e2e/did/create-negative.spec.ts rename to tests/e2e/parallel/did/create-negative.spec.ts index 2593d5532..f34c63d87 100644 --- a/tests/e2e/did/create-negative.spec.ts +++ b/tests/e2e/parallel/did/create-negative.spec.ts @@ -7,7 +7,7 @@ import { NOT_SUPPORTED_VERIFICATION_METHOD_TYPE, PAYLOADS_PATH, CONTENT_TYPE, -} from '../constants'; +} from '../../constants'; import * as fs from 'fs'; import { v4 } from 'uuid'; import { test, expect } from '@playwright/test'; diff --git a/tests/e2e/did/deactivate-negative.spec.ts b/tests/e2e/parallel/did/deactivate-negative.spec.ts similarity index 96% rename from tests/e2e/did/deactivate-negative.spec.ts rename to tests/e2e/parallel/did/deactivate-negative.spec.ts index a55b4c436..fb98879c0 100644 --- a/tests/e2e/did/deactivate-negative.spec.ts +++ b/tests/e2e/parallel/did/deactivate-negative.spec.ts @@ -1,6 +1,6 @@ import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; -import { DEFAULT_DOES_NOT_HAVE_PERMISSIONS, DEFAULT_MAINNET_DID } from '../constants'; +import { DEFAULT_DOES_NOT_HAVE_PERMISSIONS, DEFAULT_MAINNET_DID } from '../../constants'; import { UnsuccessfulResponseBody } from '@cheqd/credential-service/src/types/shared.js'; test.use({ storageState: 'playwright/.auth/user.json' }); diff --git a/tests/e2e/did/helpers.ts b/tests/e2e/parallel/did/helpers.ts similarity index 100% rename from tests/e2e/did/helpers.ts rename to tests/e2e/parallel/did/helpers.ts diff --git a/tests/e2e/did/search-no-auth.spec.ts b/tests/e2e/parallel/did/search-no-auth.spec.ts similarity index 99% rename from tests/e2e/did/search-no-auth.spec.ts rename to tests/e2e/parallel/did/search-no-auth.spec.ts index 5b8fe7100..27da1aba3 100644 --- a/tests/e2e/did/search-no-auth.spec.ts +++ b/tests/e2e/parallel/did/search-no-auth.spec.ts @@ -7,7 +7,7 @@ import { NOT_EXISTENT_TESTNET_DID, STORAGE_STATE_UNAUTHENTICATED, DID_NOT_FOUND_ERROR, -} from '../constants'; +} from '../../constants'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; diff --git a/tests/e2e/did/update-negative.spec.ts b/tests/e2e/parallel/did/update-negative.spec.ts similarity index 96% rename from tests/e2e/did/update-negative.spec.ts rename to tests/e2e/parallel/did/update-negative.spec.ts index 978af23fa..adb66e844 100644 --- a/tests/e2e/did/update-negative.spec.ts +++ b/tests/e2e/parallel/did/update-negative.spec.ts @@ -1,7 +1,7 @@ import * as fs from 'fs'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; -import { CONTENT_TYPE, DEFAULT_DOES_NOT_HAVE_PERMISSIONS, PAYLOADS_PATH } from '../constants'; +import { CONTENT_TYPE, DEFAULT_DOES_NOT_HAVE_PERMISSIONS, PAYLOADS_PATH } from '../../constants'; import { UnsuccessfulResponseBody } from '@cheqd/credential-service/src/types/shared.js'; test.use({ storageState: 'playwright/.auth/user.json' }); diff --git a/tests/e2e/presentation/verify-negative.spec.ts b/tests/e2e/parallel/presentation/verify-negative.spec.ts similarity index 97% rename from tests/e2e/presentation/verify-negative.spec.ts rename to tests/e2e/parallel/presentation/verify-negative.spec.ts index 50e5805e1..78eea71f2 100644 --- a/tests/e2e/presentation/verify-negative.spec.ts +++ b/tests/e2e/parallel/presentation/verify-negative.spec.ts @@ -1,7 +1,7 @@ import * as fs from 'fs'; // import { StatusCodes } from 'http-status-codes'; import { test, expect } from '@playwright/test'; -import { CONTENT_TYPE, PAYLOADS_PATH } from '../constants'; +import { CONTENT_TYPE, PAYLOADS_PATH } from '../../constants'; test.use({ storageState: 'playwright/.auth/user.json' }); diff --git a/tests/e2e/presentation/verify-positive.spec.ts b/tests/e2e/parallel/presentation/verify-positive.spec.ts similarity index 98% rename from tests/e2e/presentation/verify-positive.spec.ts rename to tests/e2e/parallel/presentation/verify-positive.spec.ts index e0b5ed5b3..9abf2c0f2 100644 --- a/tests/e2e/presentation/verify-positive.spec.ts +++ b/tests/e2e/parallel/presentation/verify-positive.spec.ts @@ -1,6 +1,6 @@ import * as fs from 'fs'; import { test, expect } from '@playwright/test'; -import { CONTENT_TYPE, PAYLOADS_PATH } from '../constants'; +import { CONTENT_TYPE, PAYLOADS_PATH } from '../../constants'; test.use({ storageState: 'playwright/.auth/user.json' }); diff --git a/tests/e2e/resource/create-negative.spec.ts b/tests/e2e/parallel/resource/create-negative.spec.ts similarity index 97% rename from tests/e2e/resource/create-negative.spec.ts rename to tests/e2e/parallel/resource/create-negative.spec.ts index 9f2170fe6..6964cfbcd 100644 --- a/tests/e2e/resource/create-negative.spec.ts +++ b/tests/e2e/parallel/resource/create-negative.spec.ts @@ -4,7 +4,7 @@ import { DEFAULT_MAINNET_DID, STORAGE_STATE_AUTHENTICATED, DEFAULT_DOES_NOT_HAVE_PERMISSIONS, -} from '../constants'; +} from '../../constants'; import * as fs from 'fs'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; diff --git a/tests/e2e/resource/search-no-auth.spec.ts b/tests/e2e/parallel/resource/search-no-auth.spec.ts similarity index 99% rename from tests/e2e/resource/search-no-auth.spec.ts rename to tests/e2e/parallel/resource/search-no-auth.spec.ts index c7bf3f69f..bbb59bacd 100644 --- a/tests/e2e/resource/search-no-auth.spec.ts +++ b/tests/e2e/parallel/resource/search-no-auth.spec.ts @@ -12,7 +12,7 @@ import { TESTNET_DID_WITH_IMAGE_RESOURCE_ID, TESTNET_DID_WITH_JSON_RESOURCE_ID, TESTNET_DID_WITH_JSON_RESOURCE, -} from '../constants'; +} from '../../constants'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; diff --git a/tests/e2e/credential/revocation-flow.spec.ts b/tests/e2e/sequential/credential/revocation-flow.spec.ts similarity index 97% rename from tests/e2e/credential/revocation-flow.spec.ts rename to tests/e2e/sequential/credential/revocation-flow.spec.ts index 7b4f379b5..f9e949823 100644 --- a/tests/e2e/credential/revocation-flow.spec.ts +++ b/tests/e2e/sequential/credential/revocation-flow.spec.ts @@ -1,9 +1,8 @@ import type { VerifiableCredential } from '@veramo/core'; - +import * as fs from 'fs'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; -import * as fs from 'fs'; -import { CONTENT_TYPE, PAYLOADS_PATH } from '../constants'; +import { CONTENT_TYPE, PAYLOADS_PATH } from '../../constants'; test.use({ storageState: 'playwright/.auth/user.json' }); diff --git a/tests/e2e/credential/suspension-flow.spec.ts b/tests/e2e/sequential/credential/suspension-flow.spec.ts similarity index 98% rename from tests/e2e/credential/suspension-flow.spec.ts rename to tests/e2e/sequential/credential/suspension-flow.spec.ts index f201e35a1..4c485c2b8 100644 --- a/tests/e2e/credential/suspension-flow.spec.ts +++ b/tests/e2e/sequential/credential/suspension-flow.spec.ts @@ -3,7 +3,7 @@ import type { VerifiableCredential } from '@veramo/core'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; import * as fs from 'fs'; -import { CONTENT_TYPE, PAYLOADS_PATH } from '../constants'; +import { CONTENT_TYPE, PAYLOADS_PATH } from '../../constants'; test.use({ storageState: 'playwright/.auth/user.json' }); diff --git a/tests/e2e/did/create-positive.release.spec.ts b/tests/e2e/sequential/did/create-positive.release.spec.ts similarity index 97% rename from tests/e2e/did/create-positive.release.spec.ts rename to tests/e2e/sequential/did/create-positive.release.spec.ts index eca263ae2..082bb9b1f 100644 --- a/tests/e2e/did/create-positive.release.spec.ts +++ b/tests/e2e/sequential/did/create-positive.release.spec.ts @@ -1,6 +1,6 @@ -import { ID_TYPE, DEFAULT_CONTEXT, CONTENT_TYPE } from '../constants'; +import { ID_TYPE, DEFAULT_CONTEXT, CONTENT_TYPE } from '../../constants'; import { v4 } from 'uuid'; -import { buildSimpleService } from '../helpers'; +import { buildSimpleService } from '../../helpers'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; diff --git a/tests/e2e/did/switch-controller-flow.release.spec.ts b/tests/e2e/sequential/did/switch-controller-flow.release.spec.ts similarity index 99% rename from tests/e2e/did/switch-controller-flow.release.spec.ts rename to tests/e2e/sequential/did/switch-controller-flow.release.spec.ts index aa9513e68..f134551e4 100644 --- a/tests/e2e/did/switch-controller-flow.release.spec.ts +++ b/tests/e2e/sequential/did/switch-controller-flow.release.spec.ts @@ -1,4 +1,4 @@ -import { CONTENT_TYPE, ID_TYPE } from '../constants'; +import { CONTENT_TYPE, ID_TYPE } from '../../constants'; import { test, expect } from '@playwright/test'; import { StatusCodes } from 'http-status-codes'; import { @@ -7,10 +7,10 @@ import { mustIncludeKey, mustIncludeKeyControllerRef, mustAllControllerKeysHaveController, -} from './helpers'; +} from '../../parallel/did/helpers'; import { CheqdNetwork, DIDDocument, VerificationMethods } from '@cheqd/sdk'; -import { ResponseBody } from './helpers'; +import { ResponseBody } from '../../parallel/did/helpers'; test.use({ storageState: 'playwright/.auth/user.json' });