diff --git a/.doc-detective.ci.json b/.doc-detective.ci.json new file mode 100644 index 0000000..41eb2aa --- /dev/null +++ b/.doc-detective.ci.json @@ -0,0 +1,23 @@ +{ + "input": [ + "src/content/docs/docs/integrations/slack-integration.mdx", + "src/content/docs/docs/getting-started/setup-quickstart.mdx" + ], + "output": ".doc-detective/results", + "recursive": true, + "origin": "https://promptless.ai", + "detectSteps": false, + "loadVariables": ".doc-detective/.env", + "beforeAny": ".doc-detective/tests/login.spec.json", + "runOn": [ + { + "platforms": ["linux"], + "browsers": [ + { + "name": "chrome", + "headless": true + } + ] + } + ] +} diff --git a/.doc-detective/.env.example b/.doc-detective/.env.example index f2e4502..676c1f9 100644 --- a/.doc-detective/.env.example +++ b/.doc-detective/.env.example @@ -2,3 +2,9 @@ # Copy this to .env and fill in your test account values PROMPTLESS_TEST_EMAIL=your-test-user@example.com PROMPTLESS_TEST_PASSWORD=your-test-password + +# Promptless test org +PROMPTLESS_TEST_ORG_ID=org_xxxxx + +# Database connection for resetting onboarding state +DATABASE_URL=postgresql://user:pass@host:5432/dbname diff --git a/.doc-detective/tests/login.spec.json b/.doc-detective/tests/login.spec.json index 9c9f36f..3310608 100644 --- a/.doc-detective/tests/login.spec.json +++ b/.doc-detective/tests/login.spec.json @@ -4,6 +4,12 @@ "testId": "clerk-login", "description": "Sign in to Promptless with test credentials", "steps": [ + { + "description": "Reset onboarding state for test org", + "runShell": { + "command": "psql $DATABASE_URL -c \"UPDATE customer_info SET onboarding_completed = false, onboarding_info = '{}'::jsonb WHERE org_id = '$PROMPTLESS_TEST_ORG_ID';\"" + } + }, { "description": "Navigate to the sign-in page", "goTo": "https://accounts.gopromptless.ai/sign-in" @@ -27,11 +33,16 @@ "timeout": 5000 } }, + { + "description": "Wait for password page to load", + "wait": 3000 + }, { "description": "Click the password input", "find": { "selector": "#password-field", - "click": true + "click": true, + "timeout": 10000 } }, { diff --git a/.github/workflows/doc-detective.yml b/.github/workflows/doc-detective.yml new file mode 100644 index 0000000..d1f1ed5 --- /dev/null +++ b/.github/workflows/doc-detective.yml @@ -0,0 +1,46 @@ +name: doc-detective + +on: + workflow_dispatch: + +jobs: + doc-test: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install Nushell + run: | + curl -fsSL https://github.com/nushell/nushell/releases/latest/download/nu-linux-x86_64.tar.gz -o nu.tar.gz + tar -xzf nu.tar.gz + sudo mv nu-*/nu /usr/local/bin/ + rm -rf nu.tar.gz nu-* + + - name: Install dependencies + run: npm ci --no-audit --no-fund + + - name: Write test credentials + run: | + cat > .doc-detective/.env <