From 472d8c007567b50b4abf05b0ef6f9179dc87adb3 Mon Sep 17 00:00:00 2001 From: Trufa Date: Sat, 8 Jul 2023 15:17:56 -0600 Subject: [PATCH 01/12] redirect --- src/pages/study.tsx | 3 +++ src/utils/generateGSSP.ts | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/utils/generateGSSP.ts diff --git a/src/pages/study.tsx b/src/pages/study.tsx index 56fe706..d1efce1 100644 --- a/src/pages/study.tsx +++ b/src/pages/study.tsx @@ -1,4 +1,7 @@ import Study from "~/components/Study/Study"; +import generateGSSP from "~/utils/generateGSSP"; + +export const getServerSideProps = generateGSSP("/study"); const StudyPage = () => { return ; diff --git a/src/utils/generateGSSP.ts b/src/utils/generateGSSP.ts new file mode 100644 index 0000000..afece1a --- /dev/null +++ b/src/utils/generateGSSP.ts @@ -0,0 +1,23 @@ +import { GetServerSideProps } from "next"; +import { getServerAuthSession } from "~/server/auth"; + +type GenerateGSSP = (callbackUrl: string) => GetServerSideProps; + +const generateGSSP: GenerateGSSP = (callbackUrl) => async (ctx) => { + const session = await getServerAuthSession(ctx); + if (session) { + return { + props: { + session, + }, + }; + } + return { + redirect: { + destination: `/api/auth/signin?callbackUrl=${callbackUrl}`, + permanent: false, + }, + }; +}; + +export default generateGSSP; From 1051763f76294be487d5bc4518dc013b386e6534 Mon Sep 17 00:00:00 2001 From: Trufa Date: Sat, 8 Jul 2023 15:21:28 -0600 Subject: [PATCH 02/12] rename --- src/pages/study.tsx | 4 ++-- src/utils/{generateGSSP.ts => generateAuthGSSP.ts} | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename src/utils/{generateGSSP.ts => generateAuthGSSP.ts} (67%) diff --git a/src/pages/study.tsx b/src/pages/study.tsx index d1efce1..d09e652 100644 --- a/src/pages/study.tsx +++ b/src/pages/study.tsx @@ -1,7 +1,7 @@ import Study from "~/components/Study/Study"; -import generateGSSP from "~/utils/generateGSSP"; +import generateAuthGSSP from "~/utils/generateAuthGSSP"; -export const getServerSideProps = generateGSSP("/study"); +export const getServerSideProps = generateAuthGSSP("/study"); const StudyPage = () => { return ; diff --git a/src/utils/generateGSSP.ts b/src/utils/generateAuthGSSP.ts similarity index 67% rename from src/utils/generateGSSP.ts rename to src/utils/generateAuthGSSP.ts index afece1a..5036bf1 100644 --- a/src/utils/generateGSSP.ts +++ b/src/utils/generateAuthGSSP.ts @@ -1,9 +1,9 @@ import { GetServerSideProps } from "next"; import { getServerAuthSession } from "~/server/auth"; -type GenerateGSSP = (callbackUrl: string) => GetServerSideProps; +type GenerateAuthGSSP = (callbackUrl: string) => GetServerSideProps; -const generateGSSP: GenerateGSSP = (callbackUrl) => async (ctx) => { +const generateAuthGSSP: GenerateAuthGSSP = (callbackUrl) => async (ctx) => { const session = await getServerAuthSession(ctx); if (session) { return { @@ -20,4 +20,4 @@ const generateGSSP: GenerateGSSP = (callbackUrl) => async (ctx) => { }; }; -export default generateGSSP; +export default generateAuthGSSP; From 6b970dc43e8c6cab00ff46c4cf848aed7b1ba998 Mon Sep 17 00:00:00 2001 From: Trufa Date: Sat, 8 Jul 2023 15:24:20 -0600 Subject: [PATCH 03/12] deleted only --- cypress/e2e/study/pgnTools/downloadPgn.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/study/pgnTools/downloadPgn.cy.ts b/cypress/e2e/study/pgnTools/downloadPgn.cy.ts index 1812fd1..6933f6a 100644 --- a/cypress/e2e/study/pgnTools/downloadPgn.cy.ts +++ b/cypress/e2e/study/pgnTools/downloadPgn.cy.ts @@ -14,7 +14,7 @@ describe("Check functioning of PGN download", () => { cy.data("download-pgn").should("be.enabled"); }); - it.only("Should copy PGN to clipboard", () => { + it("Should copy PGN to clipboard", () => { cy.playGame(gamesBySquares.shortExample); cy.data("pgn-tools-menu").click(); cy.data("download-pgn").click(); From 006fc6e478e07cc7140087f308aba2ffbc21bbfc Mon Sep 17 00:00:00 2001 From: Trufa Date: Sat, 8 Jul 2023 17:45:14 -0600 Subject: [PATCH 04/12] loads pgn --- src/components/Study/Study.tsx | 6 ++++++ src/state/study.ts | 26 +++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/components/Study/Study.tsx b/src/components/Study/Study.tsx index e522d42..0c4453f 100644 --- a/src/components/Study/Study.tsx +++ b/src/components/Study/Study.tsx @@ -2,8 +2,14 @@ import { HStack } from "@chakra-ui/react"; import PgnViewer from "~/components/PgnViewer/PgnViewer"; import Board from "~/components/Board/Board"; import PositionInfo from "~/components/PositionInfo/PositionInfo"; +import useStudyStore from "~/state/study"; +import { useEffect } from "react"; const Study = () => { + const { loadPGN } = useStudyStore(); + useEffect(() => { + loadPGN("1. e4 h5 (1... a5) 2. f4"); + }, []); return ( <> diff --git a/src/state/study.ts b/src/state/study.ts index 0502d75..644c84c 100644 --- a/src/state/study.ts +++ b/src/state/study.ts @@ -13,11 +13,13 @@ interface MoveData { dests: Dests; } +type MoveDataByIndex = Map; + interface StudyState { id: string; parent: string | null; chess: Chess; - moveDataByIndex: Map; + moveDataByIndex: MoveDataByIndex; branches: Map; currentMoveIndex: Index; setCurrentMoveIndex: (index: Index) => void; @@ -26,6 +28,7 @@ interface StudyState { moveLength: () => number; currentFen: () => FEN; move: (orig: Key, dest: Key) => void; + loadPGN: (pgn: PGN) => void; } const toDests = (fen: FEN): Dests => { @@ -116,6 +119,27 @@ const useStudyStore = create()( todo(null); } }, + loadPGN: (pgn) => { + const chess = new Chess(); + chess.loadPgn(pgn); + const moves = pgn.split(" "); + const newMoveDataByIndex: MoveDataByIndex = new Map().set(0, { + fen: initialFen, + dests: toDests(initialFen), + }); + chess.history({ verbose: true }).map((move, i) => { + console.log("setting", i + 1, move.after); + newMoveDataByIndex.set(i + 1, { + fen: move.after, + dests: toDests(move.after), + }); + }); + set(() => ({ + chess, + moveDataByIndex: newMoveDataByIndex, + currentMoveIndex: 0, + })); + }, }; }) ); From dd5b0ec9ab1d374400f2d7f9d7f365311227ac9c Mon Sep 17 00:00:00 2001 From: Trufa Date: Fri, 14 Jul 2023 13:43:52 -0600 Subject: [PATCH 05/12] tests with login --- .env.example | 28 +++++++------------- cypress.config.ts | 4 ++- cypress/e2e/study/controls.cy.ts | 1 + cypress/e2e/study/fen.cy.ts | 1 + cypress/e2e/study/moves.cy.ts | 1 + cypress/e2e/study/pgnTools/copyPgn.cy.ts | 1 + cypress/e2e/study/pgnTools/downloadPgn.cy.ts | 1 + cypress/e2e/study/pgnViewer.cy.ts | 1 + cypress/e2e/study/study.cy.ts | 1 + cypress/support/commands.ts | 23 ++++++++++++++++ src/components/Study/Study.tsx | 2 +- src/env.mjs | 13 --------- src/pages/index.tsx | 2 +- src/state/study.ts | 2 ++ 14 files changed, 46 insertions(+), 35 deletions(-) diff --git a/.env.example b/.env.example index a16f82a..ecf6629 100644 --- a/.env.example +++ b/.env.example @@ -1,23 +1,13 @@ -# Since the ".env" file is gitignored, you can use the ".env.example" file to -# build a new ".env" file when you clone the repo. Keep this file up-to-date -# when you add new variables to `.env`. +DATABASE_URL="" -# This file will be committed to version control, so make sure not to have any -# secrets in it. If you are cloning this repo, create a copy of this file named -# ".env" and populate it with your secrets. +NEXT_PUBLIC_SITE_URL="" -# When adding additional environment variables, the schema in "/src/env.mjs" -# should be updated accordingly. - -# Prisma -# https://www.prisma.io/docs/reference/database-reference/connection-urls#env -DATABASE_URL="file:./db.sqlite" - -# Next Auth -# You can generate a new secret on the command line with: -# openssl rand -base64 32 -# https://next-auth.js.org/configuration/options#secret -# NEXTAUTH_SECRET="" -NEXTAUTH_URL="http://localhost:3000" +AUTH0_CLIENT_ID="" +AUTH0_CLIENT_SECRET="" +AUTH0_ISSUER="" +CYPRESS_TEST_USER_EMAIL="" +CYPRESS_TEST_USER_PASSWORD="" +TEST_USER_EMAIL="" +TEST_USER_PASSWORD="" \ No newline at end of file diff --git a/cypress.config.ts b/cypress.config.ts index b859024..a9f95b1 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,10 +1,12 @@ import { defineConfig } from "cypress"; export default defineConfig({ + viewportHeight: 1000, env: { NEXT_PUBLIC_SITE_URL: "http://localhost:3000", + TEST_USER_EMAIL: process.env.TEST_USER_EMAIL, + TEST_USER_PASSWORD: process.env.TEST_USER_PASSWORD, }, - viewportHeight: 1000, e2e: { setupNodeEvents(on, config) { // implement node event listeners here diff --git a/cypress/e2e/study/controls.cy.ts b/cypress/e2e/study/controls.cy.ts index 9e0a902..3f58e23 100644 --- a/cypress/e2e/study/controls.cy.ts +++ b/cypress/e2e/study/controls.cy.ts @@ -2,6 +2,7 @@ import gamesBySquares from "../../utils/gamesBySquares"; describe("Check that controls move around", () => { beforeEach(() => { + cy.login(); cy.visit(`${Cypress.env("NEXT_PUBLIC_SITE_URL")}/study`); cy.playGame(gamesBySquares.shortExample); }); diff --git a/cypress/e2e/study/fen.cy.ts b/cypress/e2e/study/fen.cy.ts index b947833..a3fee6e 100644 --- a/cypress/e2e/study/fen.cy.ts +++ b/cypress/e2e/study/fen.cy.ts @@ -2,6 +2,7 @@ import gamesBySquares from "../../utils/gamesBySquares"; describe("Check that controls move around", () => { beforeEach(() => { + cy.login(); cy.visit(`${Cypress.env("NEXT_PUBLIC_SITE_URL")}/study`); }); diff --git a/cypress/e2e/study/moves.cy.ts b/cypress/e2e/study/moves.cy.ts index cefe18a..f14ddeb 100644 --- a/cypress/e2e/study/moves.cy.ts +++ b/cypress/e2e/study/moves.cy.ts @@ -2,6 +2,7 @@ import gamesBySquares from "../../utils/gamesBySquares"; describe("Check that PgnViewer component works as expected", () => { beforeEach(() => { + cy.login(); cy.visit(`${Cypress.env("NEXT_PUBLIC_SITE_URL")}/study`); }); diff --git a/cypress/e2e/study/pgnTools/copyPgn.cy.ts b/cypress/e2e/study/pgnTools/copyPgn.cy.ts index 546cde9..fd876bc 100644 --- a/cypress/e2e/study/pgnTools/copyPgn.cy.ts +++ b/cypress/e2e/study/pgnTools/copyPgn.cy.ts @@ -2,6 +2,7 @@ import gamesBySquares from "../../../utils/gamesBySquares"; describe("Check functioning of PGN copying", () => { beforeEach(() => { + cy.login(); cy.visit(`${Cypress.env("NEXT_PUBLIC_SITE_URL")}/study`); }); diff --git a/cypress/e2e/study/pgnTools/downloadPgn.cy.ts b/cypress/e2e/study/pgnTools/downloadPgn.cy.ts index 6933f6a..3d48c7b 100644 --- a/cypress/e2e/study/pgnTools/downloadPgn.cy.ts +++ b/cypress/e2e/study/pgnTools/downloadPgn.cy.ts @@ -2,6 +2,7 @@ import gamesBySquares from "../../../utils/gamesBySquares"; describe("Check functioning of PGN download", () => { beforeEach(() => { + cy.login(); cy.visit(`${Cypress.env("NEXT_PUBLIC_SITE_URL")}/study`); }); diff --git a/cypress/e2e/study/pgnViewer.cy.ts b/cypress/e2e/study/pgnViewer.cy.ts index 0fd372d..733d604 100644 --- a/cypress/e2e/study/pgnViewer.cy.ts +++ b/cypress/e2e/study/pgnViewer.cy.ts @@ -2,6 +2,7 @@ import gamesBySquares from "../../utils/gamesBySquares"; describe("Check that PgnViewer shows correct moves", () => { beforeEach(() => { + cy.login(); cy.visit(`${Cypress.env("NEXT_PUBLIC_SITE_URL")}/study`); }); diff --git a/cypress/e2e/study/study.cy.ts b/cypress/e2e/study/study.cy.ts index 0bfd47a..1cf46dd 100644 --- a/cypress/e2e/study/study.cy.ts +++ b/cypress/e2e/study/study.cy.ts @@ -2,6 +2,7 @@ import gamesBySquares from "../../utils/gamesBySquares"; describe("Check basic moves in study", () => { beforeEach(() => { + cy.login(); cy.visit(`${Cypress.env("NEXT_PUBLIC_SITE_URL")}/study`); }); diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 1ff5c88..9dd341d 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -15,6 +15,7 @@ declare global { testBoardStore(): Chainable; testStudyStore(): Chainable; assertValueCopiedToClipboard(value: string): void; + login(): void; } } } @@ -60,3 +61,25 @@ Cypress.Commands.add("assertValueCopiedToClipboard", (value) => { cy.wrap(win.navigator.clipboard.readText()).should("eq", value); }); }); + +Cypress.Commands.add("login", () => { + cy.session( + "login", + () => { + cy.visit(`${Cypress.env("NEXT_PUBLIC_SITE_URL")}`); + cy.data("sign-in-out").click(); + cy.get("button").contains("Sign in with Auth0").click(); + cy.origin("https://opening-expert.us.auth0.com", () => { + cy.get("#username").type(Cypress.env("TEST_USER_EMAIL")); + cy.get("#password") + .type(Cypress.env("TEST_USER_PASSWORD")) + .type("{enter}"); + }); + }, + { + validate: () => { + cy.getCookie("next-auth.session-token").should("exist"); + }, + } + ); +}); diff --git a/src/components/Study/Study.tsx b/src/components/Study/Study.tsx index 0c4453f..910e8f8 100644 --- a/src/components/Study/Study.tsx +++ b/src/components/Study/Study.tsx @@ -8,7 +8,7 @@ import { useEffect } from "react"; const Study = () => { const { loadPGN } = useStudyStore(); useEffect(() => { - loadPGN("1. e4 h5 (1... a5) 2. f4"); + //loadPGN("1. e4 h5 (1... a5) 2. f4"); }, []); return ( <> diff --git a/src/env.mjs b/src/env.mjs index 7d713ec..87d3de0 100644 --- a/src/env.mjs +++ b/src/env.mjs @@ -9,17 +9,6 @@ export const env = createEnv({ server: { DATABASE_URL: z.string(), NODE_ENV: z.enum(["development", "test", "production"]), - NEXTAUTH_SECRET: - process.env.NODE_ENV === "production" - ? z.string().min(1) - : z.string().min(1).optional(), - NEXTAUTH_URL: z.preprocess( - // This makes Vercel deployments not fail if you don't set NEXTAUTH_URL - // Since NextAuth.js automatically uses the VERCEL_URL if present. - (str) => process.env.VERCEL_URL ?? str, - // VERCEL_URL doesn't include `https` so it cant be validated as a URL - process.env.VERCEL ? z.string().min(1) : z.string().url(), - ), AUTH0_CLIENT_ID: z.string().min(1), AUTH0_CLIENT_SECRET: z.string().min(1), AUTH0_ISSUER: z.string().min(1), @@ -42,8 +31,6 @@ export const env = createEnv({ runtimeEnv: { DATABASE_URL: process.env.DATABASE_URL, NODE_ENV: process.env.NODE_ENV, - NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET, - NEXTAUTH_URL: process.env.NEXTAUTH_URL, NEXT_PUBLIC_SITE_URL: process.env.NEXT_PUBLIC_SITE_URL, AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID, AUTH0_CLIENT_SECRET: process.env.AUTH0_CLIENT_SECRET, diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 68ca395..f32facd 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,7 +1,6 @@ import { type NextPage } from "next"; import { signIn, signOut, useSession } from "next-auth/react"; import Head from "next/head"; -import { api } from "~/api"; import Link from "next/link"; import { Heading } from "@chakra-ui/react"; @@ -25,6 +24,7 @@ const Home: NextPage = () => {

diff --git a/src/state/study.ts b/src/state/study.ts index 644c84c..6c916de 100644 --- a/src/state/study.ts +++ b/src/state/study.ts @@ -48,7 +48,9 @@ const toDests = (fen: FEN): Dests => { }; const promotionCalcChess = new Chess(); + const isPromotion = (fen: FEN, orig: Key, dest: Key): boolean => { + console.log("fen", fen); promotionCalcChess.load(fen); return promotionCalcChess .move({ from: orig, to: dest, promotion: "q" }) From cd0994797269a4c5c5408b1317bc30052c8581f9 Mon Sep 17 00:00:00 2001 From: Trufa Date: Fri, 14 Jul 2023 14:52:46 -0600 Subject: [PATCH 06/12] log to check --- cypress.config.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cypress.config.ts b/cypress.config.ts index a9f95b1..be68243 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,5 +1,7 @@ import { defineConfig } from "cypress"; +console.log("RUNNING CONFIG!", process.env.TEST_USER_EMAIL); + export default defineConfig({ viewportHeight: 1000, env: { From 5e42e70458791121538228fa422715d1bb7bc0d0 Mon Sep 17 00:00:00 2001 From: Trufa Date: Fri, 14 Jul 2023 14:56:34 -0600 Subject: [PATCH 07/12] secrets to env --- .github/workflows/main.yml | 2 ++ cypress.config.ts | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index daa4df9..3e21586 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,3 +25,5 @@ jobs: AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }} AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }} AUTH0_ISSUER: ${{ secrets.AUTH0_ISSUER }} + TEST_USER_EMAIL: ${{ secrets.TEST_USER_EMAIL }} + TEST_USER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }} diff --git a/cypress.config.ts b/cypress.config.ts index be68243..a9f95b1 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,7 +1,5 @@ import { defineConfig } from "cypress"; -console.log("RUNNING CONFIG!", process.env.TEST_USER_EMAIL); - export default defineConfig({ viewportHeight: 1000, env: { From 2ff54cfc4b55493eca81629f62fa0344ad63cf4b Mon Sep 17 00:00:00 2001 From: Trufa Date: Sat, 15 Jul 2023 12:21:59 -0600 Subject: [PATCH 08/12] changed test deploy --- .github/workflows/main.yml | 4 ++++ .gitignore | 1 + cypress.config.ts | 5 ----- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3e21586..f27fe67 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,6 +9,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + # Write the cypress.env.json file + - name: Write the cypress.env.json file 📝 + run: | + echo '${{ secrets.CYPRESS_ENV_CI }}' > cypress.env.json # Install NPM dependencies, cache them correctly # and run all Cypress tests - name: Cypress run diff --git a/.gitignore b/.gitignore index f54bd33..169c936 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ yarn-error.log* cypress/videos cypress/screenshots +cypress.env.json diff --git a/cypress.config.ts b/cypress.config.ts index a9f95b1..3f443dc 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -2,11 +2,6 @@ import { defineConfig } from "cypress"; export default defineConfig({ viewportHeight: 1000, - env: { - NEXT_PUBLIC_SITE_URL: "http://localhost:3000", - TEST_USER_EMAIL: process.env.TEST_USER_EMAIL, - TEST_USER_PASSWORD: process.env.TEST_USER_PASSWORD, - }, e2e: { setupNodeEvents(on, config) { // implement node event listeners here From 9a1841b0b9553daae0e8a38b776dab8b7d1bac4f Mon Sep 17 00:00:00 2001 From: Trufa Date: Sat, 15 Jul 2023 17:30:24 -0600 Subject: [PATCH 09/12] log --- .gitignore | 1 + cypress/support/commands.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index 169c936..c9388fd 100644 --- a/.gitignore +++ b/.gitignore @@ -44,4 +44,5 @@ yarn-error.log* cypress/videos cypress/screenshots +cypress/downloads cypress.env.json diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 9dd341d..606aaae 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -66,6 +66,11 @@ Cypress.Commands.add("login", () => { cy.session( "login", () => { + console.log( + "logging in!", + Cypress.env("TEST_USER_EMAIL"), + Cypress.env("TEST_USER_PASSWORD") + ); cy.visit(`${Cypress.env("NEXT_PUBLIC_SITE_URL")}`); cy.data("sign-in-out").click(); cy.get("button").contains("Sign in with Auth0").click(); From 4da6a48c809627a9752bce66eafd533b9fe597b9 Mon Sep 17 00:00:00 2001 From: Trufa Date: Sat, 15 Jul 2023 18:02:38 -0600 Subject: [PATCH 10/12] log --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f27fe67..f36d0a3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: # Write the cypress.env.json file - name: Write the cypress.env.json file 📝 run: | - echo '${{ secrets.CYPRESS_ENV_CI }}' > cypress.env.json + echo '${{ secrets.CYPRESS_ENV_CI }}' > cypress.env.json && cat cypress.env.json # Install NPM dependencies, cache them correctly # and run all Cypress tests - name: Cypress run From fa3d19676df1588aeefa078a803c6c55f89e8218 Mon Sep 17 00:00:00 2001 From: Trufa Date: Sat, 15 Jul 2023 18:30:32 -0600 Subject: [PATCH 11/12] another approach --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f36d0a3..67565b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: # Write the cypress.env.json file - name: Write the cypress.env.json file 📝 run: | - echo '${{ secrets.CYPRESS_ENV_CI }}' > cypress.env.json && cat cypress.env.json + echo '$CYPRESS_ENV_CI' > cypress.env.json && cat cypress.env.json # Install NPM dependencies, cache them correctly # and run all Cypress tests - name: Cypress run @@ -31,3 +31,4 @@ jobs: AUTH0_ISSUER: ${{ secrets.AUTH0_ISSUER }} TEST_USER_EMAIL: ${{ secrets.TEST_USER_EMAIL }} TEST_USER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }} + CYPRESS_ENV_CI: ${{ secrets.CYPRESS_ENV_CI }} From 6b985817144b01a0337aebbc72ea71dc3e892534 Mon Sep 17 00:00:00 2001 From: Trufa Date: Tue, 8 Aug 2023 16:23:25 -0600 Subject: [PATCH 12/12] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 67565b4..ab1b798 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: # Write the cypress.env.json file - name: Write the cypress.env.json file 📝 run: | - echo '$CYPRESS_ENV_CI' > cypress.env.json && cat cypress.env.json + echo '${{ secrets.CYPRESS_ENV_CI }}' > cypress.env.json && cat cypress.env.json # Install NPM dependencies, cache them correctly # and run all Cypress tests - name: Cypress run