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
GRAFANA_ADMIN_PWD=
# Used to set the display to be used by playwright when running Metamask test service
MM_DISPLAY=host.docker.internal:0
MM_DISPLAY_VOLUME=/tmp/.X11-unix:/tmp/.X11-unix
\ No newline at end of file
# Used to set the display to be used by playwright when running Metamask test service.
# The following are to be used if running on MacOS
# MM_DISPLAY=host.docker.internal:0
# MM_DISPLAY_VOLUME=/tmp/.X11-unix:/tmp/.X11-unix
MM_DISPLAY=
MM_DISPLAY_VOLUME=
......@@ -35,10 +35,23 @@ services:
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PWD}
volumes:
- ./datesources.yml:/etc/grafana/provisioning/datasources/datasources.yaml
- ./datasources.yml:/etc/grafana/provisioning/datasources/datasources.yaml
security_opt:
- "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
# my_test_service:
# build: ./my_test_service_dir
......
FROM node:18
FROM mcr.microsoft.com/playwright:v1.37.1-jammy
WORKDIR /app
COPY ./ ./
ENV PATH /app/node_modules/.bin:$PATH
RUN npm i -g pnpm
RUN pnpm install
COPY package.json /app/
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
......@@ -19,7 +19,7 @@
},
"devDependencies": {
"@metamask/test-dapp": "^7.1.0",
"@playwright/test": "^1.37.1",
"@playwright/test": "1.37.1",
"@synthetixio/synpress": "3.7.2-beta.5",
"dotenv": "^16.3.1",
"static-server": "^2.2.1",
......
......@@ -40,7 +40,7 @@ export default defineConfig({
/* Run your local dev server before starting the tests */
webServer: {
command: 'pnpm run start:metamask-dapp',
command: 'npm run start:metamask-dapp',
url: process.env.METAMASK_DAPP_URL,
reuseExistingServer: false,
},
......
#!/bin/bash
npm test
\ No newline at end of file
......@@ -80,7 +80,7 @@ test('Send an EIP-1559 transaciton and verfiy success', async () => {
const txHash = await txHashPromise
// 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.
// 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