From bc88761cf4655ac3c7fb3731f37178cae4fd72fa Mon Sep 17 00:00:00 2001 From: frazarshad Date: Tue, 12 Nov 2024 18:09:12 +0500 Subject: [PATCH 1/2] ci: bump github actions (#52) * ci: bump upload-artifact * build: remove http-get usage --- .github/workflows/e2e_docker.yml | 20 +++----------------- docker-compose.ci.keplr.yml | 15 ++++++++++++++- package.json | 9 --------- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/.github/workflows/e2e_docker.yml b/.github/workflows/e2e_docker.yml index 38fd44336..20a7bd50a 100644 --- a/.github/workflows/e2e_docker.yml +++ b/.github/workflows/e2e_docker.yml @@ -23,25 +23,11 @@ jobs: steps: - name: Checkout - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # pin@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # pin@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1 # pin@v1 - - - name: Cache Docker layers - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # pin@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- + uses: actions/checkout@v4 - name: Run e2e tests (${{ matrix.resolution }} res) run: | - docker-compose -f docker-compose.ci.keplr.yml --env-file ${{ matrix.resolution }}-res.env --profile synpress up --build --exit-code-from synpress + docker compose -f docker-compose.ci.keplr.yml --env-file ${{ matrix.resolution }}-res.env --profile synpress up --build --exit-code-from synpress env: COMPOSE_DOCKER_CLI_BUILD: 1 DOCKER_BUILDKIT: 1 @@ -61,7 +47,7 @@ jobs: COMMIT_INFO_SHA: ${{ github.event.pull_request.head.sha }} - name: Archive e2e artifacts (${{ matrix.resolution }} res) - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # pin@v2 + uses: actions/upload-artifact@v4 if: always() with: name: e2e-artifacts-${{ matrix.resolution }}-res diff --git a/docker-compose.ci.keplr.yml b/docker-compose.ci.keplr.yml index 7e2dfa29a..3948ec3cb 100644 --- a/docker-compose.ci.keplr.yml +++ b/docker-compose.ci.keplr.yml @@ -44,7 +44,20 @@ services: - ./docker/videos:/app/tests/e2e/videos - ./docker/screenshots:/app/tests/e2e/screenshots command: > - bash -c 'echo -n "======> local noVNC URL: http://localhost:8080/vnc.html?autoconnect=true " && pnpm wait-on http://display:8080 && echo -n "======> remote noVNC URL: " && curl -s ngrok:4040/api/tunnels | jq -r .tunnels[0].public_url && pnpm test:e2e:ci:keplr' + bash -c ' + echo -n "======> local noVNC URL: http://localhost:8080/vnc.html?autoconnect=true " && + pnpm wait-on http://display:8080 && + echo -n "======> remote noVNC URL: " && + curl -s ngrok:4040/api/tunnels | jq -r .tunnels[0].public_url && + + # Start development server and wait for it to be ready + VITE_RUN_ENV=agoric_chain pnpm start:ui & sleep 5 && + + # start json server + pnpm start:json-server & sleep 5 && + + # Run end-to-end tests + pnpm synpress:run:keplr' networks: - x11 diff --git a/package.json b/package.json index ad3e10912..38134df40 100644 --- a/package.json +++ b/package.json @@ -52,16 +52,7 @@ "start:ui": "cd tools/ui && pnpm dev", "start:json-server": "json-server tools/json-server-db.json --port 3004", "synpress:run:metamask": "CYPRESS_SPEC_PATTERN=tests/e2e/specs/metamask/** EXTENSION=metamask SKIP_EXTENSION_SETUP=true SYNPRESS_LOCAL_TEST=true node synpress.js run --configFile=synpress.config.js", - "test:e2e:metamask": "start-server-and-test 'pnpm start:server' http-get://localhost:3000 'pnpm synpress:run:metamask'", - "test:e2e:anvil": "start-server-and-test 'turbo start:server' http-get://localhost:3000 'CYPRESS_USE_ANVIL=true pnpm synpress:run'", - "test:e2e:headless": "start-server-and-test 'turbo start:server' http-get://localhost:3000 'pnpm synpress:run --headless'", - "test:e2e:headless:anvil": "start-server-and-test 'turbo start:server' http-get://localhost:3000 'CYPRESS_USE_ANVIL=true pnpm synpress:run --headless'", - "test:e2e:ci": "start-server-and-test 'VITE_RUN_ENV=agoric_chain pnpm start:ui' http-get://localhost:3000 'pnpm start:json-server' http-get://localhost:3004 'pnpm synpress:run --record --group'", - "test:e2e:ci:keplr": "start-server-and-test 'VITE_RUN_ENV=agoric_chain pnpm start:ui' http-get://localhost:3000 'pnpm start:json-server' http-get://localhost:3004 'pnpm synpress:run:keplr'", - "test:e2e:ci:anvil": "start-server-and-test 'turbo start:server' http-get://localhost:3000 'CYPRESS_USE_ANVIL=true pnpm synpress:run --record --group'", - "test:e2e:ci:cypress-action": "CYPRESS_USE_ANVIL=true pnpm synpress:run", "synpress:run:keplr": "CYPRESS_SPEC_PATTERN=tests/e2e/specs/keplr/** EXTENSION=keplr SKIP_EXTENSION_SETUP=true SYNPRESS_LOCAL_TEST=true node synpress.js run --configFile=synpress.config.js", - "test:e2e:keplr": "start-server-and-test 'pnpm start:ui' http-get://localhost:3000 'pnpm start:json-server' http-get://localhost:3004 'pnpm synpress:run:keplr'", "prepare": "husky" }, "dependencies": { From 1488846c99087ba292d8b12b21c7c3d935195002 Mon Sep 17 00:00:00 2001 From: Rabi Siddique <60459172+rabi-siddique@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:00:20 +0500 Subject: [PATCH 2/2] fix: remove whitespaces around extension id (#54) --- commands/keplr.js | 2 +- commands/playwright-keplr.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/keplr.js b/commands/keplr.js index 4372aa918..29b6e5c15 100644 --- a/commands/keplr.js +++ b/commands/keplr.js @@ -69,7 +69,7 @@ const keplr = { async getExtensionDetails() { const keplrExtensionData = (await playwright.getExtensionsData()).keplr; - extensionId = keplrExtensionData.id; + extensionId = keplrExtensionData.id.trim(); extensionVersion = keplrExtensionData.version; registrationUrl = `chrome-extension://${extensionId}/register.html`; permissionsUrl = `chrome-extension://${extensionId}/popup.html#/setting/security/permission`; diff --git a/commands/playwright-keplr.js b/commands/playwright-keplr.js index fc5d03b38..581f7839b 100644 --- a/commands/playwright-keplr.js +++ b/commands/playwright-keplr.js @@ -149,7 +149,7 @@ module.exports = { } else if ( page .url() - .includes(`chrome-extension://${keplrExtensionData.id}/register.html`) + .includes(`chrome-extension://${keplrExtensionData.id.trim()}/register.html`) ) { keplrWindow = page; } diff --git a/package.json b/package.json index 38134df40..08206f79f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@agoric/synpress", - "version": "3.8.2", + "version": "3.8.3-beta.2", "description": "Synpress is e2e testing framework based around Cypress.io & playwright with included MetaMask support. Test your dapps with ease.", "keywords": [ "Synpress",