This directory contains smoke tests for the Iterable Web SDK sample application.
We have smoke tests that verify end-to-end integration with Iterable's production APIs:
- Commerce:
updateCartandtrackPurchaseendpoints - Events: Event tracking endpoints (
track,trackInAppClick, etc.) - Users: User management endpoints (
updateUser,updateUserEmail,updateSubscriptions) - In-App Messages: Message fetching and display
- Embedded Messages: Embedded messaging functionality
Create or verify /react-example/.env:
# E2E Web SDK JWT project
API_KEY=3edd1b6806864859b4ee0362f01c8dcb
JWT_SECRET=5b8b772de5474f57cff4b809850bfdab26e88543c8902676ed35ef5f3280280ea7a0e1910159e5063a25efde82d5af550530165d32921061a61a7c0f4ae18f6e
# Authentication mode
USE_JWT=true
JWT_GENERATOR=https://jwt-generator.stg-itbl.co/generate
# Test user for smoke tests
LOGIN_EMAIL=websdk-playwright-test@iterable.comThe smoke tests require specific campaigns and data to be configured in Iterable. See IMPLEMENTATION_GUIDE.md for detailed setup instructions.
Key test user: websdk-playwright-test@iterable.com
cd react-example
yarn startThe app will be available at http://localhost:8080
cd react-example
npx playwright test e2e/smoke# Commerce tests
npx playwright test e2e/smoke/commerce-smoke.spec.ts
# Events tests
npx playwright test e2e/smoke/events-smoke.spec.ts
# Users tests
npx playwright test e2e/smoke/users-smoke.spec.ts
# In-App Messages tests
npx playwright test e2e/smoke/inapp-smoke.spec.ts
# Embedded Messages tests
npx playwright test e2e/smoke/embedded-smoke.spec.tsnpx playwright test e2e/smoke --project=chromium
npx playwright test e2e/smoke --project=firefox
npx playwright test e2e/smoke --project=webkitnpx playwright test e2e/smoke --debugnpx playwright test e2e/smoke --uie2e/
├── smoke/ # Smoke tests (full E2E with Iterable)
│ ├── commerce-smoke.spec.ts
│ ├── events-smoke.spec.ts
│ ├── users-smoke.spec.ts
│ ├── inapp-smoke.spec.ts
│ └── embedded-smoke.spec.ts
├── page-objects/ # Page Object Model
│ ├── BasePage.ts
│ ├── components/
│ │ └── LoginForm.ts
│ └── pages/
│ ├── CommercePage.ts
│ ├── EventsPage.ts
│ ├── UsersPage.ts
│ ├── InAppPage.ts
│ └── EmbeddedMsgsPage.ts
├── authentication.spec.ts # Auth tests
├── uua-testing.spec.ts # Unknown User Activation tests
└── README.md # This file
- ✅ Full E2E: Tests against actual Iterable production APIs
- ✅ Critical Paths: Verifies core SDK functionality works end-to-end
- ✅ Real Data: Uses real Iterable campaigns and test user
⚠️ Dependency: Requires Iterable platform setup and network connectivity
All smoke tests use: websdk-playwright-test@iterable.com
This is controlled by the LOGIN_EMAIL environment variable in .env.
- Use Page Objects: All UI interactions should go through page objects
- Use
data-qa-*attributes: For reliable element selection - Handle Async Properly: Always await SDK calls and use proper Playwright assertions
- Add Descriptive Test Names: Test names should clearly describe what's being tested
- Group Related Tests: Use
test.describe()to organize tests by feature
- Create a new test file in
smoke/directory - Import required page objects
- Follow existing patterns for setup/teardown
- Ensure tests use
websdk-playwright-test@iterable.comas the test user
- Verify
.envfile has correctAPI_KEYandJWT_SECRET - Ensure JWT generator endpoint is accessible
- Check that
websdk-playwright-test@iterable.comexists in Iterable
- Verify dev server is running at http://localhost:8080
- Check network connectivity to Iterable APIs
- Increase timeout in
playwright.config.tsif needed
- Verify campaigns are set up in Iterable platform
- Check that campaigns target
websdk-playwright-test@iterable.com - See
IMPLEMENTATION_GUIDE.mdfor campaign setup
IMPLEMENTATION_GUIDE.md: Detailed setup instructions for Iterable platformTEST_STRATEGY.md: Overall testing strategy and architectureQUICK_START.md: Quick start guideCHANGES.md: Changelog of test suite changes