simple-playwright-framework 0.0.14 β†’ 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +160 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,160 @@
1
+ πŸ“₯ Single‑click Copyable README
2
+ markdown
3
+ # simple-playwright-framework
4
+
5
+ ![npm version](https://img.shields.io/npm/v/simple-playwright-framework)
6
+ ![npm downloads](https://img.shields.io/npm/dm/simple-playwright-framework)
7
+ ![license](https://img.shields.io/npm/l/simple-playwright-framework)
8
+ ![node](https://img.shields.io/node/v/simple-playwright-framework)
9
+ ![playwright](https://img.shields.io/badge/Playwright-supported-45ba63?logo=playwright)
10
+ ![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen)
11
+
12
+ A lightweight, modular automation framework built on top of **Microsoft Playwright**.
13
+ It helps teams quickly bootstrap scalable UI and API test automation projects with **clean architecture, reusable fixtures, and ergonomic onboarding**.
14
+
15
+ Repository: [GitHub](https://github.com/Udayakumarg/simpleplaywrightframework)
16
+
17
+ ---
18
+
19
+ ## ✨ Key Features
20
+
21
+ - **Playwright-powered automation** for browsers and APIs
22
+ - **Custom fixtures** for authentication, storage state, and reusable contexts
23
+ - **Scenario loader** for environment‑driven test data (JSON or API/DB integration)
24
+ - **Provider registry** for flexible login flows (username, email, or custom auth)
25
+ - **Environment-aware configuration** with safe defaults (`prod` fallback)
26
+ - **Reusable helpers** for file upload/download, iframe handling, and API clients
27
+ - **Modern reporting** with Playwright HTML, Allure, and TestRail integration
28
+ - **CLI scaffolding** to generate demo projects with recommended structure
29
+ - **CI/CD ready** with parallel safety and isolated test state
30
+ - **Extensible design**: plug in your own providers, loaders, or reporters
31
+
32
+ ---
33
+
34
+ ## πŸ“¦ Installation
35
+
36
+ ### 1. Install Playwright
37
+ ```bash
38
+ npm install --save-dev @playwright/test playwright
39
+ 2. Install the framework
40
+ bash
41
+ npm install simple-playwright-framework
42
+ πŸš€ Create a Demo Project
43
+ Use the CLI to scaffold a ready‑to‑run project:
44
+
45
+ bash
46
+ npx init-demo-project
47
+ This generates a demo project with fixtures, config, and sample tests.
48
+
49
+ ▢️ Run Tests
50
+ Navigate into the generated project:
51
+
52
+ bash
53
+ cd demo-project
54
+ npx playwright test
55
+ Run with Playwright UI runner:
56
+
57
+ bash
58
+ npx playwright test --ui
59
+ πŸ§ͺ Example Test
60
+ ts
61
+ import { test, expect } from '@playwright/test';
62
+ import { scenarioLoader } from 'simple-playwright-framework';
63
+
64
+ test('login works', async ({ page }) => {
65
+ const data = scenarioLoader(__filename).get("validLogin");
66
+ await page.goto(data.baseUrl);
67
+ await page.fill('#username', data.username);
68
+ await page.fill('#password', data.password);
69
+ await page.click('#login');
70
+ await expect(page).toHaveURL(/dashboard/);
71
+ });
72
+ πŸ“‚ Project Structure
73
+ Example demo project:
74
+
75
+ Code
76
+ demo-project
77
+ β”‚
78
+ β”œβ”€β”€ tests
79
+ β”‚ └── login.spec.ts
80
+ β”‚
81
+ β”œβ”€β”€ pages
82
+ β”‚ └── login.page.ts
83
+ β”‚
84
+ β”œβ”€β”€ utils
85
+ β”‚ └── apiClient.ts
86
+ β”‚
87
+ β”œβ”€β”€ config
88
+ β”‚ └── environments.ts
89
+ β”‚
90
+ β”œβ”€β”€ auth
91
+ β”‚ └── storageState.json
92
+ β”‚
93
+ └── playwright.config.ts
94
+ 🌍 Environment Configuration
95
+ ts
96
+ export const environments = {
97
+ dev: { baseUrl: "https://dev.example.com" },
98
+ qa: { baseUrl: "https://qa.example.com" },
99
+ prod:{ baseUrl: "https://prod.example.com" }
100
+ };
101
+ Run against different environments without changing test logic.
102
+
103
+ πŸ“Š Reporting
104
+ Supports:
105
+
106
+ Playwright HTML reports
107
+
108
+ Allure reports
109
+
110
+ TestRail integration
111
+
112
+ Generate Playwright report:
113
+
114
+ bash
115
+ npx playwright show-report
116
+ πŸ›  Challenges & Solutions
117
+ Compiled JS confusion β†’ moved output to dist and enforced root‑level exports
118
+
119
+ Demo projects bypassing fixtures β†’ documented imports from framework only
120
+
121
+ Scenario injection limits β†’ iterated scenarios in test bodies, reporting adapted
122
+
123
+ Environment defaults missing β†’ added safe fallback (prod)
124
+
125
+ Dependency resolution issues β†’ onboarding scripts install required packages
126
+
127
+ Report formatting limitations β†’ modernized with inline CSS and branded colors
128
+
129
+ Auth provider rigidity β†’ introduced provider registry for flexible login flows
130
+
131
+ Parallel safety concerns β†’ kept state test‑scoped, avoided global mutation
132
+
133
+ Demo project scaffolding risks β†’ added warnings and safe file writes
134
+
135
+ 🀝 Contributing
136
+ Contributions are welcome.
137
+
138
+ Fork the repository
139
+
140
+ Create a feature branch
141
+
142
+ Commit your changes
143
+
144
+ Submit a pull request
145
+
146
+ Please ensure that code changes include appropriate tests and follow existing coding conventions.
147
+
148
+ πŸ“œ License
149
+ MIT License
150
+
151
+ πŸ‘€ Author
152
+ Developed by Udayakumar
153
+ GitHub: https://github.com/Udayakumarg
154
+
155
+ Code
156
+
157
+ ---
158
+
159
+ πŸ‘‰ Just copy everything above into a file named `README.md` in your repo.
160
+ If you’d like, I can also prepare a **shorter npm landing page version** (featur
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-playwright-framework",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "A modular Playwright framework with fixtures, loaders, and demo scaffolding.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",