From 953668d1c30f90cf091ae660106efa4045261be7 Mon Sep 17 00:00:00 2001 From: Allain Magyar Date: Thu, 1 Feb 2024 23:37:46 -0300 Subject: [PATCH 1/2] test: major refactor + retry --- .github/workflows/e2e-tests.yml | 10 +- integration-tests/e2e-tests/.eslintrc.yml | 3 +- .../e2e-tests/config/cucumber.sdk.js | 12 - integration-tests/e2e-tests/cucumber.js | 18 + .../features/create_connection.feature | 17 + .../provide_proof.feature} | 3 +- .../receive_anoncred_credential.feature} | 4 +- .../receive_jwt_credential.feature} | 4 +- integration-tests/e2e-tests/package.json | 52 +- .../e2e-tests/{tests => src}/Utils.ts | 13 + .../{tests/sdk => src/abilities}/WalletSdk.ts | 10 +- .../configuration/CloudAgentConfiguration.ts | 2 +- .../configuration}/PlutoInMemory.ts | 0 .../configuration}/serenity.config.ts | 7 +- .../{tests => src/screenplay}/Expectations.ts | 0 .../{tests => src/screenplay}/Questions.ts | 0 .../sdk => src}/steps/CloudAgentSteps.ts | 18 +- .../sdk => src}/steps/EdgeAgentSteps.ts | 6 +- .../sdk => src}/steps/LifecycleSteps.ts | 12 +- .../workflow}/CloudAgentWorkflow.ts | 11 +- .../src => src/workflow}/EdgeAgentWorkflow.ts | 4 +- .../sdk/features/CreateConnection.feature | 8 - integration-tests/e2e-tests/tsconfig.json | 25 +- integration-tests/e2e-tests/yarn.lock | 2526 ++++------------- 24 files changed, 644 insertions(+), 2121 deletions(-) delete mode 100644 integration-tests/e2e-tests/config/cucumber.sdk.js create mode 100644 integration-tests/e2e-tests/cucumber.js create mode 100644 integration-tests/e2e-tests/features/create_connection.feature rename integration-tests/e2e-tests/{tests/sdk/features/ProvideProof.feature => features/provide_proof.feature} (91%) rename integration-tests/e2e-tests/{tests/sdk/features/Anoncred.feature => features/receive_anoncred_credential.feature} (89%) rename integration-tests/e2e-tests/{tests/sdk/features/Credential.feature => features/receive_jwt_credential.feature} (96%) rename integration-tests/e2e-tests/{tests => src}/Utils.ts (56%) rename integration-tests/e2e-tests/{tests/sdk => src/abilities}/WalletSdk.ts (93%) rename integration-tests/e2e-tests/{tests/sdk => src}/configuration/CloudAgentConfiguration.ts (99%) rename integration-tests/e2e-tests/{tests/sdk/src => src/configuration}/PlutoInMemory.ts (100%) rename integration-tests/e2e-tests/{config => src/configuration}/serenity.config.ts (75%) rename integration-tests/e2e-tests/{tests => src/screenplay}/Expectations.ts (100%) rename integration-tests/e2e-tests/{tests => src/screenplay}/Questions.ts (100%) rename integration-tests/e2e-tests/{tests/sdk => src}/steps/CloudAgentSteps.ts (69%) rename integration-tests/e2e-tests/{tests/sdk => src}/steps/EdgeAgentSteps.ts (95%) rename integration-tests/e2e-tests/{tests/sdk => src}/steps/LifecycleSteps.ts (79%) rename integration-tests/e2e-tests/{tests/sdk/src => src/workflow}/CloudAgentWorkflow.ts (93%) rename integration-tests/e2e-tests/{tests/sdk/src => src/workflow}/EdgeAgentWorkflow.ts (97%) delete mode 100644 integration-tests/e2e-tests/tests/sdk/features/CreateConnection.feature diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index ae56adacc..4e4249250 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -111,17 +111,13 @@ jobs: working-directory: integration-tests/e2e-tests run: yarn test:sdk - - name: Generate end-to-end report - working-directory: integration-tests/e2e-tests - run: yarn test:sdk:report - - name: Add notes to summary working-directory: integration-tests/e2e-tests run: cat notes >> $GITHUB_STEP_SUMMARY - name: Publish Serenity report - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: atala-prism-sdk-ts - path: integration-tests/e2e-tests/target/site/wallet-sdk-ts + name: sdk-ts-e2e-results + path: integration-tests/e2e-tests/target/sdk-ts-e2e-results.html if-no-files-found: error diff --git a/integration-tests/e2e-tests/.eslintrc.yml b/integration-tests/e2e-tests/.eslintrc.yml index 7952d7601..3e16b6154 100644 --- a/integration-tests/e2e-tests/.eslintrc.yml +++ b/integration-tests/e2e-tests/.eslintrc.yml @@ -2,10 +2,11 @@ root: true ignorePatterns: - target env: - es2021: true + esnext: true node: true extends: - eslint:recommended + - plugin:@typescript-eslint/eslint-recommended - plugin:@typescript-eslint/recommended parser: '@typescript-eslint/parser' parserOptions: diff --git a/integration-tests/e2e-tests/config/cucumber.sdk.js b/integration-tests/e2e-tests/config/cucumber.sdk.js deleted file mode 100644 index 85435d253..000000000 --- a/integration-tests/e2e-tests/config/cucumber.sdk.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - default: [ - "--format '@serenity-js/cucumber'", - "--require=tests/sdk/steps/**/*.ts", - "--require=config/serenity.config.ts", - "--require-module=ts-node/register", - "--backtrace" - ].join(" "), - glue: [ - "tests/sdk/src/**/*.ts" - ] -} diff --git a/integration-tests/e2e-tests/cucumber.js b/integration-tests/e2e-tests/cucumber.js new file mode 100644 index 000000000..ff38c16b6 --- /dev/null +++ b/integration-tests/e2e-tests/cucumber.js @@ -0,0 +1,18 @@ +module.exports = { + default: { + format: [ + "@serenity-js/cucumber", + ["html", "target/sdk-ts-e2e-results.html"], + ], + formatOptions: { + junit: { + suiteName: "E2E: Prism Wallet SDK - TS" + } + }, + requireModule: ["ts-node/register"], + require: [ + "src/**/*.ts" + ], + retry: 1 + } +} diff --git a/integration-tests/e2e-tests/features/create_connection.feature b/integration-tests/e2e-tests/features/create_connection.feature new file mode 100644 index 000000000..68356e25e --- /dev/null +++ b/integration-tests/e2e-tests/features/create_connection.feature @@ -0,0 +1,17 @@ +@connection +Feature: Create connection + The Edge Agent should be able to create a connection to prism-agent + + Scenario Outline: Create connection + Given Cloud Agent has a connection invitation with '