diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d5cc5fa9c..3043fda9e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -76,6 +76,8 @@ jobs: - name: Install Playwright Browsers run: pnpm example:next e2e:deps - name: Run Playwright tests + env: + BRANCH_NAME: ${{ github.head_ref }} run: pnpm e2e:ci - uses: actions/upload-artifact@v4 if: always() diff --git a/examples/starknet-react-next/playwright.config.ts b/examples/starknet-react-next/playwright.config.ts index 3a31323cb..c208f2c9b 100644 --- a/examples/starknet-react-next/playwright.config.ts +++ b/examples/starknet-react-next/playwright.config.ts @@ -1,5 +1,6 @@ import { defineConfig, devices } from "@playwright/test"; -import { KEYCHAIN_URL } from "components/providers/StarknetProvider"; + +const CI_BASE_URL = `https://cartridge-starknet-react-next-git-${process.env.BRANCH_NAME}.preview.cartridge.gg`; export default defineConfig({ testDir: "./tests", @@ -8,7 +9,7 @@ export default defineConfig({ retries: process.env.CI ? 2 : 0, reporter: process.env.CI ? "dot" : "list", use: { - baseURL: process.env.CI ? KEYCHAIN_URL : "http://localhost:3002", + baseURL: process.env.CI ? CI_BASE_URL : "http://localhost:3002", trace: "on-first-retry", }, projects: [ diff --git a/examples/starknet-react-next/src/app/page.tsx b/examples/starknet-react-next/src/app/page.tsx index d6791dec8..0f241a3bd 100644 --- a/examples/starknet-react-next/src/app/page.tsx +++ b/examples/starknet-react-next/src/app/page.tsx @@ -1,4 +1,4 @@ -'use client' +"use client"; import { TransferEth } from "components/TransferEth"; import { ConnectWallet } from "components/ConnectWallet"; @@ -13,8 +13,8 @@ import { useEffect, useState } from "react"; export default function Home() { const [debug, setDebug] = useState(false); useEffect(() => { - setDebug(!!new URLSearchParams(window.location.search).get("debug")) - }, []) + setDebug(!!new URLSearchParams(window.location.search).get("debug")); + }, []); return (
Keychain URL: {KEYCHAIN_URL}
-NEXT_PUBLIC_VERCEL_ENV: {String(process.env.NEXT_PUBLIC_VERCEL_ENV)}
-NEXT_PUBLIC_VERCEL_BRANCH_URL: {String(process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL)}
-NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL: {String(process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL)}
++ NEXT_PUBLIC_VERCEL_ENV: {String(process.env.NEXT_PUBLIC_VERCEL_ENV)} +
++ NEXT_PUBLIC_VERCEL_BRANCH_URL:{" "} + {String(process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL)} +
++ NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL:{" "} + {String(process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL)} +