create-pw-core 1.1.0 → 1.2.0
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pw-core-demo",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Demo and example test suite showcasing the usage of pw-core in Playwright.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "playwright test",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@playwright/test": "^1.61.0",
|
|
18
18
|
"@types/node": "^20.11.0",
|
|
19
19
|
"dotenv": "^16.4.5",
|
|
20
|
-
"pw-core": "^1.
|
|
20
|
+
"pw-core": "^1.2.0",
|
|
21
21
|
"typescript": "^6.0.3"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -6,7 +6,10 @@ export const registry = createPageRegistry({
|
|
|
6
6
|
url: '/login',
|
|
7
7
|
testIds: {
|
|
8
8
|
defaultUserLogin: 'login-default-user',
|
|
9
|
-
|
|
9
|
+
email: 'email-input',
|
|
10
|
+
password: 'password-input',
|
|
11
|
+
submit: 'login-submit',
|
|
12
|
+
}
|
|
10
13
|
},
|
|
11
14
|
dashboardPage: {
|
|
12
15
|
url: '/app',
|
|
@@ -18,20 +21,22 @@ export const registry = createPageRegistry({
|
|
|
18
21
|
url: '/app/projects',
|
|
19
22
|
testIds: {
|
|
20
23
|
newProject: 'new-project-button',
|
|
21
|
-
formTitle: 'form-title',
|
|
22
|
-
formDescription: 'form-description',
|
|
23
|
-
formSave: 'form-save',
|
|
24
24
|
table: 'projects-table',
|
|
25
|
-
|
|
25
|
+
"form{item}": {
|
|
26
|
+
item: ['title', 'description', 'save'],
|
|
27
|
+
testId: "form-item"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
26
30
|
},
|
|
27
31
|
tasksPage: {
|
|
28
32
|
url: '/app/tasks',
|
|
29
33
|
testIds: {
|
|
30
34
|
newTask: 'new-task-button',
|
|
31
|
-
formTitle: 'form-title',
|
|
32
|
-
formDescription: 'form-description',
|
|
33
|
-
formSave: 'form-save',
|
|
34
35
|
table: 'tasks-table',
|
|
36
|
+
"form{item}": {
|
|
37
|
+
item: ['title', 'description', 'save'],
|
|
38
|
+
testId: "form-item"
|
|
39
|
+
}
|
|
35
40
|
},
|
|
36
41
|
},
|
|
37
42
|
sidebar: {
|
|
@@ -46,4 +51,23 @@ export const registry = createPageRegistry({
|
|
|
46
51
|
logoutBtn: 'ws-option-logout',
|
|
47
52
|
},
|
|
48
53
|
},
|
|
54
|
+
playground: {
|
|
55
|
+
url: '/playground',
|
|
56
|
+
testIds: {
|
|
57
|
+
// Dynamic testIds: Keys converted to camelCase (e.g. activeLineChart), values kebab-cased (e.g. "active-line-chart")
|
|
58
|
+
"{status}{id}Chart": {
|
|
59
|
+
id: ['line', 'bar'],
|
|
60
|
+
status: ['active', 'inactive'],
|
|
61
|
+
testId: "status-id-chart"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
selectors: {
|
|
65
|
+
card: ".skeu-card",
|
|
66
|
+
// Dynamic selectors: Keys camelCased (e.g. safe, danger), values preserve original casing (e.g. "#Safe", "#Danger")
|
|
67
|
+
"{status}": {
|
|
68
|
+
status: ['Safe', 'Danger'],
|
|
69
|
+
selector: "#status"
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
}
|
|
49
73
|
});
|
|
@@ -32,8 +32,8 @@ scenario('End-to-End User Flow on QECore App with Page Object Flows', async ({
|
|
|
32
32
|
// Verify elements are not present initially using verifyHidden
|
|
33
33
|
await projectsPage.verifyHidden('formTitle');
|
|
34
34
|
|
|
35
|
-
await projectsPage.createProject('Demo Project', 'A project created via pw-core automation
|
|
36
|
-
await projectsPage.verifyProjectInTable('Demo
|
|
35
|
+
await projectsPage.createProject('Demo Project', 'A project created via pw-core automation');
|
|
36
|
+
await projectsPage.verifyProjectInTable('Demo Projecter');
|
|
37
37
|
|
|
38
38
|
// 3. Create a Task (automatic page usage, creating Table component inline)
|
|
39
39
|
await sidebar.click('itemTasks');
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { scenario } from '@utils/fixtures';
|
|
2
|
+
|
|
3
|
+
scenario('Verify password masking in step descriptions during login flow', async ({ loginPage, dashboardPage }) => {
|
|
4
|
+
await loginPage.page.goto("http://localhost:5173/login");
|
|
5
|
+
|
|
6
|
+
// Fill email (should not be masked in logs/reports)
|
|
7
|
+
await loginPage.fill('email', 'default@mail.com');
|
|
8
|
+
|
|
9
|
+
// Fill password (should be masked in logs/reports)
|
|
10
|
+
await loginPage.fill('password', 'default');
|
|
11
|
+
|
|
12
|
+
// Click login
|
|
13
|
+
await loginPage.click('submit');
|
|
14
|
+
|
|
15
|
+
// Verify dashboard loaded
|
|
16
|
+
await dashboardPage.verifyURL();
|
|
17
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { scenario } from '@utils/fixtures';
|
|
2
|
+
|
|
3
|
+
scenario('Verify the playground - chart elements are visible', async ({ playground, dashboardPage }) => {
|
|
4
|
+
// Navigation and tab setup
|
|
5
|
+
// await playground.goto();
|
|
6
|
+
await playground.page.goto("http://localhost:5173/playground");
|
|
7
|
+
|
|
8
|
+
await playground.waitForLoadState('networkidle');
|
|
9
|
+
|
|
10
|
+
// Click on the "Charts" tab to bring the chart components into view
|
|
11
|
+
await playground.page.getByRole('tab', { name: 'Charts' }).click();
|
|
12
|
+
|
|
13
|
+
// Verify dynamic selectors
|
|
14
|
+
await playground.verify('safe');
|
|
15
|
+
await playground.verify('danger');
|
|
16
|
+
|
|
17
|
+
// Verify by dynamic testIds
|
|
18
|
+
await playground.verify('activeLineChart');
|
|
19
|
+
await playground.verify('inactiveLineChart').toBeDisabled();
|
|
20
|
+
|
|
21
|
+
// Verify by chained locators + dynamic locator
|
|
22
|
+
await playground.verify('card.activeBarChart');
|
|
23
|
+
await playground.verifyDisabled('card.inactiveBarChart')
|
|
24
|
+
await playground.verify('card.safe');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|