SShortSingh.
Back to feed

Step-by-Step Guide to Building a Playwright BDD Test Framework from Scratch

0
·2 views

A structured guide outlines how to set up a hybrid BDD test automation framework using Playwright, Cucumber, and JavaScript. The setup involves installing dependencies and creating a core folder hierarchy covering feature files, step definitions, page objects, utilities, and reports. Key configuration files include package.json, playwright.config.js, and cucumber.config.js, alongside page models and hook scripts. Test data is primarily managed through JSON files, with optional Excel support for tabular inputs, and environment variables are stored in a local .env file. Separate npm commands allow developers to run API, UI, or full test suites independently.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Docker advanced guide: multi-stage builds cut image size and boost CI/CD security

A technical guide published on DEV Community concludes a Docker series by addressing the gap between local development and production-ready containers. The article explains how multi-stage builds allow Dockerfiles to use multiple FROM blocks, so only compiled output and runtime dependencies reach the final image — reducing size from over 1 GB to under 150 MB in typical cases. For compiled languages like Go, the final image can be built on a scratch base, containing only a static binary with no shell or utilities, significantly shrinking the attack surface. The guide also highlights the security risk of containers running as root by default, advocating for explicit non-root user configuration in Dockerfiles. These practices are presented as foundational steps before integrating Docker images into a CI/CD pipeline.

0
ProgrammingDEV Community ·

Practical Strategies to Reduce Flaky Tests in CI/CD Pipelines

Flaky tests undermine confidence in CI/CD pipelines, slow down releases, and drain engineering resources. Experts recommend keeping auto-retries to a maximum of one or two attempts and using them only for transient network issues, while ensuring every test is stateless and cleans up shared resources. Stable selectors such as data-test-id attributes are preferred over fragile CSS or XPath locators, and parallelism should start conservatively to prevent resource exhaustion on runner nodes. Teams are advised to define flakiness thresholds over a rolling seven-day window, escalating to release blocks when intermittent failure rates exceed five percent. Tracking retry counts and flaky test flags through dashboards and reporting tools like Allure helps teams catch degrading tests before they impact deployments.

0
ProgrammingDEV Community ·

How to Structure a Playwright BDD Framework for Web, API, and Salesforce Testing

A well-organized folder structure is essential for scaling test automation across multiple platforms and teams. A recommended Playwright BDD framework separates concerns into distinct directories for features, step definitions, page objects, utilities, and test data. The layout supports Web UI, API, and Salesforce test automation while keeping components decoupled and easy to maintain. Configuration is managed through dedicated files such as playwright.config.js and cucumber.config.js, alongside a central package.json. Developers are advised to exclude node_modules, generated reports, logs, and dynamically created Excel files from version control via a .gitignore file.

0
ProgrammingDEV Community ·

How a Three-Pillar Risk Framework Can Strengthen Corporate Cybersecurity

A security professional has outlined a custom corporate cybersecurity framework built around three core pillars: application security and hardening, perimeter defense, and cross-departmental communication. The framework integrates SAST scanners directly into development pipelines, with findings triaged, prioritized, and assigned through a centralized platform. A four-dimensional context model — covering exposure, data sensitivity, existing countermeasures, and active exploitation intelligence — guides vulnerability prioritization rather than relying solely on CVSS scores. Server hardening is treated as a continuous process, with automated weekly audits and alerts triggered when security scores degrade by more than five points week-over-week. The approach emphasizes reducing alert noise and building developer trust in security tooling, with every suppression rule and remediation change documented for full traceability.