@trevordsouzabrite/test-package 1.0.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.
Files changed (69) hide show
  1. package/.claude/agents/playwright-test-generator.md +85 -0
  2. package/.claude/agents/playwright-test-healer.md +45 -0
  3. package/.claude/agents/playwright-test-planner.md +52 -0
  4. package/.claude/prompts/playwright-test-coverage.md +31 -0
  5. package/.claude/prompts/playwright-test-generate.md +12 -0
  6. package/.claude/prompts/playwright-test-heal.md +6 -0
  7. package/.claude/prompts/playwright-test-plan.md +12 -0
  8. package/.claude/settings.local.json +31 -0
  9. package/.github/agents/playwright-test-generator.agent.md +113 -0
  10. package/.github/agents/playwright-test-healer.agent.md +70 -0
  11. package/.github/agents/playwright-test-planner.agent.md +82 -0
  12. package/.github/prompts/playwright-test-coverage.prompt.md +31 -0
  13. package/.github/prompts/playwright-test-generate.prompt.md +12 -0
  14. package/.github/prompts/playwright-test-heal.prompt.md +6 -0
  15. package/.github/prompts/playwright-test-plan.prompt.md +9 -0
  16. package/.github/workflows/copilot-setup-steps.yml +34 -0
  17. package/.github/workflows/playwright-healer-agent.yml +140 -0
  18. package/.github/workflows/playwright.yml +40 -0
  19. package/.mcp.json +13 -0
  20. package/.vscode/extensions.json +6 -0
  21. package/.vscode/mcp.json +13 -0
  22. package/.vscode/settings.example.json +15 -0
  23. package/bitbucket-pipelines.yml +86 -0
  24. package/lib/WebActions.ts +107 -0
  25. package/package.json +33 -0
  26. package/pageRepository/ApplicantPage.ts +1171 -0
  27. package/pageRepository/CreateApplicationPage.ts +1736 -0
  28. package/playwright/.auth/user.json +0 -0
  29. package/specs/Applicant Create Application Page Test Plan.md +440 -0
  30. package/specs/Applicant Dashboard Page Test Plan.md +74 -0
  31. package/specs/Applicant Forgot Password Page Test Plan.md +112 -0
  32. package/specs/Applicant Help Page Test Plan.md +369 -0
  33. package/specs/Applicant Landing Page Test Plan.md +42 -0
  34. package/specs/Applicant Login Page Test Plan.md +116 -0
  35. package/specs/Applicant My Applications Page Test Plan.md +558 -0
  36. package/specs/Applicant My Medical Coverage Page Test Plan.md +689 -0
  37. package/specs/Applicant Privacy Policy Page Test Plan.md +196 -0
  38. package/specs/Applicant Resources Page Test Plan.md +107 -0
  39. package/specs/Applicant Self Register Page Test Plan.md +190 -0
  40. package/specs/README.md +3 -0
  41. package/test-data/Sample.png +0 -0
  42. package/test-data/createApplication/formData.json +42 -0
  43. package/test-data/createApplication/textMessages.json +52 -0
  44. package/test-data/forgotPassword/email.json +5 -0
  45. package/test-data/forgotPassword/textMessages.json +5 -0
  46. package/test-data/help/textContent.json +48 -0
  47. package/test-data/login/invalidUsernamePassword.json +4 -0
  48. package/test-data/login/textMessages.json +5 -0
  49. package/test-data/privacyPolicy/textContent.json +25 -0
  50. package/test-data/selfRegister/mailingAddressStates.json +21 -0
  51. package/test-data/selfRegister/registrationFieldData.json +13 -0
  52. package/test-data/selfRegister/suffix.json +3 -0
  53. package/test-data/selfRegister/textMessages.json +13 -0
  54. package/test-data/test-data.zip +0 -0
  55. package/tests/ApplicantCreateApplicationPageTest.spec.ts +1452 -0
  56. package/tests/ApplicantDashboardPageTest.spec.ts +74 -0
  57. package/tests/ApplicantForgotPasswordPageTest.spec.ts +88 -0
  58. package/tests/ApplicantHelpPageTest.spec.ts +468 -0
  59. package/tests/ApplicantLandingPageTest.spec.ts +33 -0
  60. package/tests/ApplicantLoginPageTest.spec.ts +117 -0
  61. package/tests/ApplicantMyApplicationsPageTest.spec.ts +516 -0
  62. package/tests/ApplicantMyMedicalCoveragePageTest.spec.ts +470 -0
  63. package/tests/ApplicantPrivacyPolicyPageTest.spec.ts +188 -0
  64. package/tests/ApplicantResourcesPageTest.spec.ts +117 -0
  65. package/tests/ApplicantSelfRegisterPageTest.spec.ts +254 -0
  66. package/tests/auth.setup.ts +42 -0
  67. package/tests/authState.ts +15 -0
  68. package/tests/example.spec.ts +18 -0
  69. package/tests/seed.spec.ts +7 -0
@@ -0,0 +1,74 @@
1
+ // spec: specs/Applicant Dashboard Page Test Plan.md
2
+ // seed: seed.spec.ts
3
+
4
+ import { test, expect } from '@playwright/test';
5
+ import { ApplicantPage } from '@pages/ApplicantPage';
6
+ import {
7
+ CreateApplicationPage
8
+ } from '@pages/CreateApplicationPage';
9
+ import { WebActions } from '@lib/WebActions';
10
+ import { expectApplicantAuthenticatedHeaderFooterVisible } from '@lib/ApplicantPortalAssertions';
11
+
12
+
13
+ test.describe('Applicant Dashboard Page Tests', () => {
14
+ let applicantPage: ApplicantPage;
15
+ let webActions: WebActions;
16
+ let createApplicationPage: CreateApplicationPage;
17
+ test.beforeEach(async ({ page }) => {
18
+ applicantPage = new ApplicantPage(page);
19
+ createApplicationPage = new CreateApplicationPage(page);
20
+ webActions = new WebActions(page, page.context());
21
+ await applicantPage.gotoURL('/polkphpapplicant/s/?language=en_US');
22
+ await webActions.waitForElementAttached(applicantPage.Logout_Btn);
23
+ //Navigate to the login page by clicking the login button on the header
24
+ });
25
+
26
+ test('Verify the applicant is logged-in and on the dashboard page @auth @smoke', async ({ page }) => {
27
+ //Verify the dashboard elements are visible
28
+ await expectApplicantAuthenticatedHeaderFooterVisible(applicantPage);
29
+ //Heading & Content Section Validations
30
+ await expect.soft(applicantPage.WelcomeHeading_Text).toBeVisible();
31
+ const text = await applicantPage.Instructions_Text.textContent();
32
+ console.log(`Instructions Text: ${text}`);
33
+ await expect.soft(applicantPage.Banner_Img).toBeVisible();
34
+ });
35
+
36
+ test('Verify Navigation of Create Application Page @auth', async ({ page }) => {
37
+ //Click on the Create Application link
38
+ await applicantPage.clickCreateApplicationLink();
39
+ //Verify the URL is correct & Form Title is visible
40
+ expect.soft(page.url()).toContain('createapplication');
41
+ await webActions.waitForElementAttached(createApplicationPage.ApplicationLanguageTitle_Lbl);
42
+ await expect.soft(createApplicationPage.ApplicationLanguageTitle_Lbl).toBeVisible();
43
+ });
44
+
45
+ test('Verify Navigation of My Application Page @auth', async ({ page }) => {
46
+ //Click on the My Application link
47
+ await applicantPage.clickMyApplicationLink();
48
+ //Verify the URL is correct & Table is visible
49
+ expect.soft(page.url()).toContain('careprogram');
50
+ await expect.soft(applicantPage.MyApplications_Table).toBeVisible();
51
+ });
52
+
53
+ test('Verify Navigation of My Medical Coverage Page @auth', async ({ page }) => {
54
+ //Click on the My Medical Coverage link
55
+ await applicantPage.clickMyMedicalCoverageLink();
56
+ //Verify the URL is correct & Table is visible
57
+ expect.soft(page.url()).toContain('enrollments');
58
+ //Verify the my medical coverage page elements are visible
59
+ if(await applicantPage.MyMedicalCoverageRecords.isVisible()) {
60
+ await expect.soft(applicantPage.MyMedicalCoverageRecords).toBeVisible();
61
+ } else {
62
+ await expect.soft(applicantPage.NoEnrollments_Text).toBeVisible();
63
+ }
64
+ });
65
+
66
+ test('Verify Navigation of Resources Page @auth', async ({ page }) => {
67
+ //Click on the Resources link
68
+ await applicantPage.clickResourcesLink();
69
+ //Verify the URL is correct & Title is visible
70
+ expect.soft(page.url()).toContain('resourcespage');
71
+ await expect.soft(applicantPage.ResourcesTitle_Text).toBeVisible();
72
+ });
73
+
74
+ });
@@ -0,0 +1,88 @@
1
+ // spec: specs/Applicant Forgot Password Page Test Plan.md
2
+ // seed: seed.spec.ts
3
+
4
+ import { test, expect } from '@playwright/test';
5
+ import { ApplicantPage } from '@pages/ApplicantPage';
6
+ import { WebActions } from '@lib/WebActions';
7
+ import emailData from '../test-data/forgotPassword/email.json';
8
+ import forgotPasswordTextData from '../test-data/forgotPassword/textMessages.json';
9
+
10
+ test.describe('Applicant Forgot Password Page Tests', () => {
11
+ let applicantPage: ApplicantPage;
12
+ let webActions: WebActions;
13
+ test.beforeEach(async ({ page }) => {
14
+ applicantPage = new ApplicantPage(page);
15
+ webActions = new WebActions(page, page.context());
16
+ await applicantPage.gotoURL('/polkphpapplicant/s/?language=en_US');
17
+ await applicantPage.clickLoginButton();
18
+ await applicantPage.clickForgotPasswordLink();
19
+ await webActions.waitForElementAttached(applicantPage.ForgotPasswordTitle_Text);
20
+ });
21
+
22
+ test('Verify all the elements of the forgot password page are visible @no-auth', async ({ page }) => {
23
+ //Verify the forgot password page elements are visible
24
+ await expect.soft(applicantPage.ForgotPasswordTitle_Text).toBeVisible();
25
+ expect.soft(await applicantPage.ForgotPasswordMessage_Text.textContent()).toBe(forgotPasswordTextData.forgotPasswordMessage);
26
+ await expect.soft(applicantPage.ForgotPasswordField_Lbl).toBeVisible();
27
+ await expect.soft(applicantPage.ForgotPasswordField_Input).toBeVisible();
28
+ await expect.soft(applicantPage.SendResetLink_Btn).toBeVisible();
29
+ });
30
+
31
+ test('Verify when the forgot password input field is left blank the submit button is disabled @no-auth', async ({ page }) => {
32
+ await expect.soft(applicantPage.ForgotPasswordField_Input).toBeEmpty();
33
+ await expect.soft(applicantPage.SendResetLink_Btn).toBeDisabled();
34
+ });
35
+
36
+ test('Verify when the forgot password input field is not empty with valid input the submit button is enabled & success message should be displayed on submission @no-auth', async ({ page }) => {
37
+ await applicantPage.ForgotPasswordField_Input.fill(emailData.validEmail);
38
+ await expect.soft(applicantPage.ForgotPasswordField_Input).not.toBeEmpty();
39
+ await expect.soft(applicantPage.SendResetLink_Btn).toBeEnabled();
40
+ await applicantPage.clickSendResetLinkButton();
41
+ await webActions.waitForElementAttached(applicantPage.ForgotPasswordSuccessMessage_Text);
42
+ await expect.soft(applicantPage.ForgotPasswordSuccessMessage_Text).toBeVisible();
43
+ expect.soft(await applicantPage.ForgotPasswordSuccessMessage_Text.textContent()).toBe(forgotPasswordTextData.successMessage);
44
+ });
45
+
46
+ test('Verify when invalid email format is entered, error message should be displayed @no-auth', async ({ page }) => {
47
+ await applicantPage.ForgotPasswordField_Input.fill(emailData.invalidEmail);
48
+ await applicantPage.clickSendResetLinkButton();
49
+ await webActions.waitForElementAttached(applicantPage.ForgotPasswordRequiredFieldError_Text)
50
+ await expect.soft(applicantPage.ForgotPasswordRequiredFieldError_Text).toBeVisible();
51
+ expect.soft(await applicantPage.ForgotPasswordRequiredFieldError_Text.textContent()).toBe(forgotPasswordTextData.invalidEmailError);
52
+ await expect.soft(applicantPage.ForgotPasswordSuccessMessage_Text).toBeHidden();
53
+ });
54
+
55
+ test('Verify the success message is not shown before submit @no-auth', async ({ page }) => {
56
+ await applicantPage.ForgotPasswordField_Input.fill(emailData.validEmail);
57
+ await expect.soft(applicantPage.ForgotPasswordSuccessMessage_Text).toBeHidden();
58
+ });
59
+
60
+ test('Verify clearing the field after valid input disables the submit button again @no-auth', async ({ page }) => {
61
+ await applicantPage.ForgotPasswordField_Input.fill(emailData.validEmail);
62
+ await expect.soft(applicantPage.SendResetLink_Btn).toBeEnabled();
63
+
64
+ await applicantPage.ForgotPasswordField_Input.clear();
65
+ await expect.soft(applicantPage.SendResetLink_Btn).toBeDisabled();
66
+ });
67
+
68
+ test('Verify invalid email error clears after correcting input and submitting successfully @no-auth', async ({ page }) => {
69
+ await applicantPage.ForgotPasswordField_Input.fill(emailData.invalidEmail);
70
+ await applicantPage.clickSendResetLinkButton();
71
+ await webActions.waitForElementAttached(applicantPage.ForgotPasswordRequiredFieldError_Text);
72
+ await expect.soft(applicantPage.ForgotPasswordRequiredFieldError_Text).toBeVisible();
73
+ await applicantPage.ForgotPasswordField_Input.fill(emailData.validEmail);
74
+ await applicantPage.clickSendResetLinkButton();
75
+ await expect.soft(applicantPage.ForgotPasswordRequiredFieldError_Text).toBeHidden();
76
+ await applicantPage.clickSendResetLinkButton();
77
+ await webActions.waitForElementAttached(applicantPage.ForgotPasswordSuccessMessage_Text);
78
+ await expect.soft(applicantPage.ForgotPasswordSuccessMessage_Text).toBeVisible();
79
+ expect.soft(await applicantPage.ForgotPasswordSuccessMessage_Text.textContent()).toBe(forgotPasswordTextData.successMessage);
80
+ });
81
+
82
+ test('Verify whitespace-only input does not submit a reset as valid email @no-auth', async ({ page }) => {
83
+ await applicantPage.ForgotPasswordField_Input.fill(emailData.whitespaceEmail);
84
+ await applicantPage.ForgotPasswordTitle_Text.click();
85
+ await expect.soft(applicantPage.SendResetLink_Btn).toBeDisabled();
86
+ await expect.soft(applicantPage.ForgotPasswordRequiredFieldError_Text).toBeVisible();
87
+ });
88
+ });
@@ -0,0 +1,468 @@
1
+ // spec: specs/Applicant Help Page Test Plan.md
2
+ // seed: seed.spec.ts
3
+
4
+ import { test, expect } from '@playwright/test';
5
+ import { ApplicantPage } from '@pages/ApplicantPage';
6
+ import { WebActions } from '@lib/WebActions';
7
+ import {
8
+ expectApplicantAuthenticatedHeaderFooterVisible,
9
+ expectApplicantAuthenticatedHeaderVisible,
10
+ expectApplicantFooterVisible,
11
+ } from '@lib/ApplicantPortalAssertions';
12
+ import helpTextData from '../test-data/help/textContent.json';
13
+
14
+ test.describe('Applicant Help Page Tests', () => {
15
+ let applicantPage: ApplicantPage;
16
+ let webActions: WebActions;
17
+
18
+ test.beforeEach(async ({ page }) => {
19
+ applicantPage = new ApplicantPage(page);
20
+ webActions = new WebActions(page, page.context());
21
+ await applicantPage.gotoURL('/polkphpapplicant/s/?language=en_US');
22
+ await webActions.waitForElementAttached(applicantPage.Logout_Btn);
23
+ // Click the Help link in the header navigation
24
+ await applicantPage.clickHelpHeaderLink();
25
+ await webActions.waitForElementAttached(applicantPage.KnowledgeBaseH1_Text);
26
+ });
27
+
28
+ // TC-01 — Authenticated Header, Footer, And Help Page H1 Are Visible
29
+ test('TC-01 - Authenticated Header, Footer, And Help Page H1 Are Visible @auth', async ({ page }) => {
30
+ // 1. Navigate to /polkphpapplicant/s/?language=en_US and wait for the Logout button (done in beforeEach)
31
+ // 2. Click the Help link and wait for the Knowledge Base H1 (done in beforeEach)
32
+ // Verify URL contains knowledge-base
33
+ expect.soft(page.url()).toContain('knowledge-base');
34
+ // 3. Verify all authenticated header & footer elements
35
+ await expectApplicantAuthenticatedHeaderFooterVisible(applicantPage)
36
+ });
37
+
38
+ // TC-02 — Knowledge Base Page Title Section Content Is Correct
39
+ test('TC-02 - Knowledge Base Page Title Section Content Is Correct @auth', async ({ page }) => {
40
+ // 1. Open the Help / Knowledge Base page and wait for the H1 heading to appear (done in beforeEach)
41
+ // 2. Locate the H1 heading and the subtitle paragraph directly beneath it
42
+ await expect.soft(applicantPage.KnowledgeBaseH1_Text).toBeVisible();
43
+ await expect.soft(applicantPage.KnowledgeBaseSubtitle_Text).toBeVisible();
44
+ expect.soft(await applicantPage.KnowledgeBaseSubtitle_Text.textContent()).toContain(helpTextData.subtitle);
45
+ // 3. Verify the search bar is present and has the correct placeholder text
46
+ await expect.soft(applicantPage.KnowledgeBaseSearch_Input).toBeVisible();
47
+ await expect(applicantPage.KnowledgeBaseSearch_Input).toHaveAttribute('placeholder', helpTextData.searchPlaceholder);
48
+ });
49
+
50
+ // TC-03 — Article List Displays The Correct Article Card Content
51
+ test('TC-03 - Article List Displays The Correct Article Card Content @auth', async ({ page }) => {
52
+ // 1. Open the Help / Knowledge Base page and wait for the article card list to load (done in beforeEach)
53
+ // Verify at least one article card is visible (first card's "Read more →" link must appear)
54
+ await expect.soft(applicantPage.KnowledgeBaseArticleCards_All.first()).toBeVisible();
55
+ // 2. Inspect the first article card in the list
56
+ // Verify article type badge Procedure is visible
57
+ await expect.soft(applicantPage.KnowledgeBaseFirstCardBadge_Text).toBeVisible();
58
+ expect.soft(await applicantPage.KnowledgeBaseFirstCardBadge_Text.textContent()).toContain(helpTextData.articleCardBadge);
59
+ // Verify article title How to Reset Your Password is visible
60
+ await expect.soft(applicantPage.KnowledgeBaseFirstCardTitle_Text).toBeVisible();
61
+ expect.soft(await applicantPage.KnowledgeBaseFirstCardTitle_Text.textContent()).toContain(helpTextData.articleCardTitle);
62
+ // Verify summary text is visible
63
+ await expect.soft(applicantPage.KnowledgeBaseFirstCardSummary_Text).toBeVisible();
64
+ expect.soft(await applicantPage.KnowledgeBaseFirstCardSummary_Text.textContent()).toContain(helpTextData.articleCardSummary);
65
+ // Verify publish date is visible
66
+ await expect.soft(applicantPage.KnowledgeBaseFirstCardDate_Text).toBeVisible();
67
+ expect.soft(await applicantPage.KnowledgeBaseFirstCardDate_Text.textContent()).toContain(helpTextData.articleCardPublishDate);
68
+ // Verify Read more link text is visible
69
+ await expect.soft(applicantPage.KnowledgeBaseFirstCardReadMore_Lnk).toBeVisible();
70
+ expect.soft(await applicantPage.KnowledgeBaseFirstCardReadMore_Lnk.textContent()).toContain(helpTextData.articleCardReadMore);
71
+ });
72
+
73
+ // TC-04 — Category Filter Narrows Article List
74
+ test('TC-04 - Category Filter Narrows Article List @auth', async ({ page }) => {
75
+ // 1. Open the Help / Knowledge Base page and wait for the article list to load (done in beforeEach)
76
+ // Verify Categories sidebar is visible with all labels
77
+ await expect.soft(applicantPage.KnowledgeBaseCategoryAll_Lnk).toBeVisible();
78
+ await expect.soft(applicantPage.KnowledgeBaseCategorySupport_Lnk).toBeVisible();
79
+ await expect.soft(applicantPage.KnowledgeBaseCategoryAccount_Lnk).toBeVisible();
80
+ await expect.soft(applicantPage.KnowledgeBaseCategoryGeneral_Lnk).toBeVisible();
81
+ // 2. Click the Account category filter
82
+ await applicantPage.clickAccountCategoryFilter();
83
+ // Verify the How to Reset Your Password card is visible
84
+ await expect.soft(applicantPage.KnowledgeBaseFirstCardTitle_Text).toBeVisible();
85
+ expect.soft(await applicantPage.KnowledgeBaseFirstCardTitle_Text.textContent()).toContain(helpTextData.articleCardTitle);
86
+ // 3. Click the Support category filter (shows 0 articles)
87
+ await applicantPage.clickSupportCategoryFilter();
88
+ // Verify empty-state message is visible
89
+ await expect.soft(applicantPage.KnowledgeBaseEmptyState_Text).toBeVisible();
90
+ expect.soft(await applicantPage.KnowledgeBaseEmptyState_Text.textContent()).toContain(helpTextData.emptyStateMessage);
91
+ // 4. Click the General category filter (shows 0 articles)
92
+ await applicantPage.clickGeneralCategoryFilter();
93
+ // Verify empty-state message is visible
94
+ await expect.soft(applicantPage.KnowledgeBaseEmptyState_Text).toBeVisible();
95
+ expect.soft(await applicantPage.KnowledgeBaseEmptyState_Text.textContent()).toContain(helpTextData.emptyStateMessage);
96
+ // 5. Click the All category filter
97
+ await applicantPage.clickAllCategoryFilter();
98
+ // Verify the How to Reset Your Password card is visible again
99
+ await expect.soft(applicantPage.KnowledgeBaseFirstCardTitle_Text).toBeVisible();
100
+ expect.soft(await applicantPage.KnowledgeBaseFirstCardTitle_Text.textContent()).toContain(helpTextData.articleCardTitle);
101
+ });
102
+
103
+ // TC-05 — Article Type Filter Narrows Article List
104
+ test('TC-05 - Article Type Filter Narrows Article List @auth', async ({ page }) => {
105
+ // 1. Open the Help / Knowledge Base page and wait for the article list to load (done in beforeEach)
106
+ // Verify Article Type sidebar is visible with all labels
107
+ await expect.soft(applicantPage.KnowledgeBaseTypeAll_Lnk).toBeVisible();
108
+ await expect.soft(applicantPage.KnowledgeBaseTypeFaq_Lnk).toBeVisible();
109
+ await expect.soft(applicantPage.KnowledgeBaseTypeProcedure_Lnk).toBeVisible();
110
+ // 2. Click the Procedure article type filter
111
+ await applicantPage.clickProcedureArticleTypeFilter();
112
+ // Verify the How to Reset Your Password card is visible
113
+ await expect.soft(applicantPage.KnowledgeBaseFirstCardTitle_Text).toBeVisible();
114
+ expect.soft(await applicantPage.KnowledgeBaseFirstCardTitle_Text.textContent()).toContain(helpTextData.articleCardTitle);
115
+ // 3. Click the FAQ article type filter (no FAQ articles)
116
+ await applicantPage.clickFaqArticleTypeFilter();
117
+ // Verify empty-state message is visible
118
+ await expect.soft(applicantPage.KnowledgeBaseEmptyState_Text).toBeVisible();
119
+ expect.soft(await applicantPage.KnowledgeBaseEmptyState_Text.textContent()).toContain(helpTextData.emptyStateMessage);
120
+ // 4. Click the All article type filter
121
+ await applicantPage.clickAllArticleTypeFilter();
122
+ // Verify the How to Reset Your Password card is visible again
123
+ await expect.soft(applicantPage.KnowledgeBaseFirstCardTitle_Text).toBeVisible();
124
+ expect.soft(await applicantPage.KnowledgeBaseFirstCardTitle_Text.textContent()).toContain(helpTextData.articleCardTitle);
125
+ });
126
+
127
+ // TC-06 — Search Box Filters Articles And Shows Empty State For No Matches
128
+ test('TC-06 - Search Box Filters Articles And Shows Empty State For No Matches @auth', async ({ page }) => {
129
+ // 1. Open the Help / Knowledge Base page and wait for the article list to load (done in beforeEach)
130
+ // Verify the search box is visible and empty
131
+ await expect.soft(applicantPage.KnowledgeBaseSearch_Input).toBeVisible();
132
+ // 2. Type 'password' in the search box
133
+ await applicantPage.KnowledgeBaseSearch_Input.fill('password');
134
+ // Verify the How to Reset Your Password card is visible
135
+ await expect.soft(applicantPage.KnowledgeBaseFirstCardTitle_Text).toBeVisible();
136
+ expect.soft(await applicantPage.KnowledgeBaseFirstCardTitle_Text.textContent()).toContain(helpTextData.articleCardTitle);
137
+ // Verify the Clear button appears
138
+ await expect.soft(applicantPage.KnowledgeBaseSearchClear_Btn).toBeVisible();
139
+ // 3. Click the Clear button
140
+ await applicantPage.clickSearchClearButton();
141
+ // Verify the search box is cleared
142
+ await expect(applicantPage.KnowledgeBaseSearch_Input).toHaveValue('');
143
+ // Verify the Clear button disappears
144
+ await expect.soft(applicantPage.KnowledgeBaseSearchClear_Btn).not.toBeVisible();
145
+ // Verify the How to Reset Your Password card is visible again
146
+ await expect.soft(applicantPage.KnowledgeBaseFirstCardTitle_Text).toBeVisible();
147
+ // 4. Type 'xyznotfound' in the search box
148
+ await applicantPage.KnowledgeBaseSearch_Input.fill('xyznotfound');
149
+ // Verify empty-state message is visible
150
+ await expect.soft(applicantPage.KnowledgeBaseEmptyState_Text).toBeVisible();
151
+ expect.soft(await applicantPage.KnowledgeBaseEmptyState_Text.textContent()).toContain(helpTextData.emptyStateMessage);
152
+ // 5. Click the Clear button to reset the search
153
+ await applicantPage.clickSearchClearButton();
154
+ // Verify the search box is cleared
155
+ await expect(applicantPage.KnowledgeBaseSearch_Input).toHaveValue('');
156
+ // Verify the full article list is restored
157
+ await expect.soft(applicantPage.KnowledgeBaseFirstCardTitle_Text).toBeVisible();
158
+ });
159
+
160
+ // TC-07 — Article Card Click Navigates To The Article Detail Page
161
+ test('TC-07 - Article Card Click Navigates To The Article Detail Page @auth', async ({ page }) => {
162
+ // 1. Open the Help / Knowledge Base page and wait for the article list to load (done in beforeEach)
163
+ // 2. Click the How to Reset Your Password article card
164
+ await applicantPage.clickHowToResetPasswordCard();
165
+ await webActions.waitForElementAttached(applicantPage.ArticleDetailH1_Text);
166
+ // Verify URL contains article?urlName=how-to-reset-password
167
+ expect.soft(page.url()).toContain('article?urlName=how-to-reset-password');
168
+ // Verify the H1 heading How to Reset Your Password is visible
169
+ await expect.soft(applicantPage.ArticleDetailH1_Text).toBeVisible();
170
+ expect.soft(await applicantPage.ArticleDetailH1_Text.textContent()).toContain(helpTextData.articleDetailH1);
171
+ // Verify the article type badge Procedure is visible
172
+ await expect.soft(applicantPage.ArticleDetailBadge_Text).toBeVisible();
173
+ expect.soft(await applicantPage.ArticleDetailBadge_Text.textContent()).toContain(helpTextData.articleDetailBadge);
174
+ // Verify metadata: Published date, Category, Article #
175
+ await expect.soft(applicantPage.ArticleDetailPublished_Text).toBeVisible();
176
+ expect.soft(await applicantPage.ArticleDetailPublished_Text.textContent()).toContain(helpTextData.articleDetailPublished);
177
+ await expect.soft(applicantPage.ArticleDetailCategory_Text).toBeVisible();
178
+ expect.soft(await applicantPage.ArticleDetailCategory_Text.textContent()).toContain(helpTextData.articleDetailCategory);
179
+ await expect.soft(applicantPage.ArticleDetailArticleNumber_Text).toBeVisible();
180
+ expect.soft(await applicantPage.ArticleDetailArticleNumber_Text.textContent()).toContain(helpTextData.articleDetailArticleNumber);
181
+ // Verify user remains authenticated
182
+ await expect.soft(applicantPage.Logout_Btn).toBeVisible();
183
+ });
184
+
185
+ // TC-08 — Article Detail Page Sections And Content Are Correct
186
+ test('TC-08 - Article Detail Page Sections And Content Are Correct @auth', async ({ page }) => {
187
+ // 1. Navigate to the article detail page at /polkphpapplicant/s/article?urlName=how-to-reset-password
188
+ await applicantPage.gotoURL('/polkphpapplicant/s/article?urlName=how-to-reset-password');
189
+ await webActions.waitForElementAttached(applicantPage.ArticleDetailH1_Text);
190
+ // 2. Verify the Summary section
191
+ await expect.soft(applicantPage.ArticleDetailSummaryLabel_Text).toBeVisible();
192
+ expect.soft(await applicantPage.ArticleDetailSummaryLabel_Text.textContent()).toContain(helpTextData.articleDetailSectionSummary);
193
+ await expect.soft(applicantPage.ArticleDetailSummaryContent_Text).toBeVisible();
194
+ expect.soft(await applicantPage.ArticleDetailSummaryContent_Text.textContent()).toContain(helpTextData.articleDetailSummaryText);
195
+ // 3. Verify the Audience section
196
+ await expect.soft(applicantPage.ArticleDetailAudienceLabel_Text).toBeVisible();
197
+ expect.soft(await applicantPage.ArticleDetailAudienceLabel_Text.textContent()).toContain(helpTextData.articleDetailSectionAudience);
198
+ await expect.soft(applicantPage.ArticleDetailAudienceContent_Text).toBeVisible();
199
+ expect.soft(await applicantPage.ArticleDetailAudienceContent_Text.textContent()).toContain(helpTextData.articleDetailAudienceText);
200
+ // 4. Verify the Purpose section
201
+ await expect.soft(applicantPage.ArticleDetailPurposeLabel_Text).toBeVisible();
202
+ expect.soft(await applicantPage.ArticleDetailPurposeLabel_Text.textContent()).toContain(helpTextData.articleDetailSectionPurpose);
203
+ await expect.soft(applicantPage.ArticleDetailPurposeContent_Text).toBeVisible();
204
+ expect.soft(await applicantPage.ArticleDetailPurposeContent_Text.textContent()).toContain(helpTextData.articleDetailPurposeText);
205
+ // 5. Verify the warning block
206
+ for (const bullet of helpTextData.articleDetailWarningBullets) {
207
+ await expect.soft(applicantPage.ArticleDetailWarningBlock_Text.filter({ hasText: bullet })).toBeVisible();
208
+ }
209
+ // 6. Verify the Steps section
210
+ await expect.soft(applicantPage.ArticleDetailStepsLabel_Text).toBeVisible();
211
+ expect.soft(await applicantPage.ArticleDetailStepsLabel_Text.textContent()).toContain(helpTextData.articleDetailSectionSteps);
212
+ for (const step of helpTextData.articleDetailSteps) {
213
+ await expect.soft(applicantPage.ArticleDetailStepsContent_Block.filter({ hasText: step })).toBeVisible();
214
+ }
215
+ });
216
+
217
+ // TC-09 — Was This Article Helpful Widget Is Functional
218
+ // FIXME: Vote counts (👍 Yes / 👎 No) reset to 0 after a page reload. The app does not persist
219
+ // vote counts across navigation/reload — the Salesforce Apex call that would save votes
220
+ // returns a connection error (net::ERR_CONNECTION) in the sandbox environment. Step 5 of this
221
+ // test (reload persistence check) therefore always fails. The widget click behaviour (steps 2–4)
222
+ // works correctly but cannot be verified independently without also running the broken step 5.
223
+ test.fixme('TC-09 - Was This Article Helpful Widget Is Functional @auth @knownissue', async ({ page }) => {
224
+ // 1. Navigate to the article detail page at /polkphpapplicant/s/article?urlName=how-to-reset-password
225
+ await applicantPage.gotoURL('/polkphpapplicant/s/article?urlName=how-to-reset-password');
226
+ await webActions.waitForElementAttached(applicantPage.ArticleDetailH1_Text);
227
+ // 2. Locate the Was this article helpful? widget
228
+ await expect.soft(applicantPage.ArticleDetailHelpfulLabel_Text).toBeVisible();
229
+ expect.soft(await applicantPage.ArticleDetailHelpfulLabel_Text.textContent()).toContain(helpTextData.articleDetailHelpfulLabel);
230
+ await expect.soft(applicantPage.ArticleDetailHelpfulYes_Btn).toBeVisible();
231
+ await expect.soft(applicantPage.ArticleDetailHelpfulNo_Btn).toBeVisible();
232
+ // Capture initial vote counts from the button labels
233
+ const yesBefore = await applicantPage.getHelpfulYesCount();
234
+ const noBefore = await applicantPage.getHelpfulNoCount();
235
+ // 3. Click the Yes button
236
+ await applicantPage.clickHelpfulYesButton();
237
+ // Verify Yes vote count incremented by exactly 1 (poll until the label updates)
238
+ await expect.poll(() => applicantPage.getHelpfulYesCount()).toBe(yesBefore + 1);
239
+ // Verify user remains on the article detail page
240
+ expect.soft(page.url()).toContain('article?urlName=how-to-reset-password');
241
+ // Verify user remains authenticated
242
+ await expect.soft(applicantPage.Logout_Btn).toBeVisible();
243
+ // 4. Click the No button
244
+ await applicantPage.clickHelpfulNoButton();
245
+ // Verify No vote count incremented by exactly 1 (poll until the label updates)
246
+ await expect.poll(() => applicantPage.getHelpfulNoCount()).toBe(noBefore + 1);
247
+ // Verify user remains on the article detail page
248
+ expect.soft(page.url()).toContain('article?urlName=how-to-reset-password');
249
+ // Verify user remains authenticated
250
+ await expect.soft(applicantPage.Logout_Btn).toBeVisible();
251
+ // 5. Click the browser refresh button
252
+ await page.reload();
253
+ await webActions.waitForElementAttached(applicantPage.ArticleDetailH1_Text);
254
+ // Verify the counts are persisted (not reverted to 0) — should still be at least the post-vote values
255
+ expect.soft(await applicantPage.getHelpfulYesCount()).toBeGreaterThanOrEqual(yesBefore + 1);
256
+ expect.soft(await applicantPage.getHelpfulNoCount()).toBeGreaterThanOrEqual(noBefore + 1);
257
+ });
258
+
259
+ // TC-10 — Back To Knowledge Base Button Returns To The Knowledge Base List
260
+ test('TC-10 - Back To Knowledge Base Button Returns To The Knowledge Base List @auth', async ({ page }) => {
261
+ // 1. Navigate to the article detail page at /polkphpapplicant/s/article?urlName=how-to-reset-password
262
+ await applicantPage.gotoURL('/polkphpapplicant/s/article?urlName=how-to-reset-password');
263
+ await webActions.waitForElementAttached(applicantPage.ArticleDetailH1_Text);
264
+ // 2. Click the Back to Knowledge Base button
265
+ await applicantPage.clickBackToKnowledgeBase();
266
+ await webActions.waitForElementAttached(applicantPage.KnowledgeBaseH1_Text);
267
+ // Verify URL contains knowledge-base
268
+ expect.soft(page.url()).toContain('knowledge-base');
269
+ // Verify the Knowledge Base H1 heading is visible
270
+ await expect.soft(applicantPage.KnowledgeBaseH1_Text).toBeVisible();
271
+ // Verify the article card list is visible
272
+ await expect.soft(applicantPage.KnowledgeBaseFirstCardTitle_Text).toBeVisible();
273
+ // Verify user remains authenticated
274
+ await expect.soft(applicantPage.Logout_Btn).toBeVisible();
275
+ });
276
+
277
+ // TC-11 — Browser Tab Title Is Knowledge Base
278
+ test('TC-11 - Browser Tab Title Is Knowledge Base @auth', async ({ page }) => {
279
+ // 1. Open the Help / Knowledge Base page and wait for the H1 heading to appear (done in beforeEach)
280
+ // 2. Read document.title from the browser and verify it matches expected title
281
+ await expect(page).toHaveTitle(helpTextData.documentTitle);
282
+ });
283
+
284
+ // TC-12 — Heading Hierarchy And Accessibility Attributes Are Correct
285
+ test('TC-12 - Heading Hierarchy And Accessibility Attributes Are Correct @auth', async ({ page }) => {
286
+ // 1. Open the Help / Knowledge Base page and wait for the H1 heading to appear (done in beforeEach)
287
+ // 2. Inspect the heading hierarchy
288
+ // Verify exactly one H1 element with the text Knowledge Base
289
+ await expect(applicantPage.KnowledgeBaseH1_All).toHaveCount(1);
290
+ await expect(applicantPage.KnowledgeBaseH1Role_Heading).toHaveText(helpTextData.h1Title);
291
+ // Verify zero H2 elements on the page
292
+ await expect(applicantPage.KnowledgeBaseH2_All).toHaveCount(0);
293
+ // Verify zero H3 elements on the page
294
+ await expect(applicantPage.KnowledgeBaseH3_All).toHaveCount(0);
295
+ // 3. Verify the HTML lang attribute on the root html element
296
+ await expect(applicantPage.HtmlRoot_Elem).toHaveAttribute('lang', helpTextData.htmlLang);
297
+ // 4. Verify the Logo image has a meaningful alt attribute
298
+ await expect(applicantPage.Logo_Img).toHaveAttribute('alt', helpTextData.logoAlt);
299
+ });
300
+
301
+ // TC-13 — Help Page Is Reachable Via The Help Header Link From The Dashboard
302
+ test('TC-13 - Help Page Is Reachable Via The Help Header Link From The Dashboard @auth', async ({ page }) => {
303
+ // 1. Navigate to /polkphpapplicant/s/?language=en_US and confirm the Logout button is visible (done in beforeEach)
304
+ // beforeEach already navigated to dashboard and clicked Help - we only need to verify the result here
305
+ // 2. Locate the Help link in the header navigation
306
+ // Go back to dashboard first to verify the link is there
307
+ await applicantPage.gotoURL('/polkphpapplicant/s/?language=en_US');
308
+ await webActions.waitForElementAttached(applicantPage.Logout_Btn);
309
+ // Verify the Help link is visible in the header
310
+ await expect.soft(applicantPage.Help_Lnk).toBeVisible();
311
+ // Verify the Help link href resolves to /polkphpapplicant/s/knowledge-base
312
+ await expect(applicantPage.Help_Lnk).toHaveAttribute('href', '/polkphpapplicant/s/knowledge-base');
313
+ // 3. Click the Help link
314
+ await applicantPage.clickHelpHeaderLink();
315
+ await webActions.waitForElementAttached(applicantPage.KnowledgeBaseH1_Text);
316
+ // Verify URL contains knowledge-base
317
+ expect.soft(page.url()).toContain('knowledge-base');
318
+ // Verify the Knowledge Base H1 heading is visible
319
+ await expect.soft(applicantPage.KnowledgeBaseH1_Text).toBeVisible();
320
+ // Verify user remains authenticated
321
+ await expect.soft(applicantPage.Logout_Btn).toBeVisible();
322
+ });
323
+
324
+ // TC-14 — Help Page Is Reachable Via The Help Header Link From The Resources Page
325
+ test('TC-14 - Help Page Is Reachable Via The Help Header Link From The Resources Page @auth', async ({ page }) => {
326
+ // 1. Navigate to the authenticated Resources page
327
+ await applicantPage.gotoURL('/polkphpapplicant/s/resourcespage');
328
+ await webActions.waitForElementAttached(applicantPage.ResourcesTitle_Text);
329
+ // Verify Resources page loads and user remains authenticated
330
+ await expect.soft(applicantPage.Logout_Btn).toBeVisible();
331
+ // 2. Click the Help link in the header navigation
332
+ await applicantPage.clickHelpHeaderLink();
333
+ await webActions.waitForElementAttached(applicantPage.KnowledgeBaseH1_Text);
334
+ // Verify URL contains knowledge-base
335
+ expect.soft(page.url()).toContain('knowledge-base');
336
+ // Verify the Knowledge Base H1 heading is visible
337
+ await expect.soft(applicantPage.KnowledgeBaseH1_Text).toBeVisible();
338
+ // Verify user remains authenticated
339
+ await expect.soft(applicantPage.Logout_Btn).toBeVisible();
340
+ });
341
+
342
+ // TC-15 — Header Nav Links From Help Page Return To Dashboard While Authenticated
343
+ test('TC-15 - Header Nav Links From Help Page Return To Dashboard While Authenticated @auth', async ({ page }) => {
344
+ // 1. Open the Help / Knowledge Base page and wait for the H1 heading to appear (done in beforeEach)
345
+ // 2. Click the Home link in the header navigation
346
+ await applicantPage.clickHomeLink();
347
+ await webActions.waitForElementAttached(applicantPage.WelcomeHeading_Text);
348
+ // Verify URL contains /polkphpapplicant/s/ and does not contain knowledge-base
349
+ expect.soft(page.url()).toContain('/polkphpapplicant/s/');
350
+ expect.soft(page.url()).not.toContain('knowledge-base');
351
+ // Verify the Welcome heading is visible
352
+ await expect.soft(applicantPage.WelcomeHeading_Text).toBeVisible();
353
+ // Verify user remains authenticated
354
+ await expect.soft(applicantPage.Logout_Btn).toBeVisible();
355
+ // 3. Navigate back to Help / Knowledge Base page and click the Logo image
356
+ await applicantPage.clickHelpHeaderLink();
357
+ await webActions.waitForElementAttached(applicantPage.KnowledgeBaseH1_Text);
358
+ await applicantPage.Logo_Img.click();
359
+ await webActions.waitForElementAttached(applicantPage.WelcomeHeading_Text);
360
+ // Verify URL contains /polkphpapplicant/s/ and does not contain knowledge-base
361
+ expect.soft(page.url()).toContain('/polkphpapplicant/s/');
362
+ expect.soft(page.url()).not.toContain('knowledge-base');
363
+ // Verify user remains authenticated
364
+ await expect.soft(applicantPage.Logout_Btn).toBeVisible();
365
+ });
366
+
367
+ // TC-16 — Desktop Viewport Layout (1500x730) Renders Correctly
368
+ test('TC-16 - Desktop Viewport Layout (1500x730) Renders Correctly @auth', async ({ page }) => {
369
+ // 1. Set the viewport to 1500x730 and navigate to the Knowledge Base page
370
+ await page.setViewportSize({ width: 1500, height: 730 });
371
+ await applicantPage.gotoURL('/polkphpapplicant/s/knowledge-base');
372
+ await webActions.waitForElementAttached(applicantPage.KnowledgeBaseH1_Text);
373
+ // Verify the Knowledge Base H1 heading is visible
374
+ await expect.soft(applicantPage.KnowledgeBaseH1_Text).toBeVisible();
375
+ // 2. Verify header, main content area, and footer are all visible
376
+ await expectApplicantAuthenticatedHeaderFooterVisible(applicantPage);
377
+ // Verify the subtitle is visible
378
+ await expect.soft(applicantPage.KnowledgeBaseSubtitle_Text).toBeVisible();
379
+ // Verify the search bar is visible
380
+ await expect.soft(applicantPage.KnowledgeBaseSearch_Input).toBeVisible();
381
+ // Verify category filters are visible
382
+ await expect.soft(applicantPage.KnowledgeBaseCategoryAll_Lnk).toBeVisible();
383
+ // Verify article card grid is visible
384
+ await expect.soft(applicantPage.KnowledgeBaseFirstCardTitle_Text).toBeVisible();
385
+ // Verify no horizontal overflow (allow small tolerance for scrollbar width)
386
+ await expect
387
+ .poll(() => page.evaluate(() => document.documentElement.scrollWidth <= document.documentElement.clientWidth + 20))
388
+ .toBeTruthy();
389
+ });
390
+
391
+ // TC-17 — Mobile Viewport Layout (Pixel 4a 412x732) Renders Correctly
392
+ test('TC-17 - Mobile Viewport Layout (Pixel 4a 412x732) Renders Correctly @auth', async ({ page }) => {
393
+ // 1. Set the viewport to 412x732 and navigate to the Knowledge Base page
394
+ await page.setViewportSize({ width: 412, height: 732 });
395
+ await applicantPage.gotoURL('/polkphpapplicant/s/knowledge-base');
396
+ await webActions.waitForElementAttached(applicantPage.KnowledgeBaseH1_Text);
397
+ // Verify the Knowledge Base H1 heading is visible
398
+ await expect.soft(applicantPage.KnowledgeBaseH1_Text).toBeVisible();
399
+ // Verify the Logo image is visible
400
+ await expect.soft(applicantPage.Logo_Img).toBeVisible();
401
+ // Verify the Logout button is visible
402
+ await expect.soft(applicantPage.Logout_Btn).toBeVisible();
403
+ // Verify the search bar is visible
404
+ await expect.soft(applicantPage.KnowledgeBaseSearch_Input).toBeVisible();
405
+ // 2. Scroll to the footer and verify footer content
406
+ await applicantPage.PolkHealthCare_Img.scrollIntoViewIfNeeded();
407
+ await expect.soft(applicantPage.PolkHealthCare_Img).toBeVisible();
408
+ await expect.soft(applicantPage.Copyright_Text).toBeVisible();
409
+ });
410
+
411
+ // TC-18 — No Broken Images On The Knowledge Base Page
412
+ test('TC-18 - No Broken Images On The Knowledge Base Page @auth', async ({ page }) => {
413
+ // 1. Open the Help / Knowledge Base page and wait for the H1 heading to appear (done in beforeEach)
414
+ // 2. Check that the header Logo image has loaded correctly
415
+ await applicantPage.Logo_Img.scrollIntoViewIfNeeded();
416
+ await expect.soft(applicantPage.Logo_Img).toBeVisible();
417
+ await expect
418
+ .poll(() => applicantPage.Logo_Img.evaluate((img) => (img as HTMLImageElement).naturalWidth))
419
+ .toBeGreaterThan(0);
420
+ // 3. Scroll to the footer and check that the Polk HealthCare Plan footer image has loaded correctly
421
+ await applicantPage.PolkHealthCare_Img.scrollIntoViewIfNeeded();
422
+ await expect.soft(applicantPage.PolkHealthCare_Img).toBeVisible();
423
+ await expect
424
+ .poll(() => applicantPage.PolkHealthCare_Img.evaluate((img) => (img as HTMLImageElement).naturalWidth))
425
+ .toBeGreaterThan(0);
426
+ });
427
+
428
+ // TC-19 — No Broken Images On The Article Detail Page
429
+ test('TC-19 - No Broken Images On The Article Detail Page @auth', async ({ page }) => {
430
+ // 1. Navigate to the article detail page at /polkphpapplicant/s/article?urlName=how-to-reset-password
431
+ await applicantPage.gotoURL('/polkphpapplicant/s/article?urlName=how-to-reset-password');
432
+ await webActions.waitForElementAttached(applicantPage.ArticleDetailH1_Text);
433
+ // 2. Check that the header Logo image has loaded correctly
434
+ await applicantPage.Logo_Img.scrollIntoViewIfNeeded();
435
+ await expect.soft(applicantPage.Logo_Img).toBeVisible();
436
+ await expect
437
+ .poll(() => applicantPage.Logo_Img.evaluate((img) => (img as HTMLImageElement).naturalWidth))
438
+ .toBeGreaterThan(0);
439
+ // 3. Check that the article banner image has loaded correctly
440
+ await applicantPage.ArticleDetailBanner_Img.scrollIntoViewIfNeeded();
441
+ await expect.soft(applicantPage.ArticleDetailBanner_Img).toBeVisible();
442
+ await expect
443
+ .poll(() => applicantPage.ArticleDetailBanner_Img.evaluate((img) => (img as HTMLImageElement).naturalWidth))
444
+ .toBeGreaterThan(0);
445
+ // 4. Scroll to the footer and check that the Polk HealthCare Plan footer image has loaded correctly
446
+ await applicantPage.PolkHealthCare_Img.scrollIntoViewIfNeeded();
447
+ await expect.soft(applicantPage.PolkHealthCare_Img).toBeVisible();
448
+ await expect
449
+ .poll(() => applicantPage.PolkHealthCare_Img.evaluate((img) => (img as HTMLImageElement).naturalWidth))
450
+ .toBeGreaterThan(0);
451
+ });
452
+
453
+ // TC-20 — Category Filter counts should not get changed on clicking other category
454
+ test.fixme('TC-20 - Category Filter counts should not get changed on clicking other category @auth @knownissue', async ({ page }) => {
455
+ // 1. Open the Help / Knowledge Base page and wait for the article list to load (done in beforeEach)
456
+ await webActions.waitForElementAttached(applicantPage.KnowledgeBaseCategoryAll_Lnk);
457
+ // Capture the total article count shown in the All filter before clicking any other filter
458
+ const allCount = applicantPage.KnowledgeBaseCategoryAll_Lnk.locator('.cat-count');
459
+ const allFilterTextBefore = await applicantPage.getFilterCount(allCount);
460
+ // 2. Click the Support category filter (shows 0 articles)
461
+ await applicantPage.clickSupportCategoryFilter();
462
+ await webActions.waitForElementAttached(applicantPage.KnowledgeBaseEmptyState_Text)
463
+ // Verify the count in All filter should update to show Support category count
464
+ const allFilterTextAfter = await applicantPage.getFilterCount(allCount);
465
+ // The All filter count should now reflect the Support category article count
466
+ await expect.soft(allFilterTextAfter).toBe(allFilterTextBefore)
467
+ });
468
+ });