Commit e24d7720 authored by OptimismBot's avatar OptimismBot Committed by GitHub

Merge pull request #7152 from ethereum-optimism/wyatt/ufm/metamask-send-tx-test-docker

Metamask send tx test Docker support
parents 753a1973 177e79d9
...@@ -2,6 +2,9 @@ CI=false ...@@ -2,6 +2,9 @@ CI=false
GRAFANA_ADMIN_PWD= GRAFANA_ADMIN_PWD=
# Used to set the display to be used by playwright when running Metamask test service # Used to set the display to be used by playwright when running Metamask test service.
MM_DISPLAY=host.docker.internal:0 # The following are to be used if running on MacOS
MM_DISPLAY_VOLUME=/tmp/.X11-unix:/tmp/.X11-unix # MM_DISPLAY=host.docker.internal:0
\ No newline at end of file # MM_DISPLAY_VOLUME=/tmp/.X11-unix:/tmp/.X11-unix
MM_DISPLAY=
MM_DISPLAY_VOLUME=
...@@ -35,10 +35,23 @@ services: ...@@ -35,10 +35,23 @@ services:
environment: environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PWD} - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PWD}
volumes: volumes:
- ./datesources.yml:/etc/grafana/provisioning/datasources/datasources.yaml - ./datasources.yml:/etc/grafana/provisioning/datasources/datasources.yaml
security_opt: security_opt:
- "no-new-privileges:true" - "no-new-privileges:true"
metamask:
build: ./metamask
container_name: test-service-metamask
profiles: ["30minute"]
depends_on:
- prometheus
environment:
DISPLAY: ${MM_DISPLAY:-:0}
CI: ${CI:-true}
volumes:
- ${MM_DISPLAY_VOLUME}
restart: no
# Example Test Service Config # Example Test Service Config
# my_test_service: # my_test_service:
# build: ./my_test_service_dir # build: ./my_test_service_dir
......
FROM node:18 FROM mcr.microsoft.com/playwright:v1.37.1-jammy
WORKDIR /app WORKDIR /app
COPY ./ ./ ENV PATH /app/node_modules/.bin:$PATH
RUN npm i -g pnpm COPY package.json /app/
RUN pnpm install
RUN npm install
COPY tests /app/tests/
COPY .env /app/
COPY playwright.config.ts /app/
COPY start.sh /app/
COPY tsconfig.json /app/
CMD /bin/sh /app/start.sh CMD /bin/sh /app/start.sh
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
}, },
"devDependencies": { "devDependencies": {
"@metamask/test-dapp": "^7.1.0", "@metamask/test-dapp": "^7.1.0",
"@playwright/test": "^1.37.1", "@playwright/test": "1.37.1",
"@synthetixio/synpress": "3.7.2-beta.5", "@synthetixio/synpress": "3.7.2-beta.5",
"dotenv": "^16.3.1", "dotenv": "^16.3.1",
"static-server": "^2.2.1", "static-server": "^2.2.1",
......
...@@ -40,7 +40,7 @@ export default defineConfig({ ...@@ -40,7 +40,7 @@ export default defineConfig({
/* Run your local dev server before starting the tests */ /* Run your local dev server before starting the tests */
webServer: { webServer: {
command: 'pnpm run start:metamask-dapp', command: 'npm run start:metamask-dapp',
url: process.env.METAMASK_DAPP_URL, url: process.env.METAMASK_DAPP_URL,
reuseExistingServer: false, reuseExistingServer: false,
}, },
......
#!/bin/bash #!/bin/bash
\ No newline at end of file
npm test
\ No newline at end of file
...@@ -79,8 +79,8 @@ test('Send an EIP-1559 transaciton and verfiy success', async () => { ...@@ -79,8 +79,8 @@ test('Send an EIP-1559 transaciton and verfiy success', async () => {
await metamask.confirmTransaction() await metamask.confirmTransaction()
const txHash = await txHashPromise const txHash = await txHashPromise
// Waiting for Infura (Metamask given provider) to index our transaction // Waiting for Infura (Metamask given provider) to index our transaction
await sharedPage.waitForTimeout(2_000) await sharedPage.waitForTimeout(10_000)
// Metamask test dApp allows us access to the Metamask RPC provider via loading this URL. // Metamask test dApp allows us access to the Metamask RPC provider via loading this URL.
// The RPC reponse will be populated onto the page that's loaded. // The RPC reponse will be populated onto the page that's loaded.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment