@muritavo/playwright-toolkit
v1.0.5
Published
Playwright testing toolkit for Firebase emulator integration
Downloads
367
Readme
Playwright Toolkit
A testing toolkit for Playwright with Firebase emulator integration.
Features
- Firebase Emulator support (Firestore, Auth, Storage)
- Test environment setup and teardown
- Administrative operations (user management, data clearing)
Installation
npm install @muritavo/playwright-toolkitUsage
Basic Setup
import { setEmulatorConfig } from '@muritavo/playwright-toolkit';
// Configure emulator in your test setup
const firebaseConfig = require('../firebase.json');
setEmulatorConfig(firebaseConfig);Running Tests
import { startEmulator, killEmulator, setupEmulator } from '@muritavo/playwright-toolkit';
test('my test', async ({ page }) => {
await startEmulator('my-project');
await setupEmulator(async (firestore, storage, admin) => {
// Your test code here
}, 'my-project');
await killEmulator();
});API Reference
setEmulatorConfig(config)
Sets the Firebase emulator configuration.
startEmulator(projectName, databaseToImport?, tenantId?, suiteId?, exportDataOnExit?, only?)
Starts the Firebase emulator for testing.
killEmulator()
Stops the running emulator instance.
setupEmulator(callback, projectId, storageBucket?, authTenantId?)
Sets up the emulator with security rules disabled for testing.
License
MIT
