Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/playwright-pizza.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Playwright Pizza Shop

on: [pull_request]

jobs:
vercel-pizza:
name: Wait for Vercel (pizza-shop)
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
preview_url: ${{ steps.waitForVercelPreviewDeployment.outputs.url }}
steps:
- name: Wait for Vercel pizza environment to be ready
uses: patrickedqvist/wait-for-vercel-preview@dca4940010f36d2d44caa487087a09b57939b24a #v1.3.1
id: waitForVercelPreviewDeployment
with:
environment: "Preview – monorepo-testing-workshop-pizza-shop"
token: ${{ secrets.GITHUB_TOKEN }}
check_interval: 30
max_timeout: 400

playwright-pizza:
needs: vercel-pizza
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0

- name: Pnpm install
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 #v2.4.0
with:
run_install: true

- name: Setup node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d #v3.8.1
with:
node-version: 18
cache: "pnpm"

- name: Show preview url
run: echo ${{ needs.vercel-pizza.outputs.preview_url }}

- name: Run Playwright tests
run: pnpm --filter pizza-shop run e2e
env:
PLAYWRIGHT_BASE_URL: ${{ needs.vercel-pizza.outputs.preview_url }}
67 changes: 39 additions & 28 deletions .github/workflows/playwright-ta.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,46 @@
# name: Playwright Test Automation
name: Playwright Test Automation

# on: [pull_request]
on: [pull_request]

# jobs:
# vercel-ta:
# name: Wait for Vercel (test-automation)
# WRITE YOUR CODE HERE
# USE: https://github.com/patrickedqvist/wait-for-vercel-preview
jobs:
vercel-ta:
name: Wait for Vercel (test-automation)
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
preview_url: ${{ steps.waitForVercelPreviewDeployment.outputs.url }}
steps:
- name: Wait for Vercel test automation environment to be ready
uses: patrickedqvist/wait-for-vercel-preview@dca4940010f36d2d44caa487087a09b57939b24a #v1.3.1
id: waitForVercelPreviewDeployment
with:
environment: "Preview – monorepo-testing-workshop-test-automation"
token: ${{ secrets.GITHUB_TOKEN }}
check_interval: 30
max_timeout: 400

# playwright-ta:
# needs: vercel-ta
# runs-on: ubuntu-latest
# timeout-minutes: 10
# steps:
# - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
playwright-ta:
needs: vercel-ta
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0

# - name: Pnpm install
# uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 #v2.4.0
# with:
# run_install: true
- name: Pnpm install
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 #v2.4.0
with:
run_install: true

# - name: Setup node
# uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d #v3.8.1
# with:
# node-version: 18
# cache: "pnpm"
- name: Setup node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d #v3.8.1
with:
node-version: 18
cache: "pnpm"

# - name: Show preview url
# run: echo ${{ needs.vercel-ta.outputs.preview_url }}
- name: Show preview url
run: echo ${{ needs.vercel-ta.outputs.preview_url }}

# - name: Run Playwright tests
# run: pnpm --filter test-automation run e2e
# env:
# PLAYWRIGHT_BASE_URL: ${{ needs.vercel-ta.outputs.preview_url }}
- name: Run Playwright tests
run: pnpm --filter test-automation run e2e
env:
PLAYWRIGHT_BASE_URL: ${{ needs.vercel-ta.outputs.preview_url }}
3 changes: 3 additions & 0 deletions apps/test-automation/tests/contact.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { shouldSubmitContactForm } from "e2e-tests/tests/contact";

shouldSubmitContactForm();
9 changes: 9 additions & 0 deletions packages/e2e-tests/tests/contact.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { test } from "@playwright/test";

export const shouldSubmitContactForm = () => {
return test("should submit contact form", async ({ page }) => {
await page.goto("");
await page.getByText("Contact Us!").click();
await page.getByTestId("contact-button").click();
});
};
5 changes: 5 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"clean": {
"cache": false
},
"test": {
"cache": true,
"persistent": true,
"inputs": ["src/**/*.tsx", "src/**/*.ts"]
},
"e2e": {
"cache": false,
"persistent": true,
Expand Down