diff --git a/.github/workflows/run-e2e-test.yml b/.github/workflows/run-e2e-test.yml index 042cb34..0839be0 100644 --- a/.github/workflows/run-e2e-test.yml +++ b/.github/workflows/run-e2e-test.yml @@ -2,7 +2,7 @@ name: Run E2E Test on: push: - branches: [ "add-workflow-2" ] + branches: [ "add-workflow-2", "refactor-report"] pull_request: branches: [ "main" ] @@ -20,6 +20,12 @@ jobs: steps: - name: Check Out Repository Code uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 21 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 @@ -61,25 +67,30 @@ jobs: with: name: sdk-sepolia-test-report path: | - ./test-reports + ./allure-results if: always() - - name: Copy report to date folder - id: create_folder - run: | - folder_name=$(date +%Y%m%d) - echo "Folder name: $folder_name" - - mkdir -p ./tmp/$folder_name - cp -R ./test-reports/* ./tmp/$folder_name - cp -R ./template/l1-test-report-template.html ./tmp/$folder_name/l1-test-report.html - # Deploy report to GitHub Pages - - name: Deploy report to GitHub Pages + - name: Load test report history + uses: actions/checkout@v3 if: always() + continue-on-error: true + with: + ref: gh-pages + path: gh-pages + + - name: Build test report + uses: simple-elf/allure-report-action@v1.7 + if: always() + with: + gh_pages: gh-pages + allure_history: allure-history + allure_results: build/allure-results + + - name: Publish test report uses: peaceiris/actions-gh-pages@v4 + if: always() with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./tmp publish_branch: gh-pages - keep_files: true + publish_dir: allure-history diff --git a/package.json b/package.json index 67bec0d..b5f46eb 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "scripts": { "test:sepolia:smoke": "env TEST_ENV='sepolia' mocha -r ts-node/register -r mocha-steps --grep '\\[smoke\\]' './test/**/**/*.test.ts' --timeout 240000 --reporter mochawesome --reporter-options reportDir='test-reports',reportFilename='[status]_[datetime]_sdk-test-report',timestamp='mm-dd-yyyy_HHMMss',reportTitle='SDK Test Report'", "test:story:smoke": "env TEST_ENV='storyTestnet' mocha -r ts-node/register -r mocha-steps --grep '\\[smoke\\]' './test/**/**/*.test.ts' --timeout 240000 --reporter mochawesome --reporter-options reportDir='test-reports',reportFilename='[status]_[datetime]_sdk-test-report',timestamp='mm-dd-yyyy_HHMMss',reportTitle='SDK Test Report'", - "test:sepolia:e2e": "env TEST_ENV='sepolia' mocha -r ts-node/register -r mocha-steps './test/**/e2e/*.test.ts' --timeout 240000 --reporter mochawesome --reporter-options reportDir='test-reports',reportFilename='[status]_[datetime]_sdk-test-report',timestamp='mm-dd-yyyy_HHMMss',reportTitle='SDK Test Report'", - "test:story:e2e": "env TEST_ENV='storyTestnet' mocha -r ts-node/register -r mocha-steps './test/**/e2e/*.test.ts' --timeout 240000 --reporter mochawesome --reporter-options reportDir='test-reports',reportFilename='[status]_[datetime]_sdk-test-report',timestamp='mm-dd-yyyy_HHMMss',reportTitle='SDK Test Report'", + "test:sepolia:e2e": "env TEST_ENV='sepolia' mocha -r ts-node/register -r mocha-steps './test/**/e2e/*.test.ts' --timeout 240000 --reporter allure-mocha --reporter-options reportDir='test-reports',reportFilename='[status]_[datetime]_sdk-test-report',timestamp='mm-dd-yyyy_HHMMss',reportTitle='SDK Test Report'", + "test:story:e2e": "env TEST_ENV='storyTestnet' mocha -r ts-node/register -r mocha-steps './test/**/e2e/*.test.ts' --timeout 240000 --reporter allure-mocha --reporter-options reportDir='test-reports',reportFilename='[status]_[datetime]_sdk-test-report',timestamp='mm-dd-yyyy_HHMMss',reportTitle='SDK Test Report'", "test:sepolia": "env TEST_ENV='sepolia' mocha -r ts-node/register -r mocha-steps './test/**/**/**.test.ts' --timeout 240000 --reporter mochawesome --reporter-options reportDir='test-reports',reportFilename='[status]_[datetime]_sdk-test-report',timestamp='mm-dd-yyyy_HHMMss',reportTitle='SDK Test Report'", "test:story": "env TEST_ENV='storyTestnet' mocha -r ts-node/register -r mocha-steps './test/**/**/*.test.ts' --timeout 240000 --reporter mochawesome --reporter-options reportDir='test-reports',reportFilename='[status]_[datetime]_sdk-test-report',timestamp='mm-dd-yyyy_HHMMss',reportTitle='SDK Test Report'", "open:report": "open test-reports/*.html", @@ -29,6 +29,8 @@ "@types/mochawesome": "^6.2.4", "@types/node": "^20.8.2", "@types/sinon": "^10.0.18", + "allure-commandline": "^2.29.0", + "allure-mocha": "^3.0.0-beta.7", "chai": "^4.3.10", "chai-as-promised": "^7.1.1", "eslint": "^8.50.0", diff --git a/test/e2e/derivativeIP.comRemixPIL.test.ts b/test/e2e/derivativeIP.comRemixPIL.test.ts index 7675e6c..7d20a37 100644 --- a/test/e2e/derivativeIP.comRemixPIL.test.ts +++ b/test/e2e/derivativeIP.comRemixPIL.test.ts @@ -22,7 +22,7 @@ let licenseTokenIdB: string; const waitForTransaction: boolean = true; describe("SDK E2E Test - Register Derivative IP Asset with Commercial Remix PIL", function () { - describe("@smoke Register a derivative IP asset with/without license tokens", async function () { + describe.only("@smoke Register a derivative IP asset with/without license tokens", async function () { step("Mint a NFT to Wallet A and get a tokenId (tokenIdA)", async function () { tokenIdA = await mintNFTWithRetry(privateKeyA); checkMintResult(tokenIdA);