Creating SmartTests
Introduction to TestChimp Web IDE

The TestChimp Web IDE provides a powerful interface for creating and managing SmartTests. It offers:
- Code editor: Full Playwright script editing with syntax highlighting and IntelliSense
- Test execution: Run tests directly from the IDE with multiple execution modes
- Test organization: Organize tests into folders following standard Playwright structure
- GitHub sync: Keep your tests synchronized with your codebase
Standard Playwright Folder Structure
The TestChimp Web IDE follows the same folder structure as standard Playwright projects, making it easy to sync with your codebase:
tests/
├── fixtures/ # Artifacts (file uploads, etc.)
├── pages/ # Page Object Models (POMs)
└── e2e/ # End-to-end test files
playwright.config.js # Playwright configuration file
This structure allows you to:
- Easily sync with your codebase: The folder structure matches standard Playwright projects, so you can seamlessly sync tests between TestChimp and your repository
- Organize tests logically: Use
fixturesfor artifacts (file uploads),pagesfor Page Object Models, ande2efor your test files - Maintain consistency: The
playwright.config.jsfile at the root allows you to configure test settings, base URLs, and other Playwright options
Note: TestChimp currently supports artifacts (file uploads) in the fixtures folder, but general test fixtures (custom test setup/teardown) are not currently supported.
Authoring Methods
There are three ways to create SmartTests in the Web IDE:
1. Create from Chrome Extension
The Chrome extension allows you to record your interactions and create SmartTests:
- Install the Chrome extension and sign in with your TestChimp account
- Navigate to your test site in the browser
- Open the Chrome extension
- Go to the Record tab
- Click "Start Step Capture"
- Perform your test steps by navigating through your app
- Click "End Step Capture" - which will create the test
- The extension generates Playwright code that you can review and refine in the Web IDE
2. Create from Scenario Description
You can create SmartTests by describing scenarios in plain English:
- Navigate to the SmartTests section in the Web IDE
- Right-click on a folder (or use the context menu) and select "New Test From Scenario..."
- Describe the scenario you want to test in natural language
- The TestChimp agent will execute the given scenario, and along the way capture the actions as Playwright steps to generate the script
Example: "As a user, I want to log in to the application, navigate to the dashboard, and verify that my profile information is displayed correctly."
When you provide a scenario description, TestChimp's agent will:
- Navigate through your application following the scenario
- Capture each action (clicks, form fills, navigation, etc.) as it executes
- Generate a SmartTest script with the corresponding Playwright code
- Create the test file in your selected folder
3. Create Blank Test and Paste Existing Script
If you already have Playwright tests, you can create a blank test and paste your existing script:
- Navigate to the SmartTests section in the Web IDE
- Right-click on a folder (or use the context menu) and select "New Blank Test"
- Enter a name for your test
- A blank test template will be created with the basic Playwright structure
- Paste your existing Playwright script into the editor
- Save the test
This method is perfect for:
- Migrating existing Playwright tests to TestChimp
- Copying tests from other projects
- Starting with a template and customizing it
Playwright Best Practices
When creating SmartTests, you can utilize all the abstractions / support files of playwright such as hooks, pages, suties, fixtures etc.:
Page Object Models (POMs)
Organize your page interactions using Page Object Models:
class LoginPage {
constructor(private page: Page) {}
async goto() {
await this.page.goto('https://example.com/login');
}
async fillUsername(username: string) {
await this.page.fill('#username', username);
}
async clickLogin() {
await this.page.click('button[type="submit"]');
}
}
Artifacts
TestChimp currently supports artifacts for file uploads and similar use cases. Note that general test fixtures (custom test setup/teardown) are not currently supported.
For file uploads, you can use artifacts:
// Upload a file using an artifact
await page.setInputFiles('input[type="file"]', 'path/to/file.pdf');
Config Files
Configure your tests using playwright.config.js or playwright.config.ts:
import { defineConfig } from '@playwright/test';
export default defineConfig({
testDir: './tests',
use: {
baseURL: 'https://example.com',
screenshot: 'only-on-failure',
},
});
Hooks
Use hooks for setup and teardown:
test.beforeEach(async ({ page }) => {
// Setup before each test
await page.goto('https://example.com');
});
test.afterEach(async ({ page }) => {
// Cleanup after each test
await page.close();
});
These patterns help create maintainable, reusable SmartTests that work seamlessly with TestChimp's agent capabilities.