From 5508fe127aa749472126918b1f363478978e364b Mon Sep 17 00:00:00 2001 From: Eezi Date: Sat, 8 Jun 2024 08:08:36 +0300 Subject: [PATCH 01/11] Started doing marriage testcase 7 --- .../7-validate-witness-1-page.spec.ts | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 e2e/testcases/marriage/7-validate-witness-1-page.spec.ts diff --git a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts new file mode 100644 index 000000000..f31124be4 --- /dev/null +++ b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts @@ -0,0 +1,83 @@ +import { expect, test } from '@playwright/test' +import { createPIN, login } from '../../helpers' + +test.describe('7. Validate Witness 1 details page', () => { + test.beforeEach(async ({ page }) => { + await login(page, 'k.mweene', 'test') + await createPIN(page) + await page.click('#header_new_event') + await page.getByText('Marriage', { exact: true }).click() + await page.getByText('Continue', { exact: true }).click() + await page.getByText('Continue', { exact: true }).click() + await page.getByText('Continue', { exact: true }).click() + await page.getByText('Continue', { exact: true }).click() + await page.getByText('Continue', { exact: true }).click() + }) + + // TODO: Jaa nämä testit pieniempiin kokonaisuuksiin. + test('1. Validate "First Name(s)" text field', async ({ page }) => { + // label: "First name(s)" input id: "#firstNamesEng" + // 1.1. Enter Non-English characters + await page.locator('#firstNamesEng').fill('*') + await expect( + page.getByText( + `Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)`, + { exact: true } + ) + ).toBeVisible() + + // 1.2. Enter less than 33 English characters + // There is no such an error case. + + // 1.3. Enter Field as NULL + await page.locator('#firstNamesEng').click() + await page.locator('#relationship').click() + await expect( + page.getByText('Required for registration', { exact: true }) + ).toBeVisible() + + // 1.4. Enter more than 32 English characters + // There is no such an error case and the input field maxLength is 32. + }) + + test('2. Validate "First Name(s)" text field', async ({ page }) => { + // label: "Last name" input id: "#familyNameEng" + // 2.1. Enter Non-English characters + await page.locator('#familyNameEng').fill('O’Neill') + await expect( + page.getByText( + `Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)`, + { exact: true } + ) + ).toBeVisible() + + // 2.2. Enter less than 33 English characters + // There is no such an error case. + + // 2.3. Enter Field as NULL + await page.locator('#familyNameEng').click() + await page.locator('#relationship').click() + await expect( + page.getByText('Required for registration', { exact: true }) + ).toBeVisible() + + // 2.4. Enter more than 32 English characters + // There is no such an error case and the input field maxLength is 32. + }) + // Done + test('3. Select any to the following option from Relationship to spouses:', async ({ + page + }) => { + // label: "Relationship to spouses" input id: "#relationship" + await page.locator('#relationship').click() + await page.getByText('Other', { exact: true }).click() + await expect(page.getByText('Other', { exact: true })).toBeVisible() + }) + // Done + test('4. Click continue', async ({ page }) => { + await page.getByText('Continue', { exact: true }).click() + await expect( + page.getByText('Witness 2 details', { exact: true }) + ).toBeVisible() + }) +}) From 949eb2f0b5e13f3358a4a2b46f91d43d8054bc8f Mon Sep 17 00:00:00 2001 From: Eezi Date: Tue, 11 Jun 2024 19:53:07 +0300 Subject: [PATCH 02/11] Added familyName validation tests --- .../7-validate-witness-1-page.spec.ts | 120 +++++++++++------- 1 file changed, 74 insertions(+), 46 deletions(-) diff --git a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts index f31124be4..7b2a6a863 100644 --- a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts +++ b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts @@ -14,10 +14,8 @@ test.describe('7. Validate Witness 1 details page', () => { await page.getByText('Continue', { exact: true }).click() }) - // TODO: Jaa nämä testit pieniempiin kokonaisuuksiin. - test('1. Validate "First Name(s)" text field', async ({ page }) => { - // label: "First name(s)" input id: "#firstNamesEng" - // 1.1. Enter Non-English characters + // 1.1. Enter Non-English characters + test('1.1. Validate "First Name(s)" text field', async ({ page }) => { await page.locator('#firstNamesEng').fill('*') await expect( page.getByText( @@ -25,59 +23,89 @@ test.describe('7. Validate Witness 1 details page', () => { { exact: true } ) ).toBeVisible() + }) + + // 1.2. Enter less than 33 English characters + test('1.2. Enter less than 33 English characters', async ({ page }) => { + await page.locator('#firstNamesEng').fill('Rakibul Islam') + await page.getByText('Birth declaration').click() - // 1.2. Enter less than 33 English characters - // There is no such an error case. + await expect(page.locator('#firstNamesEng_error')).toBeHidden() + }) - // 1.3. Enter Field as NULL + // 1.3. Enter Field as NULL + test('1.3. Enter Field as NULL', async ({ page }) => { await page.locator('#firstNamesEng').click() await page.locator('#relationship').click() await expect( page.getByText('Required for registration', { exact: true }) ).toBeVisible() + }) - // 1.4. Enter more than 32 English characters - // There is no such an error case and the input field maxLength is 32. + // 1.4. Enter more than 32 English characters + test('1.4. Enter more than 32 English characters', async ({ page }) => { + const LONG_NAME = 'Ovuvuevuevue Enyetuenwuevue Ugbemugbem Osas' + await page.locator('#firstNamesEng').fill(LONG_NAME) + await page.getByText('Witness 1 details').click() + + await expect(page.locator('#firstNamesEng')).toHaveValue( + LONG_NAME.slice(0, 32) + ) }) +}) - test('2. Validate "First Name(s)" text field', async ({ page }) => { - // label: "Last name" input id: "#familyNameEng" - // 2.1. Enter Non-English characters - await page.locator('#familyNameEng').fill('O’Neill') - await expect( - page.getByText( - `Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)`, - { exact: true } - ) - ).toBeVisible() +// 2.1. Enter Non-English characters +test('2.1. Validate "Last Name(s)" text field', async ({ page }) => { + await page.locator('#familyNameEng').fill('O’Neill') + await expect( + page.getByText( + `Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)`, + { exact: true } + ) + ).toBeVisible() +}) - // 2.2. Enter less than 33 English characters - // There is no such an error case. +// 2.2. Enter less than 33 English characters +test('2.2. Enter less than 33 English characters', async ({ page }) => { + await page.locator('#familyNamesEng').fill('Rakibul Islam') + await page.getByText('Witness 1 details').click() - // 2.3. Enter Field as NULL - await page.locator('#familyNameEng').click() - await page.locator('#relationship').click() - await expect( - page.getByText('Required for registration', { exact: true }) - ).toBeVisible() + await expect(page.locator('#familyNamesEng_error')).toBeHidden() +}) - // 2.4. Enter more than 32 English characters - // There is no such an error case and the input field maxLength is 32. - }) - // Done - test('3. Select any to the following option from Relationship to spouses:', async ({ - page - }) => { - // label: "Relationship to spouses" input id: "#relationship" - await page.locator('#relationship').click() - await page.getByText('Other', { exact: true }).click() - await expect(page.getByText('Other', { exact: true })).toBeVisible() - }) - // Done - test('4. Click continue', async ({ page }) => { - await page.getByText('Continue', { exact: true }).click() - await expect( - page.getByText('Witness 2 details', { exact: true }) - ).toBeVisible() - }) +// 2.3. Enter Field as NULL +test('2.3. Enter Field as NULL', async ({ page }) => { + await page.locator('#familyNameEng').click() + await page.locator('#relationship').click() + await expect( + page.getByText('Required for registration', { exact: true }) + ).toBeVisible() +}) + +// 2.4. Enter more than 32 English characters +test('2.4. Enter more than 32 English characters', async ({ page }) => { + const LONG_NAME = 'Ovuvuevuevue Enyetuenwuevue Ugbemugbem Osas' + await page.locator('#familyNamesEng').fill(LONG_NAME) + await page.getByText('Witness 1 details').click() + + await expect(page.locator('#familyNamesEng')).toHaveValue( + LONG_NAME.slice(0, 32) + ) +}) +// Done +test('3. Select any to the following option from Relationship to spouses:', async ({ + page +}) => { + // label: "Relationship to spouses" input id: "#relationship" + await page.locator('#relationship').click() + await page.getByText('Other', { exact: true }).click() + await expect(page.getByText('Other', { exact: true })).toBeVisible() +}) +// Done +test('4. Click continue', async ({ page }) => { + await page.getByText('Continue', { exact: true }).click() + await expect( + page.getByText('Witness 2 details', { exact: true }) + ).toBeVisible() +}) }) From 6e0136557088c08df43d0339b6c8bff076b118b7 Mon Sep 17 00:00:00 2001 From: Eezi Date: Tue, 11 Jun 2024 20:01:48 +0300 Subject: [PATCH 03/11] Fixed syntax error --- .../7-validate-witness-1-page.spec.ts | 99 +++++++++---------- 1 file changed, 49 insertions(+), 50 deletions(-) diff --git a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts index 7b2a6a863..eae6d13d2 100644 --- a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts +++ b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts @@ -52,60 +52,59 @@ test.describe('7. Validate Witness 1 details page', () => { LONG_NAME.slice(0, 32) ) }) -}) -// 2.1. Enter Non-English characters -test('2.1. Validate "Last Name(s)" text field', async ({ page }) => { - await page.locator('#familyNameEng').fill('O’Neill') - await expect( - page.getByText( - `Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)`, - { exact: true } - ) - ).toBeVisible() -}) + // 2.1. Enter Non-English characters + test('2.1. Validate "Last Name(s)" text field', async ({ page }) => { + await page.locator('#familyNameEng').fill('O’Neill') + await expect( + page.getByText( + `Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)`, + { exact: true } + ) + ).toBeVisible() + }) -// 2.2. Enter less than 33 English characters -test('2.2. Enter less than 33 English characters', async ({ page }) => { - await page.locator('#familyNamesEng').fill('Rakibul Islam') - await page.getByText('Witness 1 details').click() + // 2.2. Enter less than 33 English characters + test('2.2. Enter less than 33 English characters', async ({ page }) => { + await page.locator('#familyNamesEng').fill('Rakibul Islam') + await page.getByText('Witness 1 details').click() - await expect(page.locator('#familyNamesEng_error')).toBeHidden() -}) + await expect(page.locator('#familyNamesEng_error')).toBeHidden() + }) -// 2.3. Enter Field as NULL -test('2.3. Enter Field as NULL', async ({ page }) => { - await page.locator('#familyNameEng').click() - await page.locator('#relationship').click() - await expect( - page.getByText('Required for registration', { exact: true }) - ).toBeVisible() -}) + // 2.3. Enter Field as NULL + test('2.3. Enter Field as NULL', async ({ page }) => { + await page.locator('#familyNameEng').click() + await page.locator('#relationship').click() + await expect( + page.getByText('Required for registration', { exact: true }) + ).toBeVisible() + }) -// 2.4. Enter more than 32 English characters -test('2.4. Enter more than 32 English characters', async ({ page }) => { - const LONG_NAME = 'Ovuvuevuevue Enyetuenwuevue Ugbemugbem Osas' - await page.locator('#familyNamesEng').fill(LONG_NAME) - await page.getByText('Witness 1 details').click() + // 2.4. Enter more than 32 English characters + test('2.4. Enter more than 32 English characters', async ({ page }) => { + const LONG_NAME = 'Ovuvuevuevue Enyetuenwuevue Ugbemugbem Osas' + await page.locator('#familyNamesEng').fill(LONG_NAME) + await page.getByText('Witness 1 details').click() - await expect(page.locator('#familyNamesEng')).toHaveValue( - LONG_NAME.slice(0, 32) - ) -}) -// Done -test('3. Select any to the following option from Relationship to spouses:', async ({ - page -}) => { - // label: "Relationship to spouses" input id: "#relationship" - await page.locator('#relationship').click() - await page.getByText('Other', { exact: true }).click() - await expect(page.getByText('Other', { exact: true })).toBeVisible() -}) -// Done -test('4. Click continue', async ({ page }) => { - await page.getByText('Continue', { exact: true }).click() - await expect( - page.getByText('Witness 2 details', { exact: true }) - ).toBeVisible() -}) + await expect(page.locator('#familyNamesEng')).toHaveValue( + LONG_NAME.slice(0, 32) + ) + }) + // Done + test('3. Select any to the following option from Relationship to spouses:', async ({ + page + }) => { + // label: "Relationship to spouses" input id: "#relationship" + await page.locator('#relationship').click() + await page.getByText('Other', { exact: true }).click() + await expect(page.getByText('Other', { exact: true })).toBeVisible() + }) + // Done + test('4. Click continue', async ({ page }) => { + await page.getByText('Continue', { exact: true }).click() + await expect( + page.getByText('Witness 2 details', { exact: true }) + ).toBeVisible() + }) }) From 0d025af8fe3e7a436a03f2c2982d1c8ea0b0a8c1 Mon Sep 17 00:00:00 2001 From: Eezi Date: Sun, 23 Jun 2024 17:44:42 +0300 Subject: [PATCH 04/11] Fixed wrong page title and tried to fix headless test fails --- .../7-validate-witness-1-page.spec.ts | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts index eae6d13d2..2c7522e71 100644 --- a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts +++ b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts @@ -17,18 +17,15 @@ test.describe('7. Validate Witness 1 details page', () => { // 1.1. Enter Non-English characters test('1.1. Validate "First Name(s)" text field', async ({ page }) => { await page.locator('#firstNamesEng').fill('*') - await expect( - page.getByText( - `Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)`, - { exact: true } - ) - ).toBeVisible() + await expect(page.locator('#firstNamesEng_error')).toHaveText( + `Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)` + ) }) // 1.2. Enter less than 33 English characters test('1.2. Enter less than 33 English characters', async ({ page }) => { await page.locator('#firstNamesEng').fill('Rakibul Islam') - await page.getByText('Birth declaration').click() + await page.getByText('Witness 1 details').click() await expect(page.locator('#firstNamesEng_error')).toBeHidden() }) @@ -55,13 +52,10 @@ test.describe('7. Validate Witness 1 details page', () => { // 2.1. Enter Non-English characters test('2.1. Validate "Last Name(s)" text field', async ({ page }) => { - await page.locator('#familyNameEng').fill('O’Neill') - await expect( - page.getByText( - `Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)`, - { exact: true } - ) - ).toBeVisible() + await page.locator('#familyNameEng').fill('*') + await expect(page.locator('#familyNamesEng_error')).toHaveText( + `Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)` + ) }) // 2.2. Enter less than 33 English characters From 2864ac5a4ceb25198ce9b1b4a174cea5433d174c Mon Sep 17 00:00:00 2001 From: Eezi Date: Mon, 24 Jun 2024 20:58:43 +0300 Subject: [PATCH 05/11] Fixed broken tests --- .../marriage/7-validate-witness-1-page.spec.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts index 2c7522e71..afd4c4ab4 100644 --- a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts +++ b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts @@ -17,6 +17,7 @@ test.describe('7. Validate Witness 1 details page', () => { // 1.1. Enter Non-English characters test('1.1. Validate "First Name(s)" text field', async ({ page }) => { await page.locator('#firstNamesEng').fill('*') + await page.getByText('Witness 1 details').click() await expect(page.locator('#firstNamesEng_error')).toHaveText( `Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)` ) @@ -53,17 +54,16 @@ test.describe('7. Validate Witness 1 details page', () => { // 2.1. Enter Non-English characters test('2.1. Validate "Last Name(s)" text field', async ({ page }) => { await page.locator('#familyNameEng').fill('*') - await expect(page.locator('#familyNamesEng_error')).toHaveText( - `Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)` - ) + await page.getByText('Witness 1 details').click() + await expect(page.locator('#familyNameEng_error')).toBeVisible() }) // 2.2. Enter less than 33 English characters test('2.2. Enter less than 33 English characters', async ({ page }) => { - await page.locator('#familyNamesEng').fill('Rakibul Islam') + await page.locator('#familyNameEng').fill('Rakibul Islam') await page.getByText('Witness 1 details').click() - await expect(page.locator('#familyNamesEng_error')).toBeHidden() + await expect(page.locator('#familyNameEng_error')).toBeHidden() }) // 2.3. Enter Field as NULL @@ -78,14 +78,13 @@ test.describe('7. Validate Witness 1 details page', () => { // 2.4. Enter more than 32 English characters test('2.4. Enter more than 32 English characters', async ({ page }) => { const LONG_NAME = 'Ovuvuevuevue Enyetuenwuevue Ugbemugbem Osas' - await page.locator('#familyNamesEng').fill(LONG_NAME) + await page.locator('#familyNameEng').fill(LONG_NAME) await page.getByText('Witness 1 details').click() - await expect(page.locator('#familyNamesEng')).toHaveValue( + await expect(page.locator('#familyNameEng')).toHaveValue( LONG_NAME.slice(0, 32) ) }) - // Done test('3. Select any to the following option from Relationship to spouses:', async ({ page }) => { From c5e5092a6fe5746cc42e82ce54bf319be5a17b27 Mon Sep 17 00:00:00 2001 From: Eezi Date: Mon, 24 Jun 2024 21:17:38 +0300 Subject: [PATCH 06/11] Removed useless comment --- e2e/testcases/marriage/7-validate-witness-1-page.spec.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts index afd4c4ab4..b1c1259ff 100644 --- a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts +++ b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts @@ -88,12 +88,10 @@ test.describe('7. Validate Witness 1 details page', () => { test('3. Select any to the following option from Relationship to spouses:', async ({ page }) => { - // label: "Relationship to spouses" input id: "#relationship" await page.locator('#relationship').click() await page.getByText('Other', { exact: true }).click() await expect(page.getByText('Other', { exact: true })).toBeVisible() }) - // Done test('4. Click continue', async ({ page }) => { await page.getByText('Continue', { exact: true }).click() await expect( From 46520412dbd474d9e16aa9adb54b3705b7b9ed43 Mon Sep 17 00:00:00 2001 From: Eezi Date: Tue, 25 Jun 2024 20:16:56 +0300 Subject: [PATCH 07/11] Modified goToSection helper method to support marriage declaration --- e2e/helpers.ts | 18 ++++++++++++++---- .../marriage/7-validate-witness-1-page.spec.ts | 8 ++------ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/e2e/helpers.ts b/e2e/helpers.ts index 0c266d2ed..24b3518f0 100644 --- a/e2e/helpers.ts +++ b/e2e/helpers.ts @@ -45,10 +45,20 @@ export async function getToken(username: string, password: string) { return verifyBody.token } -export const goToSection = async ( - page: Page, - section: 'child' | 'informant' | 'father' | 'mother' | 'documents' | 'preview' -) => { +type DeclarationSection = + | 'child' + | 'informant' + | 'father' + | 'mother' + | 'documents' + | 'preview' + | 'groom' + | 'bride' + | 'marriageEvent' + | 'witnessOne' + | 'witnessTwo' + +export const goToSection = async (page: Page, section: DeclarationSection) => { while (!page.url().includes(section)) { await page.getByRole('button', { name: 'Continue' }).click() } diff --git a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts index b1c1259ff..c2ba14de7 100644 --- a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts +++ b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts @@ -1,5 +1,5 @@ import { expect, test } from '@playwright/test' -import { createPIN, login } from '../../helpers' +import { createPIN, login, goToSection } from '../../helpers' test.describe('7. Validate Witness 1 details page', () => { test.beforeEach(async ({ page }) => { @@ -7,11 +7,7 @@ test.describe('7. Validate Witness 1 details page', () => { await createPIN(page) await page.click('#header_new_event') await page.getByText('Marriage', { exact: true }).click() - await page.getByText('Continue', { exact: true }).click() - await page.getByText('Continue', { exact: true }).click() - await page.getByText('Continue', { exact: true }).click() - await page.getByText('Continue', { exact: true }).click() - await page.getByText('Continue', { exact: true }).click() + goToSection(page, 'witnessOne') }) // 1.1. Enter Non-English characters From b5b33abe14567cec05d82d1000fb8f96e00883cc Mon Sep 17 00:00:00 2001 From: Tomi Salo <54830004+Eezi@users.noreply.github.com> Date: Sat, 6 Jul 2024 10:16:07 +0300 Subject: [PATCH 08/11] Update e2e/testcases/marriage/7-validate-witness-1-page.spec.ts Co-authored-by: Jamil --- e2e/testcases/marriage/7-validate-witness-1-page.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts index c2ba14de7..6d4ecdc3b 100644 --- a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts +++ b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts @@ -8,7 +8,7 @@ test.describe('7. Validate Witness 1 details page', () => { await page.click('#header_new_event') await page.getByText('Marriage', { exact: true }).click() goToSection(page, 'witnessOne') - }) + await goToSection(page, 'witnessOne') // 1.1. Enter Non-English characters test('1.1. Validate "First Name(s)" text field', async ({ page }) => { From d5576a05872906c66cfd9aad12a54a77ff5e748b Mon Sep 17 00:00:00 2001 From: Tomi Salo <54830004+Eezi@users.noreply.github.com> Date: Thu, 18 Jul 2024 08:35:57 +0300 Subject: [PATCH 09/11] Update e2e/testcases/marriage/7-validate-witness-1-page.spec.ts Co-authored-by: Jamil --- e2e/testcases/marriage/7-validate-witness-1-page.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts index 6d4ecdc3b..92274a60e 100644 --- a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts +++ b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts @@ -7,7 +7,7 @@ test.describe('7. Validate Witness 1 details page', () => { await createPIN(page) await page.click('#header_new_event') await page.getByText('Marriage', { exact: true }).click() - goToSection(page, 'witnessOne') + await goToSection(page, 'witnessOne') await goToSection(page, 'witnessOne') // 1.1. Enter Non-English characters From c1fbde2014d6f1335643996489c0deb9fdbc40ef Mon Sep 17 00:00:00 2001 From: Eezi Date: Thu, 18 Jul 2024 19:26:25 +0300 Subject: [PATCH 10/11] Fixed syntax error and removed dublicated goToSection call --- .../7-validate-witness-1-page.spec.ts | 146 +++++++++--------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts index 92274a60e..d2975af42 100644 --- a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts +++ b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts @@ -8,90 +8,90 @@ test.describe('7. Validate Witness 1 details page', () => { await page.click('#header_new_event') await page.getByText('Marriage', { exact: true }).click() await goToSection(page, 'witnessOne') - await goToSection(page, 'witnessOne') - // 1.1. Enter Non-English characters - test('1.1. Validate "First Name(s)" text field', async ({ page }) => { - await page.locator('#firstNamesEng').fill('*') - await page.getByText('Witness 1 details').click() - await expect(page.locator('#firstNamesEng_error')).toHaveText( - `Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)` - ) - }) + // 1.1. Enter Non-English characters + test('1.1. Validate "First Name(s)" text field', async ({ page }) => { + await page.locator('#firstNamesEng').fill('*') + await page.getByText('Witness 1 details').click() + await expect(page.locator('#firstNamesEng_error')).toHaveText( + `Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)` + ) + }) - // 1.2. Enter less than 33 English characters - test('1.2. Enter less than 33 English characters', async ({ page }) => { - await page.locator('#firstNamesEng').fill('Rakibul Islam') - await page.getByText('Witness 1 details').click() + // 1.2. Enter less than 33 English characters + test('1.2. Enter less than 33 English characters', async ({ page }) => { + await page.locator('#firstNamesEng').fill('Rakibul Islam') + await page.getByText('Witness 1 details').click() - await expect(page.locator('#firstNamesEng_error')).toBeHidden() - }) + await expect(page.locator('#firstNamesEng_error')).toBeHidden() + }) - // 1.3. Enter Field as NULL - test('1.3. Enter Field as NULL', async ({ page }) => { - await page.locator('#firstNamesEng').click() - await page.locator('#relationship').click() - await expect( - page.getByText('Required for registration', { exact: true }) - ).toBeVisible() - }) + // 1.3. Enter Field as NULL + test('1.3. Enter Field as NULL', async ({ page }) => { + await page.locator('#firstNamesEng').click() + await page.locator('#relationship').click() + await expect( + page.getByText('Required for registration', { exact: true }) + ).toBeVisible() + }) - // 1.4. Enter more than 32 English characters - test('1.4. Enter more than 32 English characters', async ({ page }) => { - const LONG_NAME = 'Ovuvuevuevue Enyetuenwuevue Ugbemugbem Osas' - await page.locator('#firstNamesEng').fill(LONG_NAME) - await page.getByText('Witness 1 details').click() + // 1.4. Enter more than 32 English characters + test('1.4. Enter more than 32 English characters', async ({ page }) => { + const LONG_NAME = 'Ovuvuevuevue Enyetuenwuevue Ugbemugbem Osas' + await page.locator('#firstNamesEng').fill(LONG_NAME) + await page.getByText('Witness 1 details').click() - await expect(page.locator('#firstNamesEng')).toHaveValue( - LONG_NAME.slice(0, 32) - ) - }) + await expect(page.locator('#firstNamesEng')).toHaveValue( + LONG_NAME.slice(0, 32) + ) + }) - // 2.1. Enter Non-English characters - test('2.1. Validate "Last Name(s)" text field', async ({ page }) => { - await page.locator('#familyNameEng').fill('*') - await page.getByText('Witness 1 details').click() - await expect(page.locator('#familyNameEng_error')).toBeVisible() - }) + // 2.1. Enter Non-English characters + test('2.1. Validate "Last Name(s)" text field', async ({ page }) => { + await page.locator('#familyNameEng').fill('*') + await page.getByText('Witness 1 details').click() + await expect(page.locator('#familyNameEng_error')).toBeVisible() + }) - // 2.2. Enter less than 33 English characters - test('2.2. Enter less than 33 English characters', async ({ page }) => { - await page.locator('#familyNameEng').fill('Rakibul Islam') - await page.getByText('Witness 1 details').click() + // 2.2. Enter less than 33 English characters + test('2.2. Enter less than 33 English characters', async ({ page }) => { + await page.locator('#familyNameEng').fill('Rakibul Islam') + await page.getByText('Witness 1 details').click() - await expect(page.locator('#familyNameEng_error')).toBeHidden() - }) + await expect(page.locator('#familyNameEng_error')).toBeHidden() + }) - // 2.3. Enter Field as NULL - test('2.3. Enter Field as NULL', async ({ page }) => { - await page.locator('#familyNameEng').click() - await page.locator('#relationship').click() - await expect( - page.getByText('Required for registration', { exact: true }) - ).toBeVisible() - }) + // 2.3. Enter Field as NULL + test('2.3. Enter Field as NULL', async ({ page }) => { + await page.locator('#familyNameEng').click() + await page.locator('#relationship').click() + await expect( + page.getByText('Required for registration', { exact: true }) + ).toBeVisible() + }) - // 2.4. Enter more than 32 English characters - test('2.4. Enter more than 32 English characters', async ({ page }) => { - const LONG_NAME = 'Ovuvuevuevue Enyetuenwuevue Ugbemugbem Osas' - await page.locator('#familyNameEng').fill(LONG_NAME) - await page.getByText('Witness 1 details').click() + // 2.4. Enter more than 32 English characters + test('2.4. Enter more than 32 English characters', async ({ page }) => { + const LONG_NAME = 'Ovuvuevuevue Enyetuenwuevue Ugbemugbem Osas' + await page.locator('#familyNameEng').fill(LONG_NAME) + await page.getByText('Witness 1 details').click() - await expect(page.locator('#familyNameEng')).toHaveValue( - LONG_NAME.slice(0, 32) - ) - }) - test('3. Select any to the following option from Relationship to spouses:', async ({ - page - }) => { - await page.locator('#relationship').click() - await page.getByText('Other', { exact: true }).click() - await expect(page.getByText('Other', { exact: true })).toBeVisible() - }) - test('4. Click continue', async ({ page }) => { - await page.getByText('Continue', { exact: true }).click() - await expect( - page.getByText('Witness 2 details', { exact: true }) - ).toBeVisible() + await expect(page.locator('#familyNameEng')).toHaveValue( + LONG_NAME.slice(0, 32) + ) + }) + test('3. Select any to the following option from Relationship to spouses:', async ({ + page + }) => { + await page.locator('#relationship').click() + await page.getByText('Other', { exact: true }).click() + await expect(page.getByText('Other', { exact: true })).toBeVisible() + }) + test('4. Click continue', async ({ page }) => { + await page.getByText('Continue', { exact: true }).click() + await expect( + page.getByText('Witness 2 details', { exact: true }) + ).toBeVisible() + }) }) }) From 5bb20b8b107633360abc6b50e881bf6e3642af46 Mon Sep 17 00:00:00 2001 From: Eezi Date: Mon, 29 Jul 2024 10:08:21 +0300 Subject: [PATCH 11/11] Fixed beforeEach to end in correct spot --- .../7-validate-witness-1-page.spec.ts | 146 +++++++++--------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts index d2975af42..9404179bb 100644 --- a/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts +++ b/e2e/testcases/marriage/7-validate-witness-1-page.spec.ts @@ -8,90 +8,90 @@ test.describe('7. Validate Witness 1 details page', () => { await page.click('#header_new_event') await page.getByText('Marriage', { exact: true }).click() await goToSection(page, 'witnessOne') + }) - // 1.1. Enter Non-English characters - test('1.1. Validate "First Name(s)" text field', async ({ page }) => { - await page.locator('#firstNamesEng').fill('*') - await page.getByText('Witness 1 details').click() - await expect(page.locator('#firstNamesEng_error')).toHaveText( - `Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)` - ) - }) + // 1.1. Enter Non-English characters + test('1.1. Validate "First Name(s)" text field', async ({ page }) => { + await page.locator('#firstNamesEng').fill('*') + await page.getByText('Witness 1 details').click() + await expect(page.locator('#firstNamesEng_error')).toHaveText( + `Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)` + ) + }) - // 1.2. Enter less than 33 English characters - test('1.2. Enter less than 33 English characters', async ({ page }) => { - await page.locator('#firstNamesEng').fill('Rakibul Islam') - await page.getByText('Witness 1 details').click() + // 1.2. Enter less than 33 English characters + test('1.2. Enter less than 33 English characters', async ({ page }) => { + await page.locator('#firstNamesEng').fill('Rakibul Islam') + await page.getByText('Witness 1 details').click() - await expect(page.locator('#firstNamesEng_error')).toBeHidden() - }) + await expect(page.locator('#firstNamesEng_error')).toBeHidden() + }) - // 1.3. Enter Field as NULL - test('1.3. Enter Field as NULL', async ({ page }) => { - await page.locator('#firstNamesEng').click() - await page.locator('#relationship').click() - await expect( - page.getByText('Required for registration', { exact: true }) - ).toBeVisible() - }) + // 1.3. Enter Field as NULL + test('1.3. Enter Field as NULL', async ({ page }) => { + await page.locator('#firstNamesEng').click() + await page.locator('#relationship').click() + await expect( + page.getByText('Required for registration', { exact: true }) + ).toBeVisible() + }) - // 1.4. Enter more than 32 English characters - test('1.4. Enter more than 32 English characters', async ({ page }) => { - const LONG_NAME = 'Ovuvuevuevue Enyetuenwuevue Ugbemugbem Osas' - await page.locator('#firstNamesEng').fill(LONG_NAME) - await page.getByText('Witness 1 details').click() + // 1.4. Enter more than 32 English characters + test('1.4. Enter more than 32 English characters', async ({ page }) => { + const LONG_NAME = 'Ovuvuevuevue Enyetuenwuevue Ugbemugbem Osas' + await page.locator('#firstNamesEng').fill(LONG_NAME) + await page.getByText('Witness 1 details').click() - await expect(page.locator('#firstNamesEng')).toHaveValue( - LONG_NAME.slice(0, 32) - ) - }) + await expect(page.locator('#firstNamesEng')).toHaveValue( + LONG_NAME.slice(0, 32) + ) + }) - // 2.1. Enter Non-English characters - test('2.1. Validate "Last Name(s)" text field', async ({ page }) => { - await page.locator('#familyNameEng').fill('*') - await page.getByText('Witness 1 details').click() - await expect(page.locator('#familyNameEng_error')).toBeVisible() - }) + // 2.1. Enter Non-English characters + test('2.1. Validate "Last Name(s)" text field', async ({ page }) => { + await page.locator('#familyNameEng').fill('*') + await page.getByText('Witness 1 details').click() + await expect(page.locator('#familyNameEng_error')).toBeVisible() + }) - // 2.2. Enter less than 33 English characters - test('2.2. Enter less than 33 English characters', async ({ page }) => { - await page.locator('#familyNameEng').fill('Rakibul Islam') - await page.getByText('Witness 1 details').click() + // 2.2. Enter less than 33 English characters + test('2.2. Enter less than 33 English characters', async ({ page }) => { + await page.locator('#familyNameEng').fill('Rakibul Islam') + await page.getByText('Witness 1 details').click() - await expect(page.locator('#familyNameEng_error')).toBeHidden() - }) + await expect(page.locator('#familyNameEng_error')).toBeHidden() + }) - // 2.3. Enter Field as NULL - test('2.3. Enter Field as NULL', async ({ page }) => { - await page.locator('#familyNameEng').click() - await page.locator('#relationship').click() - await expect( - page.getByText('Required for registration', { exact: true }) - ).toBeVisible() - }) + // 2.3. Enter Field as NULL + test('2.3. Enter Field as NULL', async ({ page }) => { + await page.locator('#familyNameEng').click() + await page.locator('#relationship').click() + await expect( + page.getByText('Required for registration', { exact: true }) + ).toBeVisible() + }) - // 2.4. Enter more than 32 English characters - test('2.4. Enter more than 32 English characters', async ({ page }) => { - const LONG_NAME = 'Ovuvuevuevue Enyetuenwuevue Ugbemugbem Osas' - await page.locator('#familyNameEng').fill(LONG_NAME) - await page.getByText('Witness 1 details').click() + // 2.4. Enter more than 32 English characters + test('2.4. Enter more than 32 English characters', async ({ page }) => { + const LONG_NAME = 'Ovuvuevuevue Enyetuenwuevue Ugbemugbem Osas' + await page.locator('#familyNameEng').fill(LONG_NAME) + await page.getByText('Witness 1 details').click() - await expect(page.locator('#familyNameEng')).toHaveValue( - LONG_NAME.slice(0, 32) - ) - }) - test('3. Select any to the following option from Relationship to spouses:', async ({ - page - }) => { - await page.locator('#relationship').click() - await page.getByText('Other', { exact: true }).click() - await expect(page.getByText('Other', { exact: true })).toBeVisible() - }) - test('4. Click continue', async ({ page }) => { - await page.getByText('Continue', { exact: true }).click() - await expect( - page.getByText('Witness 2 details', { exact: true }) - ).toBeVisible() - }) + await expect(page.locator('#familyNameEng')).toHaveValue( + LONG_NAME.slice(0, 32) + ) + }) + test('3. Select any to the following option from Relationship to spouses:', async ({ + page + }) => { + await page.locator('#relationship').click() + await page.getByText('Other', { exact: true }).click() + await expect(page.getByText('Other', { exact: true })).toBeVisible() + }) + test('4. Click continue', async ({ page }) => { + await page.getByText('Continue', { exact: true }).click() + await expect( + page.getByText('Witness 2 details', { exact: true }) + ).toBeVisible() }) })