cypress-playwright-data-gen 1.0.10 → 1.0.11

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 +33 -19
  2. package/package.json +4 -2
package/README.md CHANGED
@@ -1,26 +1,39 @@
1
- cypress-playwright-data-gen 🥰
1
+ # cypress-playwright-data-gen
2
+
2
3
  A lightweight fake data generator for Cypress and Playwright tests — create realistic test data like users, cards, institutions, and more in seconds!
3
4
 
4
- 🚀 Installation steps:
5
+
6
+ [![NPM](https://nodei.co/npm/cypress-playwright-data-gen.svg)](https://nodei.co/npm/cypress-playwright-data-gen/)
7
+
8
+
9
+ ## Installation steps:
5
10
  Install using npm or yarn:
6
11
 
12
+ ```bash
7
13
  npm install cypress-playwright-data-gen
14
+ ```
8
15
 
9
- or
10
16
 
17
+ ```bash
11
18
  yarn add cypress-playwright-data-gen
19
+ ```
12
20
 
13
- ##############################################################################
14
21
 
15
- 🧪 Usage In Cypress
22
+ ## Usage In Cypress
16
23
 
17
- Add the commands in your cypress/support/e2e.js (or commands.js):
24
+ - Importing - Add the commands in your cypress/support/e2e.js (or commands.js):
25
+
26
+ ```javascript
18
27
  import 'cypress-playwright-data-gen/cypress/commands';
28
+ ```
29
+
19
30
 
31
+ ### Then you can use the custom commands anywhere in your tests:
20
32
 
21
- Then you can use the custom commands anywhere in your tests:
22
33
  Just an example — OrangeHRM doesn’t have public signup, so let’s imagine we were testing a form or registration flow:
23
34
 
35
+ ```javascript
36
+ //Generate user data (Firstname, Lastname, Email, etc)
24
37
  it('uses generated user data for a signup-style test', () => {
25
38
  cy.generateUser().then((user) => {
26
39
  cy.visit('https://example.com/register');
@@ -33,8 +46,7 @@ it('uses generated user data for a signup-style test', () => {
33
46
  });
34
47
  });
35
48
 
36
-
37
-
49
+ //Generate card data (Card number, Cvv, Expiry date)
38
50
  it('generates card data for payment-related tests', () => {
39
51
  cy.generateCard().then((card) => {
40
52
  cy.log(`Card Number: ${card.number}`);
@@ -43,25 +55,29 @@ it('generates card data for payment-related tests', () => {
43
55
  });
44
56
  });
45
57
 
58
+ ```
46
59
 
47
- ##############################################################################
48
60
 
49
61
 
62
+ ## Usage In Playwright
50
63
 
64
+ - Importing - Import the generators directly and use them in your Playwright tests:
51
65
 
52
- 🧪 Usage In Playwright
53
-
66
+ ```javascript
54
67
  import { generateUser, generateCard, generateAddress, generateTransaction, generateInstitution }
55
68
  from 'cypress-playwright-data-gen/playwright/utils';
69
+ ```
70
+
56
71
 
72
+ ### Then you can use them anywhere in your Playwright tests:
57
73
 
58
- Then you can use them anywhere in your Playwright tests:
74
+ Just an example OrangeHRM doesn’t have public signup, so let’s imagine we were testing a form or registration flow:
59
75
 
76
+ ```javascript
60
77
  import { test, expect } from '@playwright/test';
61
78
  import { generateUser, generateCard } from 'cypress-playwright-data-gen/playwright/utils';
62
79
 
63
- Just an example OrangeHRM doesn’t have public signup, so let’s imagine we were testing a form or registration flow:
64
-
80
+ //Generate user data (Firstname, Lastname, Email, etc)
65
81
  test('uses generated user data for a signup-style test', async ({ page }) => {
66
82
  const user = generateUser();
67
83
  await page.goto('https://example.com/register');
@@ -74,7 +90,7 @@ test('uses generated user data for a signup-style test', async ({ page }) => {
74
90
  });
75
91
 
76
92
 
77
-
93
+ //Generate card data (Card number, Cvv, Expiry date)
78
94
  test('generates card data for payment-related tests', async () => {
79
95
  const card = generateCard();
80
96
  console.log(`Card Number: ${card.number}`);
@@ -82,9 +98,7 @@ test('generates card data for payment-related tests', async () => {
82
98
  console.log(`CVV: ${card.cvv}`);
83
99
  });
84
100
 
85
-
86
-
87
- ##############################################################################
101
+ ```
88
102
 
89
103
 
90
104
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cypress-playwright-data-gen",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "A simple Cypress & Playwright plugin for generating realistic test data using Faker.js.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,7 +36,9 @@
36
36
  "faker",
37
37
  "test-data",
38
38
  "automation",
39
- "qa"
39
+ "qa",
40
+ "software testing",
41
+ "generator"
40
42
  ],
41
43
  "author": "Goodness Okoye",
42
44
  "license": "MIT",