diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml
index a214e3f5..6f878150 100644
--- a/.github/workflows/playwright.yml
+++ b/.github/workflows/playwright.yml
@@ -32,6 +32,12 @@ jobs:
- name: Build dashboard
run: yarn build:dashboard
+ env:
+ VITE_GOOGLE_CLIENT_ID: ${{ secrets.VITE_GOOGLE_CLIENT_ID }}
+ VITE_SERVER_BASE_URL: ${{ secrets.VITE_SERVER_BASE_URL }}
+ VITE_LINK_SURVEY_HOST: ${{ secrets.VITE_LINK_SURVEY_HOST }}
+ VITE_PUBLIC_POSTHOG_KEY: ${{ secrets.VITE_PUBLIC_POSTHOG_KEY }}
+ VITE_PUBLIC_POSTHOG_HOST: ${{ secrets.VITE_PUBLIC_POSTHOG_HOST }}
- name: Start Backend Server
run: docker compose -f ./docker-compose-test.yml up -d
diff --git a/apps/frontend/.gitignore b/apps/frontend/.gitignore
index b88c8135..2f878a4e 100644
--- a/apps/frontend/.gitignore
+++ b/apps/frontend/.gitignore
@@ -26,3 +26,4 @@ dist-ssr
/playwright-report/
/blob-report/
/playwright/.cache/
+/playwright/.auth/
diff --git a/apps/frontend/package.json b/apps/frontend/package.json
index 93317f01..5e312657 100644
--- a/apps/frontend/package.json
+++ b/apps/frontend/package.json
@@ -60,6 +60,7 @@
"zustand": "^4.4.5"
},
"devDependencies": {
+ "@faker-js/faker": "^9.0.1",
"@graphql-codegen/cli": "^3.3.1",
"@graphql-codegen/client-preset": "^4.1.0",
"@graphql-codegen/typescript": "^3.0.4",
diff --git a/apps/frontend/playwright.config.ts b/apps/frontend/playwright.config.ts
index 55c996b3..70f9e29a 100644
--- a/apps/frontend/playwright.config.ts
+++ b/apps/frontend/playwright.config.ts
@@ -1,4 +1,5 @@
import { defineConfig, devices } from "@playwright/test";
+import { ONBOARDED_USER_FILE } from "./tests/utils/constants";
/**
* Read environment variables from file.
@@ -12,14 +13,14 @@ import { defineConfig, devices } from "@playwright/test";
*/
export default defineConfig({
testDir: "./tests",
+ timeout: 90000,
/* 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,
+ retries: 3,
/* Opt out of parallel tests on CI. */
- workers: process.env.CI ? 1 : undefined,
+ workers: process.env.CI ? undefined : "80%",
/* 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. */
@@ -33,19 +34,24 @@ export default defineConfig({
/* Configure projects for major browsers */
projects: [
+ { name: "setup", testMatch: /.*\.setup\.ts/ },
+
{
name: "chromium",
- use: { ...devices["Desktop Chrome"] },
+ use: { ...devices["Desktop Chrome"], storageState: ONBOARDED_USER_FILE },
+ dependencies: ["setup"],
},
{
name: "firefox",
- use: { ...devices["Desktop Firefox"] },
+ use: { ...devices["Desktop Firefox"], storageState: ONBOARDED_USER_FILE },
+ dependencies: ["setup"],
},
{
name: "webkit",
- use: { ...devices["Desktop Safari"] },
+ use: { ...devices["Desktop Safari"], storageState: ONBOARDED_USER_FILE },
+ dependencies: ["setup"],
},
/* Test against mobile viewports. */
@@ -70,9 +76,16 @@ export default defineConfig({
],
/* Run your local dev server before starting the tests */
- webServer: {
- command: "yarn preview",
- url: "http://localhost:5173",
- reuseExistingServer: true,
- },
+ webServer: [
+ {
+ command: "yarn preview",
+ url: "http://localhost:5173",
+ reuseExistingServer: true,
+ },
+ // {
+ // command: "yarn preview",
+ // url: "http://localhost:3000",
+ // reuseExistingServer: true,
+ // },
+ ],
});
diff --git a/apps/frontend/src/layout/AuthLayout.tsx b/apps/frontend/src/layout/AuthLayout.tsx
index e7ebd192..f54e23aa 100644
--- a/apps/frontend/src/layout/AuthLayout.tsx
+++ b/apps/frontend/src/layout/AuthLayout.tsx
@@ -6,7 +6,7 @@ import Profile2 from "../assets/images/loginScreen/profile-2.png";
import Profile3 from "../assets/images/loginScreen/profile-3.png";
import Logo from "../assets/images/logo.png";
-const clientId = import.meta.env.VITE_GOOGLE_CLIENT_ID;
+const clientId = import.meta.env.VITE_GOOGLE_CLIENT_ID ?? "";
export function AuthLayout() {
return (
diff --git a/apps/frontend/src/layout/partials/Navbar.tsx b/apps/frontend/src/layout/partials/Navbar.tsx
index 20ee6bea..a92084b7 100644
--- a/apps/frontend/src/layout/partials/Navbar.tsx
+++ b/apps/frontend/src/layout/partials/Navbar.tsx
@@ -165,6 +165,7 @@ export const Navbar = () => {
diff --git a/apps/frontend/src/modules/surveys/components/studio/create/editor-panel/questions/attributes/LogicFields/Form/DefaultFormLogic.tsx b/apps/frontend/src/modules/surveys/components/studio/create/editor-panel/questions/attributes/LogicFields/Form/DefaultFormLogic.tsx
index d5790f9a..0f2dda4a 100644
--- a/apps/frontend/src/modules/surveys/components/studio/create/editor-panel/questions/attributes/LogicFields/Form/DefaultFormLogic.tsx
+++ b/apps/frontend/src/modules/surveys/components/studio/create/editor-panel/questions/attributes/LogicFields/Form/DefaultFormLogic.tsx
@@ -1,6 +1,6 @@
import { useQuestion } from "@/modules/surveys/hooks/useQuestion";
import { useSurvey } from "@/modules/surveys/hooks/useSurvey";
-import { QuestionLogic, LogicOperator } from "@/types";
+import { LogicOperator, QuestionLogic } from "@/types";
import { cn, generateUniqueId } from "@/utils";
import { destinationOptions } from "@/utils/question";
import { PlusIcon } from "lucide-react";
@@ -131,6 +131,7 @@ const FormLogicDefault = ({ setFormLogicValues, formLogicValues, setIsCreatingLo
onchange={(value: SingleValue