diff --git a/.github/workflows/main-pipeline.yaml b/.github/workflows/main-pipeline.yaml index 895bd300..56efc707 100644 --- a/.github/workflows/main-pipeline.yaml +++ b/.github/workflows/main-pipeline.yaml @@ -194,12 +194,14 @@ jobs: - run: | echo "VITE_NINETAILED_CLIENT_ID=${{secrets.NINETAILED_CLIENT_ID}}" >>implementations/node/.env echo "VITE_NINETAILED_ENVIRONMENT=${{secrets.NINETAILED_ENVIRONMENT}}" >>implementations/node/.env + echo "VITE_EXPERIENCE_API_BASE_URL=http://localhost/experience/" >>implementations/node/.env + echo "VITE_INSIGHTS_API_BASE_URL=http://localhost/insights/" >>implementations/node/.env echo "VITE_CONTENTFUL_TOKEN=${{secrets.CONTENTFUL_TOKEN}}" >>implementations/node/.env echo "VITE_CONTENTFUL_PREVIEW_TOKEN=${{secrets.CONTENTFUL_PREVIEW_TOKEN}}" >>implementations/node/.env echo "VITE_CONTENTFUL_ENVIRONMENT=${{secrets.CONTENTFUL_ENVIRONMENT}}" >>implementations/node/.env echo "VITE_CONTENTFUL_SPACE_ID=${{secrets.CONTENTFUL_SPACE_ID}}" >>implementations/node/.env - echo "VITE_EXPERIENCE_API_BASE_URL=http://localhost/experience/" >>implementations/node/.env - echo "VITE_INSIGHTS_API_BASE_URL=http://localhost/insights/" >>implementations/node/.env + echo "VITE_CONTENTFUL_CDA_HOST=localhost" >>implementations/node/.env + echo "VITE_CONTENTFUL_BASE_PATH=contentful" >>implementations/node/.env - uses: pnpm/action-setup@v4 @@ -218,6 +220,15 @@ jobs: - run: pnpm --filter @implementation/node test:e2e + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: ci-results-node + path: | + ./implementations/node/playwright-report/ + ./implementations/node/test-results/ + retention-days: 1 + e2e-web: name: E2E Web Vanilla 🖥️ runs-on: ubuntu-latest @@ -231,12 +242,14 @@ jobs: - run: | echo "VITE_NINETAILED_CLIENT_ID=${{secrets.NINETAILED_CLIENT_ID}}" >>implementations/web-vanilla/.env echo "VITE_NINETAILED_ENVIRONMENT=${{secrets.NINETAILED_ENVIRONMENT}}" >>implementations/web-vanilla/.env + echo "VITE_EXPERIENCE_API_BASE_URL=http://localhost:8000/experience/" >>implementations/web-vanilla/.env + echo "VITE_INSIGHTS_API_BASE_URL=http://localhost:8000/insights/" >>implementations/web-vanilla/.env echo "VITE_CONTENTFUL_TOKEN=${{secrets.CONTENTFUL_TOKEN}}" >>implementations/web-vanilla/.env echo "VITE_CONTENTFUL_PREVIEW_TOKEN=${{secrets.CONTENTFUL_PREVIEW_TOKEN}}" >>implementations/web-vanilla/.env echo "VITE_CONTENTFUL_ENVIRONMENT=${{secrets.CONTENTFUL_ENVIRONMENT}}" >>implementations/web-vanilla/.env echo "VITE_CONTENTFUL_SPACE_ID=${{secrets.CONTENTFUL_SPACE_ID}}" >>implementations/web-vanilla/.env - echo "VITE_EXPERIENCE_API_BASE_URL=http://localhost/experience/" >>implementations/web-vanilla/.env - echo "VITE_INSIGHTS_API_BASE_URL=http://localhost/insights/" >>implementations/web-vanilla/.env + echo "VITE_CONTENTFUL_CDA_HOST=localhost:8000" >>implementations/web-vanilla/.env + echo "VITE_CONTENTFUL_BASE_PATH=contentful" >>implementations/web-vanilla/.env - uses: pnpm/action-setup@v4 @@ -254,3 +267,12 @@ jobs: - run: pnpx playwright install --with-deps - run: pnpm --filter @implementation/web-vanilla test:e2e + + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: ci-results-web-vanilla + path: | + ./implementations/web-vanilla/playwright-report/ + ./implementations/web-vanilla/test-results/ + retention-days: 1 diff --git a/implementations/node-ssr/.env.example b/implementations/node-ssr/.env.example index eb49fa29..8c4628b9 100644 --- a/implementations/node-ssr/.env.example +++ b/implementations/node-ssr/.env.example @@ -1,12 +1,13 @@ VITE_NINETAILED_CLIENT_ID= VITE_NINETAILED_ENVIRONMENT= +VITE_EXPERIENCE_API_BASE_URL= +VITE_INSIGHTS_API_BASE_URL= + VITE_CONTENTFUL_TOKEN= VITE_CONTENTFUL_PREVIEW_TOKEN= VITE_CONTENTFUL_ENVIRONMENT= VITE_CONTENTFUL_SPACE_ID= -VITE_EXPERIENCE_API_BASE_URL= -VITE_INSIGHTS_API_BASE_URL= VITE_CONTENTFUL_CDA_HOST= VITE_CONTENTFUL_BASE_PATH= diff --git a/implementations/node/.env.example b/implementations/node/.env.example index eb49fa29..8c4628b9 100644 --- a/implementations/node/.env.example +++ b/implementations/node/.env.example @@ -1,12 +1,13 @@ VITE_NINETAILED_CLIENT_ID= VITE_NINETAILED_ENVIRONMENT= +VITE_EXPERIENCE_API_BASE_URL= +VITE_INSIGHTS_API_BASE_URL= + VITE_CONTENTFUL_TOKEN= VITE_CONTENTFUL_PREVIEW_TOKEN= VITE_CONTENTFUL_ENVIRONMENT= VITE_CONTENTFUL_SPACE_ID= -VITE_EXPERIENCE_API_BASE_URL= -VITE_INSIGHTS_API_BASE_URL= VITE_CONTENTFUL_CDA_HOST= VITE_CONTENTFUL_BASE_PATH= diff --git a/implementations/react-native/.env.example b/implementations/react-native/.env.example index 55acc468..8c4628b9 100644 --- a/implementations/react-native/.env.example +++ b/implementations/react-native/.env.example @@ -1,12 +1,13 @@ -NINETAILED_CLIENT_ID= -NINETAILED_ENVIRONMENT= +VITE_NINETAILED_CLIENT_ID= +VITE_NINETAILED_ENVIRONMENT= -CONTENTFUL_TOKEN= -CONTENTFUL_PREVIEW_TOKEN= -CONTENTFUL_ENVIRONMENT= -CONTENTFUL_SPACE_ID= +VITE_EXPERIENCE_API_BASE_URL= +VITE_INSIGHTS_API_BASE_URL= -EXPERIENCE_API_BASE_URL= -INSIGHTS_API_BASE_URL= -CONTENTFUL_CDA_HOST= -CONTENTFUL_BASE_PATH= +VITE_CONTENTFUL_TOKEN= +VITE_CONTENTFUL_PREVIEW_TOKEN= +VITE_CONTENTFUL_ENVIRONMENT= +VITE_CONTENTFUL_SPACE_ID= + +VITE_CONTENTFUL_CDA_HOST= +VITE_CONTENTFUL_BASE_PATH= diff --git a/implementations/web-vanilla/.env.example b/implementations/web-vanilla/.env.example index eb49fa29..8c4628b9 100644 --- a/implementations/web-vanilla/.env.example +++ b/implementations/web-vanilla/.env.example @@ -1,12 +1,13 @@ VITE_NINETAILED_CLIENT_ID= VITE_NINETAILED_ENVIRONMENT= +VITE_EXPERIENCE_API_BASE_URL= +VITE_INSIGHTS_API_BASE_URL= + VITE_CONTENTFUL_TOKEN= VITE_CONTENTFUL_PREVIEW_TOKEN= VITE_CONTENTFUL_ENVIRONMENT= VITE_CONTENTFUL_SPACE_ID= -VITE_EXPERIENCE_API_BASE_URL= -VITE_INSIGHTS_API_BASE_URL= VITE_CONTENTFUL_CDA_HOST= VITE_CONTENTFUL_BASE_PATH= diff --git a/implementations/web-vanilla/e2e/example.spec.ts b/implementations/web-vanilla/e2e/example.spec.ts index f28aab5d..8acf19c6 100644 --- a/implementations/web-vanilla/e2e/example.spec.ts +++ b/implementations/web-vanilla/e2e/example.spec.ts @@ -1,9 +1,11 @@ import { expect, test } from '@playwright/test' -const CLIENT_ID = process.env.VITE_NINETAILED_CLIENT_ID ?? 'error' - -test('displays client ID', async ({ page }) => { +test('displays merge tag rich text', async ({ page }) => { await page.goto('/') - await expect(page.getByTestId('clientId')).toHaveText(CLIENT_ID) + await page.waitForLoadState('domcontentloaded') + + await expect( + page.getByText('This is a baseline content entry for an A/B/C experiment: A'), + ).toBeVisible() }) diff --git a/implementations/web-vanilla/nginx/templates/default.conf.template b/implementations/web-vanilla/nginx/templates/default.conf.template index b6efb85c..b054038d 100644 --- a/implementations/web-vanilla/nginx/templates/default.conf.template +++ b/implementations/web-vanilla/nginx/templates/default.conf.template @@ -8,13 +8,16 @@ server { set $NGINX_NINETAILED_CLIENT_ID "${VITE_NINETAILED_CLIENT_ID}"; set $NGINX_NINETAILED_ENVIRONMENT "${VITE_NINETAILED_ENVIRONMENT}"; + set $NGINX_EXPERIENCE_API_BASE_URL "${VITE_EXPERIENCE_API_BASE_URL}"; + set $NGINX_INSIGHTS_API_BASE_URL "${VITE_INSIGHTS_API_BASE_URL}"; + set $NGINX_CONTENTFUL_TOKEN "${VITE_CONTENTFUL_TOKEN}"; set $NGINX_CONTENTFUL_PREVIEW_TOKEN "${VITE_CONTENTFUL_PREVIEW_TOKEN}"; set $NGINX_CONTENTFUL_ENVIRONMENT "${VITE_CONTENTFUL_ENVIRONMENT}"; set $NGINX_CONTENTFUL_SPACE_ID "${VITE_CONTENTFUL_SPACE_ID}"; - set $NGINX_EXPERIENCE_API_BASE_URL "${VITE_EXPERIENCE_API_BASE_URL}"; - set $NGINX_INSIGHTS_API_BASE_URL "${VITE_INSIGHTS_API_BASE_URL}"; + set $NGINX_CONTENTFUL_CDA_HOST "${VITE_CONTENTFUL_CDA_HOST}"; + set $NGINX_CONTENTFUL_BASE_PATH "${VITE_CONTENTFUL_BASE_PATH}"; listen 80; diff --git a/implementations/web-vanilla/public/index.html b/implementations/web-vanilla/public/index.html index d68c91ec..e61a62d5 100644 --- a/implementations/web-vanilla/public/index.html +++ b/implementations/web-vanilla/public/index.html @@ -2,25 +2,353 @@