From fa942fc9f5aa1c2255efdb6304600be7f89cf20b Mon Sep 17 00:00:00 2001 From: Sai Hari Date: Tue, 8 Aug 2023 08:55:25 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20end-to-end=20test?= =?UTF-8?q?=20harness=20(#253)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 🎸 add end-to-end test harness * Address PR comments --- .github/workflows/publish.yml | 59 +++- .gitignore | 5 +- CONTRIBUTING.md | 46 +++ apps/webapp/app/services/email.server.ts | 6 + apps/webapp/package.json | 1 + examples/nextjs-test/.env.example | 3 + examples/nextjs-test/.eslintrc.json | 3 + examples/nextjs-test/.gitignore | 35 ++ examples/nextjs-test/README.md | 34 ++ examples/nextjs-test/jsconfig.json | 7 + examples/nextjs-test/next.config.js | 4 + examples/nextjs-test/package.json | 30 ++ examples/nextjs-test/public/next.svg | 1 + examples/nextjs-test/public/vercel.svg | 1 + .../nextjs-test/src/app/api/trigger/route.js | 9 + examples/nextjs-test/src/app/favicon.ico | Bin 0 -> 25931 bytes examples/nextjs-test/src/app/globals.css | 107 ++++++ examples/nextjs-test/src/app/layout.js | 17 + examples/nextjs-test/src/app/page.js | 95 ++++++ examples/nextjs-test/src/app/page.module.css | 229 +++++++++++++ examples/nextjs-test/src/jobs/examples.js | 20 ++ examples/nextjs-test/src/trigger.js | 9 + package.json | 4 + playwright.config.ts | 65 ++++ pnpm-lock.yaml | 309 +++++++++++------- tests/e2e/e2e.spec.ts | 41 +++ tests/global.setup.ts | 99 ++++++ tests/global.teardown.ts | 17 + tests/utils.ts | 19 ++ 29 files changed, 1158 insertions(+), 117 deletions(-) create mode 100644 examples/nextjs-test/.env.example create mode 100644 examples/nextjs-test/.eslintrc.json create mode 100644 examples/nextjs-test/.gitignore create mode 100644 examples/nextjs-test/README.md create mode 100644 examples/nextjs-test/jsconfig.json create mode 100644 examples/nextjs-test/next.config.js create mode 100644 examples/nextjs-test/package.json create mode 100644 examples/nextjs-test/public/next.svg create mode 100644 examples/nextjs-test/public/vercel.svg create mode 100644 examples/nextjs-test/src/app/api/trigger/route.js create mode 100644 examples/nextjs-test/src/app/favicon.ico create mode 100644 examples/nextjs-test/src/app/globals.css create mode 100644 examples/nextjs-test/src/app/layout.js create mode 100644 examples/nextjs-test/src/app/page.js create mode 100644 examples/nextjs-test/src/app/page.module.css create mode 100644 examples/nextjs-test/src/jobs/examples.js create mode 100644 examples/nextjs-test/src/trigger.js create mode 100644 playwright.config.ts create mode 100644 tests/e2e/e2e.spec.ts create mode 100644 tests/global.setup.ts create mode 100644 tests/global.teardown.ts create mode 100644 tests/utils.ts diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 35061b306..6c795bd9e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -64,8 +64,65 @@ jobs: - name: 🔎 Type check run: pnpm run typecheck --filter webapp + e2e: + name: e2e Tests + runs-on: buildjet-4vcpu-ubuntu-2204 + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: ⎔ Setup pnpm + uses: pnpm/action-setup@v2.2.4 + with: + version: 7.18 + + - name: ⎔ Setup node + uses: buildjet/setup-node@v3 + with: + node-version: 18 + cache: "pnpm" + + - name: 📥 Download deps + run: pnpm install --frozen-lockfile + + - name: Install Playwright Browsers + run: npx playwright install --with-deps + + - name: Run Playwright tests + run: | + # Setup environment variables + cp ./.env.example ./.env + cp ./examples/nextjs-test/.env.example ./examples/nextjs-test/.env.local + cp ./packages/database/.env.example ./packages/database/.env + + # Build packages + pnpm run build --filter @examples/nextjs-test^... + pnpm --filter @trigger.dev/database generate + + # Move trigger-cli bin to correct place + pnpm install --frozen-lockfile + + # Execute tests + pnpm run docker + pnpm run db:migrate + pnpm run db:seed + pnpm run test:e2e + + # Cleanup + pnpm run docker:stop + + - name: Upload Playwright report + uses: actions/upload-artifact@v3 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 + publish: - needs: [typecheck] + needs: [typecheck, e2e] runs-on: buildjet-4vcpu-ubuntu-2204 outputs: version: ${{ steps.get_version.outputs.version }} diff --git a/.gitignore b/.gitignore index 0e66d6aff..276a4f633 100644 --- a/.gitignore +++ b/.gitignore @@ -48,4 +48,7 @@ apps/**/public/build .sentryclirc .buildt -**/tmp/ \ No newline at end of file +**/tmp/ +/test-results/ +/playwright-report/ +/playwright/.cache/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 69bec7b2b..a12d6b80c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -169,6 +169,52 @@ pnpm exec trigger-cli dev 9. Please remember to delete the temporary project you created after you've tested the changes, and before you raise a PR. +## Running end-to-end webapp tests + +To run the end-to-end tests, follow the steps below: + +1. Set up environment variables (copy example envs into the correct place) + +```sh +cp ./.env.example ./.env +cp ./examples/nextjs-test/.env.example ./examples/nextjs-test/.env.local +cp ./packages/database/.env.example ./packages/database/.env +``` + +2. Set up dependencies + +```sh +# Build packages +pnpm run build --filter @examples/nextjs-test^... +pnpm --filter @trigger.dev/database generate + +# Move trigger-cli bin to correct place +pnpm install --frozen-lockfile +``` + +3. Set up the database + +```sh +pnpm run docker +pnpm run db:migrate +pnpm run db:seed +``` + +4. Run the end-to-end tests + +```sh +pnpm run test:e2e +``` + +### Cleanup + +The end-to-end tests use a `setup` and `teardown` script to seed the database with test data. If the test runner doesn't exit cleanly, then the database can be left in a state where the tests can't run because the `setup` script will try to create data that already exists. If this happens, you can manually delete the `users` and `organizations` from the database using prisma studio: + +```sh +# With the database running (i.e. pnpm run docker) +pnpm run db:studio +``` + ## Add sample jobs The [examples/jobs-starter](./examples/jobs-starter/) project defines simple jobs you can get started with. diff --git a/apps/webapp/app/services/email.server.ts b/apps/webapp/app/services/email.server.ts index bcfa4bb03..bc8014fcc 100644 --- a/apps/webapp/app/services/email.server.ts +++ b/apps/webapp/app/services/email.server.ts @@ -1,6 +1,7 @@ import type { DeliverEmail } from "emails"; import { EmailClient } from "emails"; import type { SendEmailOptions } from "remix-auth-email-link"; +import { redirect } from "remix-typedjson"; import { env } from "~/env.server"; import type { User } from "~/models/user.server"; import type { AuthUser } from "./authUser"; @@ -14,6 +15,11 @@ const client = new EmailClient({ }); export async function sendMagicLinkEmail(options: SendEmailOptions): Promise { + // Auto redirect when in development mode + if (env.NODE_ENV === "development") { + throw redirect(options.magicLink); + } + return client.send({ email: "magic_link", to: options.emailAddress, diff --git a/apps/webapp/package.json b/apps/webapp/package.json index 38cce42c2..c7d41092f 100644 --- a/apps/webapp/package.json +++ b/apps/webapp/package.json @@ -14,6 +14,7 @@ "start": "cross-env NODE_ENV=production node --max-old-space-size=8192 ./build/server.js", "typecheck": "tsc --noEmit", "db:seed": "node prisma/seed.js", + "db:seed:local": "ts-node prisma/seed.ts", "generate:sourcemaps": "remix build --sourcemap", "clean:sourcemaps": "run-s clean:sourcemaps:*", "clean:sourcemaps:public": "rimraf ./build/**/*.map", diff --git a/examples/nextjs-test/.env.example b/examples/nextjs-test/.env.example new file mode 100644 index 000000000..4fdb8311f --- /dev/null +++ b/examples/nextjs-test/.env.example @@ -0,0 +1,3 @@ + +TRIGGER_API_KEY=tr_dev_test-api-key +TRIGGER_API_URL=http://localhost:3030 diff --git a/examples/nextjs-test/.eslintrc.json b/examples/nextjs-test/.eslintrc.json new file mode 100644 index 000000000..bffb357a7 --- /dev/null +++ b/examples/nextjs-test/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "next/core-web-vitals" +} diff --git a/examples/nextjs-test/.gitignore b/examples/nextjs-test/.gitignore new file mode 100644 index 000000000..8f322f0d8 --- /dev/null +++ b/examples/nextjs-test/.gitignore @@ -0,0 +1,35 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/examples/nextjs-test/README.md b/examples/nextjs-test/README.md new file mode 100644 index 000000000..e5f733efc --- /dev/null +++ b/examples/nextjs-test/README.md @@ -0,0 +1,34 @@ +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +# or +pnpm dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file. + +This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/examples/nextjs-test/jsconfig.json b/examples/nextjs-test/jsconfig.json new file mode 100644 index 000000000..b8d6842d7 --- /dev/null +++ b/examples/nextjs-test/jsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "paths": { + "@/*": ["./src/*"] + } + } +} diff --git a/examples/nextjs-test/next.config.js b/examples/nextjs-test/next.config.js new file mode 100644 index 000000000..767719fc4 --- /dev/null +++ b/examples/nextjs-test/next.config.js @@ -0,0 +1,4 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = {} + +module.exports = nextConfig diff --git a/examples/nextjs-test/package.json b/examples/nextjs-test/package.json new file mode 100644 index 000000000..d26c67ccc --- /dev/null +++ b/examples/nextjs-test/package.json @@ -0,0 +1,30 @@ +{ + "name": "@examples/nextjs-test", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "concurrently --kill-others \"pnpm dev:next\" \"wait-on http://localhost:3000 && pnpm dev:trigger\"", + "dev:next": "next dev", + "dev:trigger": "trigger-cli dev", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "next": "13.4.12", + "react": "18.2.0", + "react-dom": "18.2.0", + "@trigger.dev/sdk": "^2.0.0-next.22", + "@trigger.dev/nextjs": "^1.0.0-next.8" + }, + "trigger.dev": { + "endpointId": "nextjs-test" + }, + "devDependencies": { + "@trigger.dev/cli": "workspace:*", + "concurrently": "^8.2.0", + "eslint": "8.42.0", + "eslint-config-next": "13.4.6", + "wait-on": "^7.0.1" + } +} diff --git a/examples/nextjs-test/public/next.svg b/examples/nextjs-test/public/next.svg new file mode 100644 index 000000000..5174b28c5 --- /dev/null +++ b/examples/nextjs-test/public/next.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/nextjs-test/public/vercel.svg b/examples/nextjs-test/public/vercel.svg new file mode 100644 index 000000000..d2f842227 --- /dev/null +++ b/examples/nextjs-test/public/vercel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/nextjs-test/src/app/api/trigger/route.js b/examples/nextjs-test/src/app/api/trigger/route.js new file mode 100644 index 000000000..d1e114675 --- /dev/null +++ b/examples/nextjs-test/src/app/api/trigger/route.js @@ -0,0 +1,9 @@ + +import { createAppRoute } from "@trigger.dev/nextjs"; +import { client } from "@/trigger"; + +// Replace this with your own jobs +import "@/jobs/examples"; + +//this route is used to send and receive data with Trigger.dev +export const { POST, dynamic } = createAppRoute(client); diff --git a/examples/nextjs-test/src/app/favicon.ico b/examples/nextjs-test/src/app/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..718d6fea4835ec2d246af9800eddb7ffb276240c GIT binary patch literal 25931 zcmeHv30#a{`}aL_*G&7qml|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0^5psc- zjS16yb>dFn>KPOF;imD}e!enuIniFzv}n$m2#gCCv4jM#ArwlzZ$7@9&XkFxZ4n!V zj3dyiwW4Ki2QG{@i>yuZXQizw_OkZI^-3otXC{!(lUpJF33gI60ak;Uqitp74|B6I zgg{b=Iz}WkhCGj1M=hu4#Aw173YxIVbISaoc z-nLZC*6Tgivd5V`K%GxhBsp@SUU60-rfc$=wb>zdJzXS&-5(NRRodFk;Kxk!S(O(a0e7oY=E( zAyS;Ow?6Q&XA+cnkCb{28_1N8H#?J!*$MmIwLq^*T_9-z^&UE@A(z9oGYtFy6EZef LrJugUA?W`A8`#=m literal 0 HcmV?d00001 diff --git a/examples/nextjs-test/src/app/globals.css b/examples/nextjs-test/src/app/globals.css new file mode 100644 index 000000000..d4f491e15 --- /dev/null +++ b/examples/nextjs-test/src/app/globals.css @@ -0,0 +1,107 @@ +:root { + --max-width: 1100px; + --border-radius: 12px; + --font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', + 'Roboto Mono', 'Oxygen Mono', 'Ubuntu Monospace', 'Source Code Pro', + 'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace; + + --foreground-rgb: 0, 0, 0; + --background-start-rgb: 214, 219, 220; + --background-end-rgb: 255, 255, 255; + + --primary-glow: conic-gradient( + from 180deg at 50% 50%, + #16abff33 0deg, + #0885ff33 55deg, + #54d6ff33 120deg, + #0071ff33 160deg, + transparent 360deg + ); + --secondary-glow: radial-gradient( + rgba(255, 255, 255, 1), + rgba(255, 255, 255, 0) + ); + + --tile-start-rgb: 239, 245, 249; + --tile-end-rgb: 228, 232, 233; + --tile-border: conic-gradient( + #00000080, + #00000040, + #00000030, + #00000020, + #00000010, + #00000010, + #00000080 + ); + + --callout-rgb: 238, 240, 241; + --callout-border-rgb: 172, 175, 176; + --card-rgb: 180, 185, 188; + --card-border-rgb: 131, 134, 135; +} + +@media (prefers-color-scheme: dark) { + :root { + --foreground-rgb: 255, 255, 255; + --background-start-rgb: 0, 0, 0; + --background-end-rgb: 0, 0, 0; + + --primary-glow: radial-gradient(rgba(1, 65, 255, 0.4), rgba(1, 65, 255, 0)); + --secondary-glow: linear-gradient( + to bottom right, + rgba(1, 65, 255, 0), + rgba(1, 65, 255, 0), + rgba(1, 65, 255, 0.3) + ); + + --tile-start-rgb: 2, 13, 46; + --tile-end-rgb: 2, 5, 19; + --tile-border: conic-gradient( + #ffffff80, + #ffffff40, + #ffffff30, + #ffffff20, + #ffffff10, + #ffffff10, + #ffffff80 + ); + + --callout-rgb: 20, 20, 20; + --callout-border-rgb: 108, 108, 108; + --card-rgb: 100, 100, 100; + --card-border-rgb: 200, 200, 200; + } +} + +* { + box-sizing: border-box; + padding: 0; + margin: 0; +} + +html, +body { + max-width: 100vw; + overflow-x: hidden; +} + +body { + color: rgb(var(--foreground-rgb)); + background: linear-gradient( + to bottom, + transparent, + rgb(var(--background-end-rgb)) + ) + rgb(var(--background-start-rgb)); +} + +a { + color: inherit; + text-decoration: none; +} + +@media (prefers-color-scheme: dark) { + html { + color-scheme: dark; + } +} diff --git a/examples/nextjs-test/src/app/layout.js b/examples/nextjs-test/src/app/layout.js new file mode 100644 index 000000000..c93f80617 --- /dev/null +++ b/examples/nextjs-test/src/app/layout.js @@ -0,0 +1,17 @@ +import './globals.css' +import { Inter } from 'next/font/google' + +const inter = Inter({ subsets: ['latin'] }) + +export const metadata = { + title: 'Create Next App', + description: 'Generated by create next app', +} + +export default function RootLayout({ children }) { + return ( + + {children} + + ) +} diff --git a/examples/nextjs-test/src/app/page.js b/examples/nextjs-test/src/app/page.js new file mode 100644 index 000000000..55d8aa355 --- /dev/null +++ b/examples/nextjs-test/src/app/page.js @@ -0,0 +1,95 @@ +import Image from 'next/image' +import styles from './page.module.css' + +export default function Home() { + return ( +
+
+

+ Get started by editing  + src/app/page.js +

+ +
+ +
+ Next.js Logo +
+ + +
+ ) +} diff --git a/examples/nextjs-test/src/app/page.module.css b/examples/nextjs-test/src/app/page.module.css new file mode 100644 index 000000000..9411a5e6f --- /dev/null +++ b/examples/nextjs-test/src/app/page.module.css @@ -0,0 +1,229 @@ +.main { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + padding: 6rem; + min-height: 100vh; +} + +.description { + display: inherit; + justify-content: inherit; + align-items: inherit; + font-size: 0.85rem; + max-width: var(--max-width); + width: 100%; + z-index: 2; + font-family: var(--font-mono); +} + +.description a { + display: flex; + justify-content: center; + align-items: center; + gap: 0.5rem; +} + +.description p { + position: relative; + margin: 0; + padding: 1rem; + background-color: rgba(var(--callout-rgb), 0.5); + border: 1px solid rgba(var(--callout-border-rgb), 0.3); + border-radius: var(--border-radius); +} + +.code { + font-weight: 700; + font-family: var(--font-mono); +} + +.grid { + display: grid; + grid-template-columns: repeat(4, minmax(25%, auto)); + width: var(--max-width); + max-width: 100%; +} + +.card { + padding: 1rem 1.2rem; + border-radius: var(--border-radius); + background: rgba(var(--card-rgb), 0); + border: 1px solid rgba(var(--card-border-rgb), 0); + transition: background 200ms, border 200ms; +} + +.card span { + display: inline-block; + transition: transform 200ms; +} + +.card h2 { + font-weight: 600; + margin-bottom: 0.7rem; +} + +.card p { + margin: 0; + opacity: 0.6; + font-size: 0.9rem; + line-height: 1.5; + max-width: 30ch; +} + +.center { + display: flex; + justify-content: center; + align-items: center; + position: relative; + padding: 4rem 0; +} + +.center::before { + background: var(--secondary-glow); + border-radius: 50%; + width: 480px; + height: 360px; + margin-left: -400px; +} + +.center::after { + background: var(--primary-glow); + width: 240px; + height: 180px; + z-index: -1; +} + +.center::before, +.center::after { + content: ''; + left: 50%; + position: absolute; + filter: blur(45px); + transform: translateZ(0); +} + +.logo { + position: relative; +} +/* Enable hover only on non-touch devices */ +@media (hover: hover) and (pointer: fine) { + .card:hover { + background: rgba(var(--card-rgb), 0.1); + border: 1px solid rgba(var(--card-border-rgb), 0.15); + } + + .card:hover span { + transform: translateX(4px); + } +} + +@media (prefers-reduced-motion) { + .card:hover span { + transform: none; + } +} + +/* Mobile */ +@media (max-width: 700px) { + .content { + padding: 4rem; + } + + .grid { + grid-template-columns: 1fr; + margin-bottom: 120px; + max-width: 320px; + text-align: center; + } + + .card { + padding: 1rem 2.5rem; + } + + .card h2 { + margin-bottom: 0.5rem; + } + + .center { + padding: 8rem 0 6rem; + } + + .center::before { + transform: none; + height: 300px; + } + + .description { + font-size: 0.8rem; + } + + .description a { + padding: 1rem; + } + + .description p, + .description div { + display: flex; + justify-content: center; + position: fixed; + width: 100%; + } + + .description p { + align-items: center; + inset: 0 0 auto; + padding: 2rem 1rem 1.4rem; + border-radius: 0; + border: none; + border-bottom: 1px solid rgba(var(--callout-border-rgb), 0.25); + background: linear-gradient( + to bottom, + rgba(var(--background-start-rgb), 1), + rgba(var(--callout-rgb), 0.5) + ); + background-clip: padding-box; + backdrop-filter: blur(24px); + } + + .description div { + align-items: flex-end; + pointer-events: none; + inset: auto 0 0; + padding: 2rem; + height: 200px; + background: linear-gradient( + to bottom, + transparent 0%, + rgb(var(--background-end-rgb)) 40% + ); + z-index: 1; + } +} + +/* Tablet and Smaller Desktop */ +@media (min-width: 701px) and (max-width: 1120px) { + .grid { + grid-template-columns: repeat(2, 50%); + } +} + +@media (prefers-color-scheme: dark) { + .vercelLogo { + filter: invert(1); + } + + .logo { + filter: invert(1) drop-shadow(0 0 0.3rem #ffffff70); + } +} + +@keyframes rotate { + from { + transform: rotate(360deg); + } + to { + transform: rotate(0deg); + } +} diff --git a/examples/nextjs-test/src/jobs/examples.js b/examples/nextjs-test/src/jobs/examples.js new file mode 100644 index 000000000..a4bbf95cc --- /dev/null +++ b/examples/nextjs-test/src/jobs/examples.js @@ -0,0 +1,20 @@ + +import { eventTrigger } from "@trigger.dev/sdk"; +import { client } from "@/trigger"; + +// your first job +client.defineJob({ + id: "test-job", + name: "Test Job One", + version: "0.0.1", + trigger: eventTrigger({ + name: "test.event", + }), + run: async (payload, io, ctx) => { + await io.logger.info("Hello world!", { payload }); + + return { + message: "Hello world!", + }; + }, +}); diff --git a/examples/nextjs-test/src/trigger.js b/examples/nextjs-test/src/trigger.js new file mode 100644 index 000000000..658479da1 --- /dev/null +++ b/examples/nextjs-test/src/trigger.js @@ -0,0 +1,9 @@ + +import { TriggerClient } from "@trigger.dev/sdk"; + +export const client = new TriggerClient({ + id: "nextjs-test", + apiKey: process.env.TRIGGER_API_KEY, + apiUrl: process.env.TRIGGER_API_URL, +}); + \ No newline at end of file diff --git a/package.json b/package.json index b8c26b818..ae9ca86c0 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "clean": "turbo run clean", "clean:node_modules": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +", "typecheck": "turbo run typecheck", + "test:e2e": "playwright test", "test:e2e:dev": "turbo run test:e2e:dev", "test:e2e:ci": "turbo run test:e2e:ci", "setup": "turbo run generate db:migrate:force db:seed", @@ -43,9 +44,12 @@ }, "devDependencies": { "@manypkg/cli": "^0.19.2", + "@playwright/test": "^1.36.2", "@tailwindcss/forms": "^0.5.3", "@tailwindcss/typography": "^0.5.8", "@trigger.dev/cli": "workspace:*", + "@trigger.dev/database": "workspace:*", + "@types/node": "18.17.1", "autoprefixer": "^10.4.12", "eslint-config-custom": "workspace:*", "postcss": "^8.4.17", diff --git a/playwright.config.ts b/playwright.config.ts new file mode 100644 index 000000000..ba5d54f6b --- /dev/null +++ b/playwright.config.ts @@ -0,0 +1,65 @@ +import { defineConfig, devices } from "@playwright/test"; + +/** + * Read environment variables from file. + * https://github.com/motdotla/dotenv + */ +// require('dotenv').config(); + +/** + * See https://playwright.dev/docs/test-configuration. + */ +export default defineConfig({ + testDir: "./tests/e2e", + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? 1 : undefined, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: "html", + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + baseURL: "http://localhost:3030", + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: "on-first-retry", + }, + + globalSetup: require.resolve("./tests/global.setup.ts"), + globalTeardown: require.resolve("./tests/global.teardown.ts"), + + /* Configure projects for major browsers */ + projects: [ + { + name: "chromium", + use: { ...devices["Desktop Chrome"] }, + }, + + { + name: "firefox", + use: { ...devices["Desktop Firefox"] }, + }, + + { + name: "webkit", + use: { ...devices["Desktop Safari"] }, + }, + ], + + /* Run your local dev server before starting the tests */ + webServer: [ + { + command: "pnpm run --filter webapp dev", + url: "http://localhost:3030", + reuseExistingServer: !process.env.CI, + }, + { + command: "pnpm run --filter @examples/nextjs-test dev", + url: "http://localhost:3000", + reuseExistingServer: !process.env.CI, + }, + ], +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 17a4487db..04ee106f0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,9 +6,12 @@ importers: specifiers: '@changesets/cli': ^2.26.0 '@manypkg/cli': ^0.19.2 + '@playwright/test': ^1.36.2 '@tailwindcss/forms': ^0.5.3 '@tailwindcss/typography': ^0.5.8 '@trigger.dev/cli': workspace:* + '@trigger.dev/database': workspace:* + '@types/node': 18.17.1 autoprefixer: ^10.4.12 eslint-config-custom: workspace:* node-fetch: 2.6.x @@ -25,9 +28,12 @@ importers: node-fetch: 2.6.7 devDependencies: '@manypkg/cli': 0.19.2 + '@playwright/test': 1.36.2 '@tailwindcss/forms': 0.5.3_tailwindcss@3.1.8 '@tailwindcss/typography': 0.5.9_tailwindcss@3.1.8 '@trigger.dev/cli': link:packages/cli + '@trigger.dev/database': link:packages/database + '@types/node': 18.17.1 autoprefixer: 10.4.13_postcss@8.4.21 eslint-config-custom: link:config-packages/eslint-config-custom postcss: 8.4.21 @@ -35,7 +41,7 @@ importers: tailwindcss: 3.1.8_postcss@8.4.21 tsx: 3.12.2 turbo: 1.10.3 - vite: 4.1.4 + vite: 4.1.4_@types+node@18.17.1 vite-tsconfig-paths: 4.0.5 vitest: 0.28.5 @@ -513,6 +519,31 @@ importers: msw: 0.47.4_typescript@5.0.4 ts-loader: 9.4.2_typescript@5.0.4 + examples/nextjs-test: + specifiers: + '@trigger.dev/cli': workspace:* + '@trigger.dev/nextjs': ^1.0.0-next.8 + '@trigger.dev/sdk': ^2.0.0-next.22 + concurrently: ^8.2.0 + eslint: 8.42.0 + eslint-config-next: 13.4.6 + next: 13.4.12 + react: 18.2.0 + react-dom: 18.2.0 + wait-on: ^7.0.1 + dependencies: + '@trigger.dev/nextjs': 1.0.0-next.8_owev6m6bp2mbsheelrdjuexmby + '@trigger.dev/sdk': 2.0.0-next.22 + next: 13.4.12_biqbaboplfbrettd7655fr4n2y + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + devDependencies: + '@trigger.dev/cli': link:../../packages/cli + concurrently: 8.2.0 + eslint: 8.42.0 + eslint-config-next: 13.4.6_eslint@8.42.0 + wait-on: 7.0.1 + examples/package-tester: specifiers: '@trigger.dev/cli': workspace:* @@ -4920,7 +4951,7 @@ packages: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: eslint: 8.31.0 - eslint-visitor-keys: 3.4.1 + eslint-visitor-keys: 3.4.2 dev: true /@eslint-community/eslint-utils/4.4.0_eslint@8.42.0: @@ -4930,7 +4961,7 @@ packages: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: eslint: 8.42.0 - eslint-visitor-keys: 3.4.1 + eslint-visitor-keys: 3.4.2 dev: true /@eslint-community/eslint-utils/4.4.0_eslint@8.44.0: @@ -4940,7 +4971,7 @@ packages: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: eslint: 8.44.0 - eslint-visitor-keys: 3.4.1 + eslint-visitor-keys: 3.4.2 dev: true /@eslint-community/eslint-utils/4.4.0_eslint@8.45.0: @@ -4950,7 +4981,7 @@ packages: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: eslint: 8.45.0 - eslint-visitor-keys: 3.4.1 + eslint-visitor-keys: 3.4.2 dev: false /@eslint-community/regexpp/4.5.1: @@ -4974,23 +5005,6 @@ packages: - supports-color dev: true - /@eslint/eslintrc/2.0.3: - resolution: {integrity: sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - ajv: 6.12.6 - debug: 4.3.4 - espree: 9.6.0 - globals: 13.19.0 - ignore: 5.2.4 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - dev: true - /@eslint/eslintrc/2.1.0: resolution: {integrity: sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -5145,7 +5159,6 @@ packages: /@hapi/hoek/9.3.0: resolution: {integrity: sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==} - dev: false /@hapi/iron/6.0.0: resolution: {integrity: sha512-zvGvWDufiTGpTJPG1Y/McN8UqWBu0k/xs/7l++HVU535NLHXsHhy54cfEMdW7EjwKfbBfM9Xy25FmTiobb7Hvw==} @@ -5174,7 +5187,6 @@ packages: resolution: {integrity: sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==} dependencies: '@hapi/hoek': 9.3.0 - dev: false /@hapi/validate/1.1.3: resolution: {integrity: sha512-/XMR0N0wjw0Twzq2pQOzPBZlDzkekGcoCtzO314BpIEsbXdYGthQUbxgkGDf4nhk1+IPDAsXqWjMohRQYO06UA==} @@ -7176,6 +7188,17 @@ packages: tiny-glob: 0.2.9 tslib: 2.5.0 + /@playwright/test/1.36.2: + resolution: {integrity: sha512-2rVZeyPRjxfPH6J0oGJqE8YxiM1IBRyM8hyrXYK7eSiAqmbNhxwcLa7dZ7fy9Kj26V7FYia5fh9XJRq4Dqme+g==} + engines: {node: '>=16'} + hasBin: true + dependencies: + '@types/node': 18.17.1 + playwright-core: 1.36.2 + optionalDependencies: + fsevents: 2.3.2 + dev: true + /@pmmmwh/react-refresh-webpack-plugin/0.5.10_5p63spmmiprwsput7pcvbh7bwu: resolution: {integrity: sha512-j0Ya0hCFZPd4x40qLzbhGsh9TMtdb+CJQiso+WxLOPNasohq9cc5SNUcwsZaRH6++Xh91Xkm/xHCkuIiIu0LUA==} engines: {node: '>= 10.13'} @@ -8561,15 +8584,12 @@ packages: resolution: {integrity: sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==} dependencies: '@hapi/hoek': 9.3.0 - dev: false /@sideway/formula/3.0.1: resolution: {integrity: sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==} - dev: false /@sideway/pinpoint/2.0.0: resolution: {integrity: sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==} - dev: false /@sinclair/typebox/0.25.24: resolution: {integrity: sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==} @@ -9146,7 +9166,7 @@ packages: process: 0.11.10 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 - semver: 7.5.0 + semver: 7.5.4 style-loader: 3.3.2_webpack@5.80.0 terser-webpack-plugin: 5.3.7_5jgfnkl7fjuhakmzbjzotue6o4 ts-dedent: 2.2.0 @@ -9240,7 +9260,7 @@ packages: prompts: 2.4.2 puppeteer-core: 2.1.1 read-pkg-up: 7.0.1 - semver: 7.5.0 + semver: 7.5.4 shelljs: 0.8.5 simple-update-notifier: 1.1.0 strip-json-comments: 3.1.1 @@ -9581,7 +9601,7 @@ packages: memoizerific: 1.11.3 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 - semver: 7.5.0 + semver: 7.5.4 store2: 2.14.2 telejson: 7.1.0 ts-dedent: 2.2.0 @@ -9676,7 +9696,7 @@ packages: react: 18.2.0 react-dom: 18.2.0_react@18.2.0 react-refresh: 0.11.0 - semver: 7.5.0 + semver: 7.5.4 typescript: 4.9.4 webpack: 5.80.0_uhpfu7q6noim4yjdo6qt2aajgu transitivePeerDependencies: @@ -10272,6 +10292,46 @@ packages: react-dom: 18.2.0_react@18.2.0 dev: false + /@trigger.dev/nextjs/1.0.0-next.8_owev6m6bp2mbsheelrdjuexmby: + resolution: {integrity: sha512-azZFVffyfAXAQFWHCU0yEP3SSRQFymgycU4cKtnsWoKRgPPIw1Y6fpWc0D9v+xJ5hUjFdoEm6SBAoIS1vpBlxA==} + engines: {node: '>=16.8.0'} + peerDependencies: + '@trigger.dev/sdk': ^2.0.0-next.16 + next: '>=12.0.0 <14.0.0' + dependencies: + '@trigger.dev/sdk': 2.0.0-next.22 + debug: 4.3.4 + next: 13.4.12_biqbaboplfbrettd7655fr4n2y + transitivePeerDependencies: + - supports-color + dev: false + + /@trigger.dev/sdk/2.0.0-next.22: + resolution: {integrity: sha512-cEbeu58im670XJPcHCpsGjzeJ/Qix9c8/xD9bnKH+8BwxoWo5QsYzVai4zDErnCa33cOuvzSsQG7jxCpp8UYEQ==} + engines: {node: '>=16.8.0'} + dependencies: + chalk: 5.2.0 + cronstrue: 2.21.0 + debug: 4.3.4 + evt: 2.4.13 + get-caller-file: 2.0.5 + git-remote-origin-url: 4.0.0 + git-repo-info: 2.1.1 + node-fetch: 2.6.12 + slug: 6.1.0 + terminal-link: 3.0.0 + ulid: 2.3.0 + uuid: 9.0.0 + ws: 8.12.0 + zod: 3.21.4 + zod-error: 1.5.0 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: false + /@tsconfig/node10/1.0.9: resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} @@ -10296,7 +10356,7 @@ packages: /@types/accepts/1.3.5: resolution: {integrity: sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==} dependencies: - '@types/node': 20.4.5 + '@types/node': 18.17.1 dev: false /@types/acorn/4.0.6: @@ -10354,7 +10414,7 @@ packages: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 20.4.5 + '@types/node': 18.17.1 /@types/btoa-lite/1.0.0: resolution: {integrity: sha512-wJsiX1tosQ+J5+bY5LrSahHxr2wT+uME5UDwdN1kg4frt40euqA+wzECkmq4t5QbveHiJepfdThgQrPw6KiSlg==} @@ -10408,7 +10468,7 @@ packages: '@types/connect': 3.4.35 '@types/express': 4.17.15 '@types/keygrip': 1.0.2 - '@types/node': 20.4.5 + '@types/node': 18.17.1 dev: false /@types/debug/4.1.7: @@ -10473,7 +10533,7 @@ packages: /@types/express-serve-static-core/4.17.32: resolution: {integrity: sha512-aI5h/VOkxOF2Z1saPy0Zsxs5avets/iaiAJYznQFm5By/pamU31xWKL//epiF4OfUA2qTOc9PV6tCUjhO8wlZA==} dependencies: - '@types/node': 20.4.5 + '@types/node': 18.17.1 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 @@ -10509,7 +10569,7 @@ packages: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 5.1.2 - '@types/node': 20.4.5 + '@types/node': 18.17.1 /@types/glob/8.1.0: resolution: {integrity: sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==} @@ -10556,7 +10616,7 @@ packages: /@types/hapi__shot/4.1.2: resolution: {integrity: sha512-8wWgLVP1TeGqgzZtCdt+F+k15DWQvLG1Yv6ZzPfb3D5WIo5/S+GGKtJBVo2uNEcqabP5Ifc71QnJTDnTmw1axA==} dependencies: - '@types/node': 20.4.5 + '@types/node': 18.17.1 dev: false /@types/hast/2.3.4: @@ -10594,7 +10654,7 @@ packages: /@types/ioredis/4.28.10: resolution: {integrity: sha512-69LyhUgrXdgcNDv7ogs1qXZomnfOEnSmrmMFqKgt1XMJxmoOSG/u3wYy13yACIfKuMJ8IhKgHafDO3sx19zVQQ==} dependencies: - '@types/node': 20.4.5 + '@types/node': 18.17.1 dev: false /@types/is-ci/3.0.0: @@ -10647,7 +10707,7 @@ packages: /@types/jsonwebtoken/9.0.1: resolution: {integrity: sha512-c5ltxazpWabia/4UzhIoaDcIza4KViOQhdbjRlfcIGVnsE3c3brkz9Z+F/EeJIECOQP7W7US2hNE930cWWkPiw==} dependencies: - '@types/node': 20.4.5 + '@types/node': 18.17.1 dev: false /@types/keygrip/1.0.2: @@ -10657,7 +10717,7 @@ packages: /@types/keyv/3.1.4: resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: - '@types/node': 20.4.5 + '@types/node': 18.17.1 /@types/koa-compose/3.2.5: resolution: {integrity: sha512-B8nG/OoE1ORZqCkBVsup/AKcvjdgoHnfi4pZMn5UwAPCbhk/96xyv284eBYW8JlQbQ7zDmnpFr68I/40mFoIBQ==} @@ -10783,6 +10843,9 @@ packages: /@types/node/18.15.13: resolution: {integrity: sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==} + /@types/node/18.17.1: + resolution: {integrity: sha512-xlR1jahfizdplZYRU59JlUx9uzF1ARa8jbhM11ccpCJya8kvos5jwdm2ZAgxSCwOl0fq21svP18EVwPBXMQudw==} + /@types/node/20.3.2: resolution: {integrity: sha512-vOBLVQeCQfIcF/2Y7eKFTqrMnizK5lRNQ7ykML/5RuwVXVWxYkgwS7xbt4B6fKCUPgbSL5FSsjHQpaGQP/dQmw==} dev: true @@ -10861,7 +10924,7 @@ packages: /@types/responselike/1.0.0: resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==} dependencies: - '@types/node': 20.4.5 + '@types/node': 18.17.1 /@types/retry/0.12.0: resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==} @@ -10881,7 +10944,7 @@ packages: resolution: {integrity: sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==} dependencies: '@types/mime': 3.0.1 - '@types/node': 20.4.5 + '@types/node': 18.17.1 /@types/set-cookie-parser/2.4.2: resolution: {integrity: sha512-fBZgytwhYAUkj/jC/FAV4RQ5EerRup1YQsXQCh8rZfiHkc4UahC192oH0smGwsXol3cL3A5oETuAHeQHmhXM4w==} @@ -11019,6 +11082,25 @@ packages: - supports-color dev: true + /@typescript-eslint/parser/5.59.6_eslint@8.42.0: + resolution: {integrity: sha512-7pCa6al03Pv1yf/dUg/s1pXz/yGMUBAw5EeWqNTFiSueKvRNonze3hma3lhdsOrQcaOXhbk5gKu2Fludiho9VA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 5.59.6 + '@typescript-eslint/types': 5.59.6 + '@typescript-eslint/typescript-estree': 5.59.6 + debug: 4.3.4 + eslint: 8.42.0 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/parser/5.59.6_eslint@8.44.0: resolution: {integrity: sha512-7pCa6al03Pv1yf/dUg/s1pXz/yGMUBAw5EeWqNTFiSueKvRNonze3hma3lhdsOrQcaOXhbk5gKu2Fludiho9VA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -11123,7 +11205,7 @@ packages: debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.0 + semver: 7.5.4 tsutils: 3.21.0 transitivePeerDependencies: - supports-color @@ -11143,7 +11225,7 @@ packages: debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.0 + semver: 7.5.4 tsutils: 3.21.0_typescript@4.9.4 typescript: 4.9.4 transitivePeerDependencies: @@ -11164,7 +11246,7 @@ packages: debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.0 + semver: 7.5.4 tsutils: 3.21.0_typescript@5.0.4 typescript: 5.0.4 transitivePeerDependencies: @@ -11185,7 +11267,7 @@ packages: debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.0 + semver: 7.5.4 tsutils: 3.21.0_typescript@5.1.6 typescript: 5.1.6 transitivePeerDependencies: @@ -11206,7 +11288,7 @@ packages: '@typescript-eslint/typescript-estree': 5.59.6_typescript@4.9.4 eslint: 8.31.0 eslint-scope: 5.1.1 - semver: 7.5.0 + semver: 7.5.4 transitivePeerDependencies: - supports-color - typescript @@ -12065,7 +12147,6 @@ packages: form-data: 4.0.0 transitivePeerDependencies: - debug - dev: false /axios/1.4.0: resolution: {integrity: sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==} @@ -14625,7 +14706,7 @@ packages: eslint-import-resolver-typescript: 3.5.5_bsgoee2ktd7nzirwexa3gasa7m eslint-plugin-import: 2.27.5_dclhgbuu3rymxzhsuuyv72p2ym eslint-plugin-jsx-a11y: 6.7.1_eslint@8.42.0 - eslint-plugin-react: 7.32.2_eslint@8.42.0 + eslint-plugin-react: 7.31.8_eslint@8.42.0 eslint-plugin-react-hooks: 4.6.0_eslint@8.42.0 typescript: 5.0.4 transitivePeerDependencies: @@ -14633,6 +14714,30 @@ packages: - supports-color dev: true + /eslint-config-next/13.4.6_eslint@8.42.0: + resolution: {integrity: sha512-nlv4FYish1RYYHILbQwM5/rD37cOvEqtMfDjtQCYbXdE2O3MggqHu2q6IDeLE2Z6u8ZJyNPgWOA6OimWcxj3qw==} + peerDependencies: + eslint: ^7.23.0 || ^8.0.0 + typescript: '>=3.3.1' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@next/eslint-plugin-next': 13.4.6 + '@rushstack/eslint-patch': 1.2.0 + '@typescript-eslint/parser': 5.59.6_eslint@8.42.0 + eslint: 8.42.0 + eslint-import-resolver-node: 0.3.7 + eslint-import-resolver-typescript: 3.5.5_bsgoee2ktd7nzirwexa3gasa7m + eslint-plugin-import: 2.27.5_dclhgbuu3rymxzhsuuyv72p2ym + eslint-plugin-jsx-a11y: 6.7.1_eslint@8.42.0 + eslint-plugin-react: 7.31.8_eslint@8.42.0 + eslint-plugin-react-hooks: 4.6.0_eslint@8.42.0 + transitivePeerDependencies: + - eslint-import-resolver-webpack + - supports-color + dev: true + /eslint-config-prettier/8.6.0_eslint@8.31.0: resolution: {integrity: sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==} hasBin: true @@ -15220,17 +15325,16 @@ packages: string.prototype.matchall: 4.0.8 dev: true - /eslint-plugin-react/7.32.2_eslint@8.31.0: - resolution: {integrity: sha512-t2fBMa+XzonrrNkyVirzKlvn5RXzzPwRHtMvLAtVZrt8oxgnTQaYbU6SXTOO1mwQgp1y5+toMSKInnzGr0Knqg==} + /eslint-plugin-react/7.31.8_eslint@8.42.0: + resolution: {integrity: sha512-5lBTZmgQmARLLSYiwI71tiGVTLUuqXantZM6vlSY39OaDSV0M7+32K5DnLkmFrwTe+Ksz0ffuLUC91RUviVZfw==} engines: {node: '>=4'} peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 dependencies: array-includes: 3.1.6 array.prototype.flatmap: 1.3.1 - array.prototype.tosorted: 1.1.1 doctrine: 2.1.0 - eslint: 8.31.0 + eslint: 8.42.0 estraverse: 5.3.0 jsx-ast-utils: 3.3.3 minimatch: 3.1.2 @@ -15244,7 +15348,7 @@ packages: string.prototype.matchall: 4.0.8 dev: true - /eslint-plugin-react/7.32.2_eslint@8.42.0: + /eslint-plugin-react/7.32.2_eslint@8.31.0: resolution: {integrity: sha512-t2fBMa+XzonrrNkyVirzKlvn5RXzzPwRHtMvLAtVZrt8oxgnTQaYbU6SXTOO1mwQgp1y5+toMSKInnzGr0Knqg==} engines: {node: '>=4'} peerDependencies: @@ -15254,7 +15358,7 @@ packages: array.prototype.flatmap: 1.3.1 array.prototype.tosorted: 1.1.1 doctrine: 2.1.0 - eslint: 8.42.0 + eslint: 8.31.0 estraverse: 5.3.0 jsx-ast-utils: 3.3.3 minimatch: 3.1.2 @@ -15456,7 +15560,7 @@ packages: dependencies: '@eslint-community/eslint-utils': 4.4.0_eslint@8.42.0 '@eslint-community/regexpp': 4.5.1 - '@eslint/eslintrc': 2.0.3 + '@eslint/eslintrc': 2.1.0 '@eslint/js': 8.42.0 '@humanwhocodes/config-array': 0.11.10 '@humanwhocodes/module-importer': 1.0.1 @@ -15468,8 +15572,8 @@ packages: doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.0 - eslint-visitor-keys: 3.4.1 - espree: 9.5.2 + eslint-visitor-keys: 3.4.2 + espree: 9.6.0 esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 @@ -15489,7 +15593,7 @@ packages: lodash.merge: 4.6.2 minimatch: 3.1.2 natural-compare: 1.4.0 - optionator: 0.9.1 + optionator: 0.9.3 strip-ansi: 6.0.1 strip-json-comments: 3.1.1 text-table: 0.2.0 @@ -15597,16 +15701,7 @@ packages: dependencies: acorn: 8.10.0 acorn-jsx: 5.3.2_acorn@8.10.0 - eslint-visitor-keys: 3.4.1 - dev: true - - /espree/9.5.2: - resolution: {integrity: sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - acorn: 8.10.0 - acorn-jsx: 5.3.2_acorn@8.10.0 - eslint-visitor-keys: 3.4.1 + eslint-visitor-keys: 3.4.2 dev: true /espree/9.6.0: @@ -15615,7 +15710,7 @@ packages: dependencies: acorn: 8.10.0 acorn-jsx: 5.3.2_acorn@8.10.0 - eslint-visitor-keys: 3.4.1 + eslint-visitor-keys: 3.4.2 /esprima/4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} @@ -16172,7 +16267,6 @@ packages: peerDependenciesMeta: debug: optional: true - dev: false /follow-redirects/1.15.2_debug@4.3.2: resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} @@ -16237,7 +16331,7 @@ packages: minimatch: 3.1.2 node-abort-controller: 3.1.1 schema-utils: 3.1.2 - semver: 7.5.0 + semver: 7.5.4 tapable: 2.2.1 typescript: 4.9.4 webpack: 5.80.0_uhpfu7q6noim4yjdo6qt2aajgu @@ -16268,7 +16362,6 @@ packages: asynckit: 0.4.0 combined-stream: 1.0.8 mime-types: 2.1.35 - dev: false /format/0.2.2: resolution: {integrity: sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==} @@ -17875,7 +17968,6 @@ packages: '@sideway/address': 4.1.4 '@sideway/formula': 3.0.1 '@sideway/pinpoint': 2.0.0 - dev: false /joycon/3.1.1: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} @@ -20534,6 +20626,12 @@ packages: pathe: 1.1.0 dev: true + /playwright-core/1.36.2: + resolution: {integrity: sha512-sQYZt31dwkqxOrP7xy2ggDfEzUxM1lodjhsQ3NMMv5uGTRDsLxU0e4xf4wwMkF2gplIxf17QMBCodSFgm6bFVQ==} + engines: {node: '>=16'} + hasBin: true + dev: true + /polished/4.2.2: resolution: {integrity: sha512-Sz2Lkdxz6F2Pgnpi9U5Ng/WdWAUZxmHrNPoVlm3aAemxoy2Qy7LGjQg4uf8qKelDAUW94F4np3iH2YPf2qefcQ==} engines: {node: '>=10'} @@ -21134,7 +21232,7 @@ packages: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 20.4.5 + '@types/node': 18.17.1 long: 5.2.3 dev: false @@ -24623,7 +24721,7 @@ packages: - terser dev: true - /vite-node/0.28.5_@types+node@20.4.5: + /vite-node/0.28.5_@types+node@18.17.1: resolution: {integrity: sha512-LmXb9saMGlrMZbXTvOveJKwMTBTNUH66c8rJnQ0ZPNX+myPEol64+szRzXtV5ORb0Hb/91yq+/D3oERoyAt6LA==} engines: {node: '>=v14.16.0'} hasBin: true @@ -24635,7 +24733,7 @@ packages: picocolors: 1.0.0 source-map: 0.6.1 source-map-support: 0.5.21 - vite: 4.1.4_@types+node@20.4.5 + vite: 4.1.4_@types+node@18.17.1 transitivePeerDependencies: - '@types/node' - less @@ -24657,39 +24755,6 @@ packages: - typescript dev: true - /vite/4.1.4: - resolution: {integrity: sha512-3knk/HsbSTKEin43zHu7jTwYWv81f8kgAL99G5NWBcA1LKvtvcVAC4JjBH1arBunO9kQka+1oGbrMKOjk4ZrBg==} - engines: {node: ^14.18.0 || >=16.0.0} - hasBin: true - peerDependencies: - '@types/node': '>= 14' - less: '*' - sass: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 - peerDependenciesMeta: - '@types/node': - optional: true - less: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - dependencies: - esbuild: 0.16.17 - postcss: 8.4.27 - resolve: 1.22.1 - rollup: 3.10.0 - optionalDependencies: - fsevents: 2.3.2 - dev: true - /vite/4.1.4_@types+node@18.11.18: resolution: {integrity: sha512-3knk/HsbSTKEin43zHu7jTwYWv81f8kgAL99G5NWBcA1LKvtvcVAC4JjBH1arBunO9kQka+1oGbrMKOjk4ZrBg==} engines: {node: ^14.18.0 || >=16.0.0} @@ -24724,7 +24789,7 @@ packages: fsevents: 2.3.2 dev: true - /vite/4.1.4_@types+node@20.4.5: + /vite/4.1.4_@types+node@18.17.1: resolution: {integrity: sha512-3knk/HsbSTKEin43zHu7jTwYWv81f8kgAL99G5NWBcA1LKvtvcVAC4JjBH1arBunO9kQka+1oGbrMKOjk4ZrBg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -24749,7 +24814,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.4.5 + '@types/node': 18.17.1 esbuild: 0.16.17 postcss: 8.4.27 resolve: 1.22.1 @@ -24782,7 +24847,7 @@ packages: dependencies: '@types/chai': 4.3.4 '@types/chai-subset': 1.3.3 - '@types/node': 20.4.5 + '@types/node': 18.17.1 '@vitest/expect': 0.28.5 '@vitest/runner': 0.28.5 '@vitest/spy': 0.28.5 @@ -24801,8 +24866,8 @@ packages: tinybench: 2.3.1 tinypool: 0.3.1 tinyspy: 1.0.2 - vite: 4.1.4_@types+node@20.4.5 - vite-node: 0.28.5_@types+node@20.4.5 + vite: 4.1.4_@types+node@18.17.1 + vite-node: 0.28.5_@types+node@18.17.1 why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -24817,6 +24882,20 @@ packages: resolution: {integrity: sha512-f+fciywl1SJEniZHD6H+kUO8gOnwIr7f4ijKA6+ZvJFjeGi1r4PDLl53Ayud9O/rk64RqgoQine0feoeOU0kXg==} dev: false + /wait-on/7.0.1: + resolution: {integrity: sha512-9AnJE9qTjRQOlTZIldAaf/da2eW0eSRSgcqq85mXQja/DW3MriHxkpODDSUEg+Gri/rKEcXUZHe+cevvYItaog==} + engines: {node: '>=12.0.0'} + hasBin: true + dependencies: + axios: 0.27.2 + joi: 17.7.0 + lodash: 4.17.21 + minimist: 1.2.7 + rxjs: 7.8.1 + transitivePeerDependencies: + - debug + dev: true + /walker/1.0.8: resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} dependencies: diff --git a/tests/e2e/e2e.spec.ts b/tests/e2e/e2e.spec.ts new file mode 100644 index 000000000..2f5a7746b --- /dev/null +++ b/tests/e2e/e2e.spec.ts @@ -0,0 +1,41 @@ +import { test, expect } from "@playwright/test"; + +test("Create an account", async ({ page }) => { + await page.goto("/login"); + await page.getByRole("link", { name: "Continue with Email" }).click(); + + await page.getByPlaceholder("Email Address").type(`test_${Math.random()}@test.com`); + await page.getByRole("button", { name: "Send a magic link" }).click(); + + await expect(page.getByText("Welcome to Trigger.dev")).toBeVisible(); + await page.getByLabel("Full name").type("John Doe"); + await page.getByRole("button", { name: "Continue" }).click(); + + await page.getByLabel("Organization name").type("Test Org"); + await page.getByLabel("Project name").type("Test Project"); + await page.getByRole("button", { name: "Create" }).click(); + + await expect(page.locator("h1").filter({ hasText: /^Jobs$/ })).toBeVisible(); +}); + +test("Verify jobs from the test nextjs project", async ({ page }) => { + await page.goto("/"); + await page.getByRole("link", { name: "Continue with Email" }).click(); + + await page.getByPlaceholder("Email Address").type("test-user@test.com"); + await page.getByRole("button", { name: "Send a magic link" }).click(); + + await page.getByRole("link", { name: /Test Project/ }).click(); + await expect(page.locator("h1").filter({ hasText: /^Jobs$/ })).toBeVisible(); + + await page.getByRole("link", { name: "Environments & API Keys" }).click(); + await expect(page.locator("h1").filter({ hasText: "Environments & API Keys" })).toBeVisible(); + await expect( + page.locator("h3").filter({ hasText: "nextjs-test" }) + // Set the timeout high to allow the cli to register jobs + ).toBeVisible({ timeout: 15000 }); + + await page.getByRole("link", { name: "Jobs" }).click(); + await expect(page.locator("h1").filter({ hasText: /^Jobs$/ })).toBeVisible(); + await expect(page.getByRole("link", { name: /Test Job One/ })).toBeVisible(); +}); diff --git a/tests/global.setup.ts b/tests/global.setup.ts new file mode 100644 index 000000000..bc059cd7c --- /dev/null +++ b/tests/global.setup.ts @@ -0,0 +1,99 @@ +import { setDB } from "./utils"; + +const setup = async () => { + await setDB(async (prisma) => { + // Create test user + const user = await prisma.user.create({ + data: { + email: "test-user@test.com", + name: "Test User", + authenticationMethod: "MAGIC_LINK", + confirmedBasicDetails: true + }, + }); + + // Create test organization + const organization = await prisma.organization.create({ + data: { + title: "Test Organization", + slug: "test-org", + members: { + create: { + userId: user.id, + role: "ADMIN", + }, + }, + }, + include: { + members: true, + }, + }); + + // Create test project + const project = await prisma.project.create({ + data: { + name: "Test Project", + slug: "test-project", + organization: { + connect: { + slug: organization.slug, + }, + }, + }, + include: { + organization: { + include: { + members: true, + }, + }, + }, + }); + + // Create test environment + await prisma.runtimeEnvironment.create({ + data: { + slug: "dev", + // Defined in @examples/nextjs-test + apiKey: "tr_dev_test-api-key", + pkApiKey: "tr_dev_pk_test-api-key", + autoEnableInternalSources: false, + organization: { + connect: { + id: organization.id, + }, + }, + project: { + connect: { + id: project.id, + }, + }, + orgMember: { connect: { id: project.organization.members[0].id } }, + type: "DEVELOPMENT", + }, + }); + + await prisma.runtimeEnvironment.create({ + data: { + slug: "prod", + // Defined in @examples/nextjs-test + apiKey: "tr_prod_test-api-key", + pkApiKey: "tr_prod_pk_test-api-key", + autoEnableInternalSources: false, + organization: { + connect: { + id: organization.id, + }, + }, + project: { + connect: { + id: project.id, + }, + }, + orgMember: { connect: { id: project.organization.members[0].id } }, + type: "PRODUCTION", + }, + }); + }); +}; + +export default setup; diff --git a/tests/global.teardown.ts b/tests/global.teardown.ts new file mode 100644 index 000000000..bf7bed5cd --- /dev/null +++ b/tests/global.teardown.ts @@ -0,0 +1,17 @@ +import { setDB } from "./utils"; + +const teardown = async () => { + await setDB(async (prisma) => { + // Delete test organization + await prisma.organization.delete({ + where: { slug: "test-org" }, + }); + + // Delete test user + await prisma.user.delete({ + where: { email: "test-user@test.com" }, + }); + }); +}; + +export default teardown; diff --git a/tests/utils.ts b/tests/utils.ts new file mode 100644 index 000000000..79accfde2 --- /dev/null +++ b/tests/utils.ts @@ -0,0 +1,19 @@ +import { PrismaClient } from "@trigger.dev/database"; + +type SetDBCallback = (prisma: PrismaClient) => Promise; + +export const setDB = async (cb: SetDBCallback) => { + const { DATABASE_URL } = process.env; + + const prisma = new PrismaClient({ + datasources: { + db: { + url: DATABASE_URL, + }, + }, + }); + + await prisma.$connect(); + await cb(prisma); + await prisma.$disconnect(); +};