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 (
@@ -28,9 +28,17 @@ export default function Home() { {debug && (

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)} +

)} diff --git a/package.json b/package.json index 7348edbe2..690e1e163 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "dev": "turbo dev", "e2e": "turbo dev e2e", "e2e:ui": "turbo dev e2e:ui", - "e2e:ci": "turbo e2e", + "e2e:ci": "turbo e2e:ci", "lint": "turbo lint", "format": "turbo format", "format:check": "turbo format:check", diff --git a/turbo.json b/turbo.json index 2c25c1f85..a2144a0dc 100644 --- a/turbo.json +++ b/turbo.json @@ -12,17 +12,18 @@ }, "dev": { "persistent": true, - "dependsOn": ["^build:deps", "^dev"], + "dependsOn": ["^build:deps"], "outputs": [".next/**", "!.next/cache/**"] }, "lint": {}, "format": {}, "format:check": {}, - "e2e": { - "persistent": true - }, + "e2e": {}, "e2e:ui": { "persistent": true + }, + "e2e:ci": { + "dependsOn": ["^build:deps"] } } }