cypress-playwright-data-gen 1.0.9 → 1.0.10
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.
- package/README.md +12 -14
- package/package.json +1 -1
package/README.md
CHANGED
@@ -19,11 +19,8 @@ import 'cypress-playwright-data-gen/cypress/commands';
|
|
19
19
|
|
20
20
|
|
21
21
|
Then you can use the custom commands anywhere in your tests:
|
22
|
+
Just an example — OrangeHRM doesn’t have public signup, so let’s imagine we were testing a form or registration flow:
|
22
23
|
|
23
|
-
/**
|
24
|
-
* Just an example — OrangeHRM doesn’t have public signup,
|
25
|
-
* so let’s imagine we were testing a form or registration flow:
|
26
|
-
*/
|
27
24
|
it('uses generated user data for a signup-style test', () => {
|
28
25
|
cy.generateUser().then((user) => {
|
29
26
|
cy.visit('https://example.com/register');
|
@@ -36,9 +33,8 @@ it('uses generated user data for a signup-style test', () => {
|
|
36
33
|
});
|
37
34
|
});
|
38
35
|
|
39
|
-
|
40
|
-
|
41
|
-
*/
|
36
|
+
|
37
|
+
|
42
38
|
it('generates card data for payment-related tests', () => {
|
43
39
|
cy.generateCard().then((card) => {
|
44
40
|
cy.log(`Card Number: ${card.number}`);
|
@@ -50,6 +46,9 @@ it('generates card data for payment-related tests', () => {
|
|
50
46
|
|
51
47
|
##############################################################################
|
52
48
|
|
49
|
+
|
50
|
+
|
51
|
+
|
53
52
|
🧪 Usage In Playwright
|
54
53
|
|
55
54
|
import { generateUser, generateCard, generateAddress, generateTransaction, generateInstitution }
|
@@ -61,10 +60,8 @@ Then you can use them anywhere in your Playwright tests:
|
|
61
60
|
import { test, expect } from '@playwright/test';
|
62
61
|
import { generateUser, generateCard } from 'cypress-playwright-data-gen/playwright/utils';
|
63
62
|
|
64
|
-
|
65
|
-
|
66
|
-
* so let’s imagine we were testing a form or registration flow:
|
67
|
-
*/
|
63
|
+
Just an example — OrangeHRM doesn’t have public signup, so let’s imagine we were testing a form or registration flow:
|
64
|
+
|
68
65
|
test('uses generated user data for a signup-style test', async ({ page }) => {
|
69
66
|
const user = generateUser();
|
70
67
|
await page.goto('https://example.com/register');
|
@@ -76,9 +73,8 @@ test('uses generated user data for a signup-style test', async ({ page }) => {
|
|
76
73
|
console.log(`Generated user: ${user.firstName} ${user.lastName}, email: ${user.email}`);
|
77
74
|
});
|
78
75
|
|
79
|
-
|
80
|
-
|
81
|
-
*/
|
76
|
+
|
77
|
+
|
82
78
|
test('generates card data for payment-related tests', async () => {
|
83
79
|
const card = generateCard();
|
84
80
|
console.log(`Card Number: ${card.number}`);
|
@@ -91,6 +87,8 @@ test('generates card data for payment-related tests', async () => {
|
|
91
87
|
##############################################################################
|
92
88
|
|
93
89
|
|
90
|
+
|
91
|
+
|
94
92
|
## 🧩 Available Generators
|
95
93
|
| Generator | Attributes |
|
96
94
|
|------------|-------------|
|
package/package.json
CHANGED