forked from opencrvs/opencrvs-countryconfig
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Marriage testcase 7 #1024
Merged
Merged
Marriage testcase 7 #1024
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5508fe1
Started doing marriage testcase 7
Eezi 949eb2f
Added familyName validation tests
Eezi 6e01365
Fixed syntax error
Eezi 0d025af
Fixed wrong page title and tried to fix headless test fails
Eezi 2864ac5
Fixed broken tests
Eezi c5e5092
Removed useless comment
Eezi 4652041
Modified goToSection helper method to support marriage declaration
Eezi b5b33ab
Update e2e/testcases/marriage/7-validate-witness-1-page.spec.ts
Eezi d5576a0
Update e2e/testcases/marriage/7-validate-witness-1-page.spec.ts
Eezi c1fbde2
Fixed syntax error and removed dublicated goToSection call
Eezi 5bb20b8
Fixed beforeEach to end in correct spot
Eezi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import { expect, test } from '@playwright/test' | ||
import { createPIN, login, goToSection } 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 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.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() | ||
}) | ||
|
||
// 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() | ||
|
||
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.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() | ||
}) | ||
|
||
// 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() | ||
|
||
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() | ||
}) | ||
}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test.beforeEach
should end hereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad you noticed this!👌🏼