create-pw-core 0.0.5 → 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,12 +1,12 @@
1
1
  {
2
2
  "name": "pw-core-demo",
3
- "version": "1.0.0",
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",
7
7
  "test:headed": "playwright test --headed",
8
- "test:headless": "playwright test",
9
- "test:report": "playwright show-report"
8
+ "test:report": "playwright show-report",
9
+ "test:ui": "playwright test --ui"
10
10
  },
11
11
  "author": {
12
12
  "name": "Shanmuka Chandra Teja Anem",
@@ -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": "^0.0.5",
20
+ "pw-core": "^1.2.0",
21
21
  "typescript": "^6.0.3"
22
22
  }
23
23
  }
@@ -3,7 +3,7 @@ import { env } from '@utils/env';
3
3
 
4
4
  export default defineConfig({
5
5
  testDir: './src/tests',
6
- timeout: 10000,
6
+ timeout: 30000,
7
7
  expect: {
8
8
  timeout: 5000,
9
9
  },
@@ -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
  });
@@ -12,6 +12,7 @@ scenario('End-to-End User Flow on QECore App with Page Object Flows', async ({
12
12
  }) => {
13
13
  // 1. Login (automatic page usage)
14
14
  await loginPage.goto();
15
+ await loginPage.waitForLoadState('networkidle');
15
16
 
16
17
  // Verify title and page element states
17
18
  await loginPage.verifyTitle(/PW-Core/);
@@ -31,8 +32,8 @@ scenario('End-to-End User Flow on QECore App with Page Object Flows', async ({
31
32
  // Verify elements are not present initially using verifyHidden
32
33
  await projectsPage.verifyHidden('formTitle');
33
34
 
34
- await projectsPage.createProject('Demo Project', 'A project created via pw-core automation.');
35
- await projectsPage.verifyProjectInTable('Demo Project');
35
+ await projectsPage.createProject('Demo Project', 'A project created via pw-core automation');
36
+ await projectsPage.verifyProjectInTable('Demo Projecter');
36
37
 
37
38
  // 3. Create a Task (automatic page usage, creating Table component inline)
38
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
+
@@ -4,6 +4,7 @@ scenario.describe.serial('Worker Page State Reuse Suite', () => {
4
4
  // Scenario 1: Setup state inside the workerPage
5
5
  scenario('Test 1: Navigate and transition page state on workerPage', async ({ workerLoginPage: lp, workerDashboardPage: dp }) => {
6
6
  await lp.goto();
7
+ await lp.waitForLoadState('networkidle');
7
8
  await lp.verifyURL();
8
9
  await lp.verify('defaultUserLogin');
9
10
 
@@ -2,7 +2,7 @@ import dotenv from 'dotenv';
2
2
  import path from 'path';
3
3
 
4
4
  // Load env configuration
5
- dotenv.config({ path: path.resolve('.env') });
5
+ dotenv.config({ path: path.resolve('.env'), quiet: true });
6
6
 
7
7
  export const ENV = {
8
8
  url: process.env.URL || 'https://qecore.github.io',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pw-core",
3
- "version": "0.0.5",
3
+ "version": "1.2.0",
4
4
  "description": "Initialize a pw-core test suite in a project",
5
5
  "bin": {
6
6
  "create-pw-core": "dist/index.js"