@orieken/saturday-cucumber
v0.1.0
Published
Cucumber integration for the Saturday automation framework.
Readme
@orieken/saturday-cucumber
Cucumber.js integration for the Saturday automation framework. This package simplifies the setup of Playwright-based BDD tests by providing pre-configured Hooks, World, and browser management.
Features
- Custom World: Provides direct access to Playwright
page,browser, andcontextin your step definitions. - Lifecycle Hooks: Automatic browser launch, context creation, and video/trace recording managed via
BeforeAll/AfterAll/Before/Afterhooks. - Report Attachments: Automatically attaches screenshots and videos to Cucumber reports on failure.
Installation
pnpm add @orieken/saturday-cucumberUsage
1. Initialize Hooks
In your features/support/init.ts (or similar setup file):
import { installSaturdayHooks } from '@orieken/saturday-cucumber';
// Installs Before/After hooks for browser management
installSaturdayHooks();2. Use Custom World in Steps
import { Given } from '@cucumber/cucumber';
import { CustomWorld } from '@orieken/saturday-cucumber';
Given('I open the homepage', async function(this: CustomWorld) {
// Access Playwright Page object directly
await this.page.goto('https://example.com');
});