playwright-test-framework-advanced
v1.0.0
Published
A comprehensive Playwright testing framework with logging and reporting
Maintainers
Readme
Playwright Test Framework
A comprehensive Playwright testing framework with logging, reporting, and utilities for building robust test automation.
Features
- 🎭 Playwright Integration - Full Playwright support with browser management
- 📝 Winston Logging - Structured logging with multiple transports
- 📊 Allure Reporting - Beautiful test reports with screenshots and videos
- 🏗️ Page Object Model - Base page class with common methods
- ⚙️ Configuration Management - Flexible test configuration
- 🔧 Test Utilities - Data generation and test helpers
- 📱 Multi-browser Support - Chrome, Firefox, Safari, Mobile
Installation
npm install playwright-test-framework-advancedQuick Start
import { TestFramework, BasePage, Logger } from 'playwright-test-framework-advanced';
// Setup framework
const framework = new TestFramework({
browserName: 'chromium',
headless: false
});
await framework.setup();
const page = framework.getPage();
// Create page object
class LoginPage extends BasePage {
constructor(page) {
super(page, 'https://example.com/login');
}
async login(username, password) {
await this.fill('#username', username);
await this.fill('#password', password);
await this.click('#login-button');
}
}
// Use in tests
const loginPage = new LoginPage(page);
await loginPage.navigate();
await loginPage.login('user', 'pass');
await framework.teardown();Configuration
import { TestConfig } from 'playwright-test-framework-advanced';
const config = new TestConfig({
browserName: 'chromium',
headless: true,
viewport: { width: 1920, height: 1080 },
timeout: 30000,
recordVideo: true
});Logging
import { Logger } from 'playwright-test-framework-advanced';
Logger.info('Test started');
Logger.error('Test failed', { error: 'details' });
Logger.debug('Debug information');Test Data
import { TestData } from 'playwright-test-framework-advanced';
// Generate test data
const email = TestData.generateRandomEmail();
const randomString = TestData.generateRandomString(10);
// Load from file
const userData = TestData.loadFromFile('./data/users.json');Scripts
npm test- Run testsnpm run report- Generate Allure report
License
MIT
