LambdaTest Playwright Node SDK
npm install @lambdatest/playwright-node-sdk
The LambdaTest Playwright Node SDK is a powerful tool that enables you to run your Playwright tests on LambdaTest's cloud-based testing platform. This SDK provides seamless integration between your local Playwright test suite and LambdaTest's extensive browser and device infrastructure.
- 🚀 Cloud-based Testing: Run Playwright tests on LambdaTest's cloud infrastructure
- 🌐 Cross-browser Testing: Support for Chrome, Edge, Playwright Firefox, Playwright Webkit, Playwright Chromium.
- 📱 Mobile Testing: Test on real mobile devices.
- 🔧 Easy Configuration: Simple YAML-based configuration
- 🏗️ Tunnel Support: Secure local testing with LambdaTest tunnel
- 🔄 Parallel Execution: Run tests in parallel across multiple browsers
- Node.js
- npm or yarn
- LambdaTest account and credentials
``bash`
npm install @lambdatest/playwright-node-sdk
You can automatically create a lambdatest.yml file with a default template:
`bashCreate default lambdatest.yml
npx playwright-node-sdk init
This will create a configuration file with default configurations for Windows, macOS, and Android platforms.
$3
Create a
lambdatest.yml file in your project root (or edit the one created by init):`yaml
user: "your-lambdatest-username"
accessKey: "your-lambdatest-access-key"
build: "Playwright Test Build"
name: "Playwright Test"
video: true
console: true
network: true
commandLog: true
`$3
Add platform configurations to your
lambdatest.yml:`yaml
user: "your-lambdatest-username"
accessKey: "your-lambdatest-access-key"
build: "Playwright Test Build"
name: "Playwright Test"
video: true
console: true
network: true
commandLog: trueplatforms:
- platform: "windows 10"
browserName: "chrome"
browserVersion: "latest"
- platform: "macos sonoma"
browserName: "chrome"
browserVersion: "latest"
`$3
`bash
npx playwright-node-sdk playwright test
`$3
You can use different configuration files for different environments or test scenarios by setting the
LAMBDATEST_YML_FILE environment variable:`bash
Use a specific configuration file
export LAMBDATEST_YML_FILE="custom-config.yml"
npx playwright-node-sdk playwright test`This allows you to maintain separate configurations for different environments or different test scenarios.
Configuration
$3
The SDK uses a
lambdatest.yml file for configuration. Here's a complete example:`yaml
LambdaTest Credentials
user: "your-lambdatest-username"
accessKey: "your-lambdatest-access-key"Test Configuration
build: "Playwright Test Build"
name: "Playwright Test"
video: true
console: true
network: true
commandLog: truePlatform Configurations
platforms:
- platform: "windows 10"
browserName: "chrome"
browserVersion: "latest"
- platform: "macos sonoma"
browserName: "chrome"
browserVersion: "latest"
Usage
$3
The SDK provides a command-line interface for running tests:
`bash
Initialize configuration file
npx playwright-node-sdk initInitialize with custom filename
npx playwright-node-sdk init my-config.ymlRun Playwright tests
npx playwright-node-sdk playwright testUse specific configuration file via environment variable
export LAMBDATEST_YML_FILE=custom-config.yml
npx playwright-node-sdk playwright test``- Documentation: LambdaTest Documentation
- Community: LambdaTest Community
- Email: support@lambdatest.com
LambdaTest is a cloud based selenium grid infrastructure that can help you run automated cross browser compatibility tests on 2000+ different browser and operating system environments. LambdaTest supports all programming languages and frameworks that are supported with Selenium, and have easy integrations with all popular CI/CD platforms. It's a perfect solution to bring your selenium automation testing to cloud based infrastructure that not only helps you increase your test coverage over multiple desktop and mobile browsers, but also allows you to cut down your test execution time by running tests on parallel.