diff --git a/test/browser/features/DVA_Driving_Licence.feature b/test/browser/features/DVA_Driving_Licence.feature index 094d81d0..ca5791dd 100644 --- a/test/browser/features/DVA_Driving_Licence.feature +++ b/test/browser/features/DVA_Driving_Licence.feature @@ -15,6 +15,7 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then I see the DVA licence number error in the summary as Your licence number should be 8 characters long And I can see the DVA licence number error in the field as Your licence number should be 8 characters long + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidLicenceNumber| |DrivingLicenceSubjectHappyBilly|5566778 | @@ -26,6 +27,7 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then I see the DVA licence number error in the summary as Your licence number should not include any symbols or spaces And I can see the DVA licence number error in the field as Your licence number should not include any symbols or spaces + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidLicenceNumber| |DrivingLicenceSubjectHappyBilly|55667^&* | @@ -38,6 +40,7 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then I see the DVA licence number error in the summary as Enter the number exactly as it appears on your driving licence And I can see the DVA licence number error in the field as Enter the number exactly as it appears on your driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidLicenceNumber| |DrivingLicenceSubjectHappyBilly|55667ABC | @@ -51,6 +54,7 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then I see the postcode error in summary as Your postcode should be between 5 and 7 characters And I see the postcode error in field as Your postcode should be between 5 and 7 characters + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidPostcode | |DrivingLicenceSubjectHappyBilly|E20A | @@ -62,6 +66,7 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then I see the postcode error in summary as Enter your postcode And I see the postcode error in field as Enter your postcode + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidPostcode | |DrivingLicenceSubjectHappyBilly| | @@ -73,6 +78,7 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then I see the postcode error in summary as Enter a UK postcode And I see the postcode error in field as Enter a UK postcode + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidPostcode | |DrivingLicenceSubjectHappyBilly|CA 95128 | @@ -85,6 +91,7 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then I see the postcode error in summary as Your postcode should only include numbers and letters And I see the postcode error in field as Your postcode should only include numbers and letters + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidPostcode | |DrivingLicenceSubjectHappyBilly|NW* ^%G | @@ -97,6 +104,7 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then I see the postcode error in summary as Your postcode should include numbers and letters And I see the postcode error in field as Your postcode should include numbers and letters + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidPostcode | |DrivingLicenceSubjectHappyBilly|123 456 | @@ -110,6 +118,7 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then I see the Lastname error in the error summary as Enter your last name as it appears on your driving licence And I see the Lastname error in the error field as Enter your last name as it appears on your driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidLastName | |DrivingLicenceSubjectHappyBilly|KYLE123 | @@ -124,6 +133,7 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then I see the Firstname error summary as Enter your first name as it appears on your driving licence And I see the Firstname error in the error field as Enter your first name as it appears on your driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidFirstName| |DrivingLicenceSubjectHappyBilly|SELINA987 | @@ -138,6 +148,7 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then I see the middlenames error summary as Enter any middle names as they appear on your driving licence And I see the middlenames error in the error field as Enter any middle names as they appear on your driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidMiddleNames| |DrivingLicenceSubjectHappyBilly|SELINA987 | @@ -153,6 +164,7 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then DVA user can see the date of birth error summary as Enter your date of birth as it appears on your driving licence And DVA user can see the date of birth error in the field as Enter your date of birth as it appears on your driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidDayOfBirth|InvalidMonthOfBirth|InvalidYearOfBirth| |DrivingLicenceSubjectHappyBilly| 51 | 71 | 198 | @@ -168,6 +180,7 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then DVA user can see the date of birth error summary as Your date of birth must be in the past And DVA user can see the date of birth error in the field as Your date of birth must be in the past + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidDayOfBirth|InvalidMonthOfBirth|InvalidYearOfBirth| |DrivingLicenceSubjectHappyBilly| 10 | 10 | 2042 | @@ -182,6 +195,7 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then I see DVA issue date error in summary as Enter the date as it appears on your driving licence And I see DVA invalid issue date field error as Enter the date as it appears on your driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidDayOfIssue|InvalidMonthOfIssue|InvalidYearOfIssue| |DrivingLicenceSubjectHappyBilly| AA | BB | AABC | @@ -197,6 +211,7 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then I see DVA issue date error in summary as The issue date must be in the past And I see DVA issue date error in summary as The issue date must be in the past + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidDayOfIssue|InvalidMonthOfIssue|InvalidYearOfIssue| |DrivingLicenceSubjectHappyBilly| 01 | 10 | 2043 | @@ -211,6 +226,7 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then I can see the valid to date error in the error summary as Enter the date as it appears on your driving licence And I can see the Valid to date field error as Enter the date as it appears on your driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidValidToDay|InvalidValidToMonth|InvalidValidToYear| |DrivingLicenceSubjectHappyBilly| AA | BC | AABD | @@ -226,6 +242,19 @@ Feature: DVA Driving licence CRI Error Validations When User clicks on continue Then I can see the valid to date error in the error summary as You cannot use an expired driving licence And I can see the Valid to date field error as You cannot use an expired driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DVADrivingLicenceSubject |InvalidValidToDay|InvalidValidToMonth|InvalidValidToYear| |DrivingLicenceSubjectHappyBilly| 10 | 01 | 2010 | + + @mock-api:dva-ConsentError @validation-regression @build @staging + Scenario Outline: DVA Driving Licence error validation when DVA consent checkbox is unselected + Given User enters DVA data as a + And DVA consent checkbox is unselected + When User clicks on continue + Then I can see the DVA consent error summary as You must give your consent to continue + And I can see the DVA consent error on the checkbox as Error: You must give your consent to continue + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK + Examples: + |DVADrivingLicenceSubject | + |DrivingLicenceSubjectHappyBilly| diff --git a/test/browser/features/DVLADrivingLicence.feature b/test/browser/features/DVLADrivingLicence.feature index 091d483f..ab94361b 100644 --- a/test/browser/features/DVLADrivingLicence.feature +++ b/test/browser/features/DVLADrivingLicence.feature @@ -1,4 +1,4 @@ -@mock-api:dl-success @success @DVLA +@mock-api:dl-failed @success @DVLA Feature: DVLA Driving licence CRI Error Validations Background: @@ -8,7 +8,7 @@ Feature: DVLA Driving licence CRI Error Validations And I click on DVLA radio button and Continue And I should be on the DVLA details entry page Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK - @mock-api:dvla-unhappyPath @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence details page unhappy path when licence number date format does not match with User's Date Of Birth Given User enters DVLA data as a And User re-enters day of birth as @@ -19,148 +19,161 @@ Feature: DVLA Driving licence CRI Error Validations And I can see the licence number error in the field as Enter the number exactly as it appears on your driving licence Then I see the date of birth error summary as Check you have entered your date of birth correctly And I see the date of birth error in the field as Check you have entered your date of birth correctly + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidDayOfBirth|InvalidMonthOfBirth|InvalidYearOfBirth| |DrivingLicenceSubjectHappyPeter| 12 | 08 | 1985 | - @mock-api:dvla-invalidDrivingLicenceNumber @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence number less than 16 characters error validation Given User enters DVLA data as a And User re-enters drivingLicenceNumber as When User clicks on continue Then I see the licence number error in the summary as Your licence number should be 16 characters long And I can see the licence number error in the field as Your licence number should be 16 characters long + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidLicenceNumber| |DrivingLicenceSubjectHappyPeter|PARKE610112PBF | - @mock-api:dvla-invalidDrivingLicenceNumber @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence number with special characters and spaces error validation Given User enters DVLA data as a And User re-enters drivingLicenceNumber as When User clicks on continue Then I see the licence number error in the summary as Your licence number should not include any symbols or spaces And I can see the licence number error in the field as Your licence number should not include any symbols or spaces + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidLicenceNumber| |DrivingLicenceSubjectHappyPeter|12345678901112@@ | ####### DrivingLicenceNumberWithNumericChar, DrivingLicenceNumberWithAlphaChar, NoDrivingLicenceNumber ####### - @mock-api:dvla-invalidDrivingLicenceNumber @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence number with numeric characters or alpha characters or no licence number error validation Given User enters DVLA data as a And User re-enters drivingLicenceNumber as When User clicks on continue Then I see the licence number error in the summary as Enter the number exactly as it appears on your driving licence And I can see the licence number error in the field as Enter the number exactly as it appears on your driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidLicenceNumber| |DrivingLicenceSubjectHappyPeter|1234567890111213 | |DrivingLicenceSubjectHappyPeter|abcdefghijklomnp | |DrivingLicenceSubjectHappyPeter| | - @mock-api:dvla-invalidIssueNumber @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence Issue number less than 2 characters error validation Given User enters DVLA data as a And User re-enters issue number as When User clicks on continue Then I see the issue number error in summary as Your issue number should be 2 numbers long And I see the issue number error in field as Your issue number should be 2 numbers long + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidIssueNumber| |DrivingLicenceSubjectHappyPeter|1 | - @mock-api:dvla-invalidIssueNumber @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence Issue number with special characters error validation Given User enters DVLA data as a And User re-enters issue number as When User clicks on continue Then I see the issue number error in summary as Your issue number should not include any symbols or spaces And I see the issue number error in field as Your issue number should not include any symbols or spaces + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidIssueNumber| |DrivingLicenceSubjectHappyPeter|A@ | ##### IssueNumberWithAlphanumericChar, IssueNumberWithAlphaChar, NoIssueNumber ##### - @mock-api:dvla-invalidIssueNumber @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence Issue number with alphanumeric characters or alpha characters No issue number error validation Given User enters DVLA data as a And User re-enters issue number as When User clicks on continue Then I see the issue number error in summary as Enter the issue number as it appears on your driving licence And I see the issue number error in field as Enter the issue number as it appears on your driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidIssueNumber| |DrivingLicenceSubjectHappyPeter|A1 | |DrivingLicenceSubjectHappyPeter|AB | |DrivingLicenceSubjectHappyPeter| | - @mock-api:dvla-invalidPostcode @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence Postcode less than 5 characters error validation Given User enters DVLA data as a And User re-enters postcode as When User clicks on continue Then I see the postcode error in summary as Your postcode should be between 5 and 7 characters And I see the postcode error in field as Your postcode should be between 5 and 7 characters + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidPostcode | |DrivingLicenceSubjectHappyPeter|E20A | - @mock-api:dvla-invalidPostcode @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence - No Postcode in the Postcode field error validation Given User enters DVLA data as a And User re-enters postcode as When User clicks on continue Then I see the postcode error in summary as Enter your postcode And I see the postcode error in field as Enter your postcode + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidPostcode | |DrivingLicenceSubjectHappyPeter| | - @mock-api:dvla-invalidPostcode @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence International Postcode error validation Given User enters DVLA data as a And User re-enters postcode as When User clicks on continue Then I see the postcode error in summary as Enter a UK postcode And I see the postcode error in field as Enter a UK postcode + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidPostcode | |DrivingLicenceSubjectHappyPeter|CA 95128 | ##### PostcodeWithSpecialChar ##### - @mock-api:dvla-invalidPostcode @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence Postcode with special characters error validation Given User enters DVLA data as a And User re-enters postcode as When User clicks on continue Then I see the postcode error in summary as Your postcode should only include numbers and letters And I see the postcode error in field as Your postcode should only include numbers and letters + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidPostcode | |DrivingLicenceSubjectHappyPeter|NW* ^%G | ###### PostcodeWithNumericChar, PostcodeWithAlphaChar ##### - @mock-api:dvla-invalidPostcode @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence Postcode with numeric characters or alpha characters error validation Given User enters DVLA data as a And User re-enters postcode as When User clicks on continue Then I see the postcode error in summary as Your postcode should include numbers and letters And I see the postcode error in field as Your postcode should include numbers and letters + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidPostcode | |DrivingLicenceSubjectHappyPeter|123 456 | |DrivingLicenceSubjectHappyPeter|ABC XYZ | ###### InvalidLastNameWithNumbers, InvalidLastNameWithSpecialCharacters, NoLastName ##### - @mock-api:dvla-invalidLastName @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence Last name with numbers or special characters or no last name error validation Given User enters DVLA data as a And User re-enters last name as When User clicks on continue Then I see the Lastname error in the error summary as Enter your last name as it appears on your driving licence And I see the Lastname error in the error field as Enter your last name as it appears on your driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidLastName | |DrivingLicenceSubjectHappyPeter|KYLE123 | @@ -168,13 +181,14 @@ Feature: DVLA Driving licence CRI Error Validations |DrivingLicenceSubjectHappyPeter| | ###### InvalidFirstNameWithNumbers, InvalidFirstNameWithSpecialCharacters, NoFirstName ##### - @mock-api:dvla-invalidFirstName @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence First name with numbers or special characters or no first name error validation Given User enters DVLA data as a And User re-enters first name as When User clicks on continue Then I see the Firstname error summary as Enter your first name as it appears on your driving licence And I see the Firstname error in the error field as Enter your first name as it appears on your driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidFirstName| |DrivingLicenceSubjectHappyPeter|SELINA987 | @@ -182,20 +196,21 @@ Feature: DVLA Driving licence CRI Error Validations |DrivingLicenceSubjectHappyPeter| | ###### InvalidMiddleNamesWithNumbers, InvalidMiddleNamesWithSpecialCharacters ##### - @mock-api:dvla-invalidMiddleNames @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence Middle names with numbers or special characters error validation Given User enters DVLA data as a And User re-enters middle names as When User clicks on continue Then I see the middlenames error summary as Enter any middle names as they appear on your driving licence And I see the middlenames error in the error field as Enter any middle names as they appear on your driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidMiddleNames| |DrivingLicenceSubjectHappyPeter|SELINA987 | |DrivingLicenceSubjectHappyPeter|SELINA%$@ | ##### DateOfBirthWithSpecialCharacters, DateOfBirthNotReal, NoDateOfBirth ##### - @mock-api:dvla-invalidDateOfBirth @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence Date of birth that are not real or with special characters or no date of birth error validation Given User enters DVLA data as a And User re-enters day of birth as @@ -204,6 +219,7 @@ Feature: DVLA Driving licence CRI Error Validations When User clicks on continue Then I see the date of birth error summary as Enter your date of birth as it appears on your driving licence And I see the date of birth error in the field as Enter your date of birth as it appears on your driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidDayOfBirth|InvalidMonthOfBirth|InvalidYearOfBirth| |DrivingLicenceSubjectHappyPeter| @ | *& | 19 7 | @@ -211,7 +227,7 @@ Feature: DVLA Driving licence CRI Error Validations # DVLA Driving licence with no date of birth scenario is not displaying the expected error message and has been raised as a bug LIME-694 # |DrivingLicenceSubjectHappyPeter| | | | - @mock-api:dvla-invalidDateOfBirth @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence Date of birth in the future error validation Given User enters DVLA data as a And User re-enters day of birth as @@ -220,12 +236,13 @@ Feature: DVLA Driving licence CRI Error Validations When User clicks on continue Then I see the date of birth error summary as Your date of birth must be in the past And I see the date of birth error in the field as Your date of birth must be in the past + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidDayOfBirth|InvalidMonthOfBirth|InvalidYearOfBirth| |DrivingLicenceSubjectHappyPeter| 10 | 10 | 2042 | ##### InvalidIssueDate, NoIssueDate ##### - @mock-api:dvla-invalidIssueDate @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence Issue date that are not real or with special characters or no issue date error validation Given User enters DVLA data as a And User re-enters day of issue as @@ -234,13 +251,14 @@ Feature: DVLA Driving licence CRI Error Validations When User clicks on continue Then I see issue date error in summary as Enter the date as it appears on your driving licence And I see invalid issue date field error as Enter the date as it appears on your driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidDayOfIssue|InvalidMonthOfIssue|InvalidYearOfIssue| |DrivingLicenceSubjectHappyPeter| AA | BB | AABC | |DrivingLicenceSubjectHappyPeter| & | ^% | £$ ^ | |DrivingLicenceSubjectHappyPeter| | | | - @mock-api:dvla-invalidIssueDate @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence Issue date in the future error validation Given User enters DVLA data as a And User re-enters day of issue as @@ -249,12 +267,13 @@ Feature: DVLA Driving licence CRI Error Validations When User clicks on continue Then I see issue date error in summary as The issue date must be in the past And I see invalid issue date field error as The issue date must be in the past + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidDayOfIssue|InvalidMonthOfIssue|InvalidYearOfIssue| |DrivingLicenceSubjectHappyPeter| 01 | 10 | 2043 | ##### InvalidValidToDate, ValidToDateWithSpecialCharacters, NoValidToDate ##### - @mock-api:dvla-invalidExpiryDate @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence Valid to date that are not real or with special characters or no valid to date error validation Given User enters DVLA data as a And User re-enters valid to day as @@ -263,13 +282,14 @@ Feature: DVLA Driving licence CRI Error Validations When User clicks on continue Then I can see the valid to date error in the error summary as Enter the date as it appears on your driving licence And I can see the Valid to date field error as Enter the date as it appears on your driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidValidToDay|InvalidValidToMonth|InvalidValidToYear| |DrivingLicenceSubjectHappyPeter| AA | BC | AABD | |DrivingLicenceSubjectHappyPeter| !@ | £$ | %^ * | |DrivingLicenceSubjectHappyPeter| | | | - @mock-api:dvla-invalidExpiryDate @validation-regression @build @staging + @mock-api:dl-success @validation-regression @build @staging Scenario Outline: DVLA Driving Licence Valid to date in the past error validation Given User enters DVLA data as a And User re-enters valid to day as @@ -278,6 +298,105 @@ Feature: DVLA Driving licence CRI Error Validations When User clicks on continue Then I can see the valid to date error in the error summary as You cannot use an expired driving licence And I can see the Valid to date field error as You cannot use an expired driving licence + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK Examples: |DrivingLicenceSubject |InvalidValidToDay|InvalidValidToMonth|InvalidValidToYear| |DrivingLicenceSubjectHappyPeter| 10 | 01 | 2010 | + + @mock-api:dl-success @validation-regression @build @staging + Scenario Outline: DVLA Driving Licence error validation when DVLA consent checkbox is unselected + Given User enters DVLA data as a + And DVLA consent checkbox is unselected + When User clicks on continue + And I can see the DVLA consent error on the checkbox as Error: You must give your consent to continue + Then I can see the DVLA consent error summary as You must give your consent to continue + And I check the page Title Error: Enter your details exactly as they appear on your UK driving licence – Prove your identity – GOV.UK + Examples: + |DrivingLicenceSubject | + |DrivingLicenceSubjectHappyPeter | + + @mock-api:dl-failed @validation-regression @build @staging + Scenario Outline: DVLA Driving Licence number validation test - Correct licence number structure - error validation + Given User enters DVLA data as a + And User re-enters drivingLicenceNumber as + When User clicks on continue + Then Proper error message is displayed as We could not find your details + Examples: + |DrivingLicenceSubject | InvalidLicenceNumber | + |DrivingLicenceSubjectHappyKenneth| DECER657085K99LN | + + @mock-api:dl-failed @validation-regression @build @staging + Scenario Outline: DVLA Driving Licence number validation test - (VALID, female licenceNumber DOB Jan) + Given User enters DVLA data as a + And User re-enters drivingLicenceNumber as + And User re-enters day of birth as + And User re-enters month of birth as + And User re-enters year of birth as + When User clicks on continue + Then Proper error message is displayed as We could not find your details + Examples: + |DrivingLicenceSubject |InvalidLicenceNumber|InvalidDayOfBirth|InvalidMonthOfBirth|InvalidYearOfBirth| + |DrivingLicenceSubjectHappyKenneth| DECER651085K99LN | 08 | 01 | 1965 | + + @mock-api:dl-failed @validation-regression @build @staging + Scenario Outline: DVLA Driving Licence number validation test - (VALID, female licenceNumber DOB Dec) + Given User enters DVLA data as a + And User re-enters drivingLicenceNumber as + And User re-enters day of birth as + And User re-enters month of birth as + And User re-enters year of birth as + When User clicks on continue + Then Proper error message is displayed as We could not find your details + Examples: + |DrivingLicenceSubject |InvalidLicenceNumber|InvalidDayOfBirth|InvalidMonthOfBirth|InvalidYearOfBirth| + |DrivingLicenceSubjectHappyKenneth| DECER662085K99LN | 08 | 12 | 1965 | + + @mock-api:dl-failed @validation-regression @build @staging + Scenario Outline: DVLA Driving Licence number validation test - (VALID, licenceNumber DOB Dec) + Given User enters DVLA data as a + And User re-enters drivingLicenceNumber as + And User re-enters day of birth as + And User re-enters month of birth as + And User re-enters year of birth as + When User clicks on continue + Then Proper error message is displayed as We could not find your details + Examples: + |DrivingLicenceSubject |InvalidLicenceNumber|InvalidDayOfBirth |InvalidMonthOfBirth|InvalidYearOfBirth| + |DrivingLicenceSubjectHappyKenneth| DECER612085KE9LN | 08 | 12 | 1965 | + + @mock-api:dl-failed @validation-regression @build @staging + Scenario Outline: DVLA Driving Licence number validation test - (VALID, 1 forename) + Given User enters DVLA data as a + And User re-enters drivingLicenceNumber as + And User re-enters last name as + And User re-enters first name as + When User clicks on continue + Then Proper error message is displayed as We could not find your details + Examples: + |DrivingLicenceSubject |InvalidLicenceNumber|InvalidLastName|InvalidFirstName| + |DrivingLicenceSubjectHappyKenneth|AB999607085J9AAA | JOHN | SMITH | + + @mock-api:dl-failed @validation-regression @build @staging + Scenario Outline: DVLA Driving Licence number validation test - (VALID, surname < 5) + Given User enters DVLA data as a + And User re-enters drivingLicenceNumber as + And User re-enters last name as + And User re-enters first name as + When User clicks on continue + Then Proper error message is displayed as We could not find your details + Examples: + |DrivingLicenceSubject |InvalidLicenceNumber|InvalidLastName|InvalidFirstName| + |DrivingLicenceSubjectHappyKenneth|AB999607085J9AAA | JOHN | AB | + + @mock-api:dl-failed @validation-regression @build @staging + Scenario Outline: DVLA Driving Licence number validation test - (VALID, 2 forenames) + Given User enters DVLA data as a + And User re-enters drivingLicenceNumber as + And User re-enters last name as + And User re-enters first name as + And User re-enters middle names as + When User clicks on continue + Then Proper error message is displayed as We could not find your details + Examples: + |DrivingLicenceSubject |InvalidLicenceNumber |InvalidLastName|InvalidFirstName|InvalidMiddleNames| + |DrivingLicenceSubjectHappyKenneth |AB999607085JAAAA | JOHN | SMITH | A | diff --git a/test/browser/pages/DVADetailsEntryPage.js b/test/browser/pages/DVADetailsEntryPage.js index 2e3d8cdb..675ab395 100644 --- a/test/browser/pages/DVADetailsEntryPage.js +++ b/test/browser/pages/DVADetailsEntryPage.js @@ -60,6 +60,10 @@ exports.DVADetailsEntryPage = class PlaywrightDevPage { 'xpath=//*[@class="govuk-error-summary error-summary"]//*[@class="govuk-error-summary__body"]//*[@class="govuk-list govuk-error-summary__list"]//*[contains(@href,"#dateOfIssue-day")]' ); + this.invalidDVAConsentErrorSummary = this.page.locator("a", { + hasText: "You must give your consent to continue", + }); + // DVA Field errors this.dvaDrivingLicenceFieldError = this.page.locator( @@ -71,6 +75,9 @@ exports.DVADetailsEntryPage = class PlaywrightDevPage { this.invalidDvaIssueDateFieldError = this.page.locator( 'xpath=//*[@id="dateOfIssue-error"]' ); + this.invalidConsentDVAFieldError = this.page.locator( + 'xpath=//*[@id="consentDVACheckbox-error"]' + ); } isCurrentPage() { @@ -83,6 +90,12 @@ exports.DVADetailsEntryPage = class PlaywrightDevPage { expect(await this.page.title()).to.equal(dvaDetailsEntryPageTitle); } + async assertDVAErrorPageTitle(dvaErrorPageTitle) { + await this.page.waitForLoadState("domcontentloaded"); + expect(await this.isCurrentPage()).to.be.true; + expect(await this.page.title()).to.equal(dvaErrorPageTitle); + } + async userEntersDVAData(issuer, drivingLicenceSubjectScenario) { var dvaDrivingLicenceSubject = TestDataCreator.getDVATestUserFromMap( issuer, @@ -198,4 +211,26 @@ exports.DVADetailsEntryPage = class PlaywrightDevPage { fieldErrorText ); } + + async consentDVACheckBoxUnselect() { + await this.page.waitForLoadState("domcontentloaded"); + expect(await this.isCurrentPage()).to.be.true; + return await this.consentDVACheckbox.click(); + } + + async assertConsentDVAErrorSummary(errorSummaryText) { + await this.page.waitForLoadState("domcontentloaded"); + expect(await this.isCurrentPage()).to.be.true; + expect(await this.invalidDVAConsentErrorSummary.innerText()).to.contains( + errorSummaryText + ); + } + + async assertConsentDVAErrorOnField(fieldErrorText) { + await this.page.waitForLoadState("domcontentloaded"); + expect(await this.isCurrentPage()).to.be.true; + expect(await this.invalidConsentDVAFieldError.innerText()).to.contains( + fieldErrorText + ); + } }; diff --git a/test/browser/pages/DrivingLicencePage.js b/test/browser/pages/DrivingLicencePage.js index d5541904..bbeefe52 100644 --- a/test/browser/pages/DrivingLicencePage.js +++ b/test/browser/pages/DrivingLicencePage.js @@ -83,6 +83,9 @@ exports.DrivingLicencePage = class PlaywrightDevPage { this.invalidValidToDateFieldError = this.page.locator( 'xpath=//*[@id="expiryDate-error"]' ); + this.invalidConsentErrorSummary = this.page.locator("a", { + hasText: "You must give your consent to continue", + }); // Field errors @@ -98,6 +101,11 @@ exports.DrivingLicencePage = class PlaywrightDevPage { this.drivingLicenceFieldError = this.page.locator( 'xpath=//*[@id="drivingLicenceNumber-error"]' ); + + this.drivingLicenceRetryMessageHeading = this.page.locator( + 'xpath=//*[@id="main-content"]/div/div/div[1]/div[2]' + ); + this.invalidIssueNumberFieldError = this.page.locator( 'xpath=//*[@id="issueNumber-error"]' ); @@ -117,6 +125,10 @@ exports.DrivingLicencePage = class PlaywrightDevPage { this.Continue = this.page.locator("button", { hasText: " Continue ", }); + + this.invalidConsentErrorFieldError = this.page.locator( + 'xpath=//*[@id="consentCheckbox-error"]' + ); } isCurrentPage() { @@ -302,6 +314,14 @@ exports.DrivingLicencePage = class PlaywrightDevPage { ); } + async assertRetryErrorMessage(retryMessageHeading) { + await this.page.waitForLoadState("domcontentloaded"); + expect(await this.isCurrentPage()).to.be.true; + expect( + await this.drivingLicenceRetryMessageHeading.innerText() + ).to.contains(retryMessageHeading); + } + async assertInvalidIssueNumberInErrorSummary(errorSummaryText) { await this.page.waitForLoadState("domcontentloaded"); expect(await this.isCurrentPage()).to.be.true; @@ -381,4 +401,26 @@ exports.DrivingLicencePage = class PlaywrightDevPage { fieldErrorText ); } + + async consentCheckBoxUnselect() { + await this.page.waitForLoadState("domcontentloaded"); + expect(await this.isCurrentPage()).to.be.true; + return await this.consentDVLACheckbox.click(); + } + + async assertConsentErrorSummary(errorSummaryText) { + await this.page.waitForLoadState("domcontentloaded"); + expect(await this.isCurrentPage()).to.be.true; + expect(await this.invalidConsentErrorSummary.innerText()).to.contains( + errorSummaryText + ); + } + + async assertConsentErrorOnField(fieldErrorText) { + await this.page.waitForLoadState("domcontentloaded"); + expect(await this.isCurrentPage()).to.be.true; + expect(await this.invalidConsentErrorFieldError.innerText()).to.contains( + fieldErrorText + ); + } }; diff --git a/test/browser/step_definitions/DrivingLicenceStepDefs.js b/test/browser/step_definitions/DrivingLicenceStepDefs.js index 624801fa..2b5d47d8 100644 --- a/test/browser/step_definitions/DrivingLicenceStepDefs.js +++ b/test/browser/step_definitions/DrivingLicenceStepDefs.js @@ -238,6 +238,14 @@ Then( } ); +Then( + /^Proper error message is displayed as (.*)$/, + async function (retryMessageHeading) { + const drivingLicencePage = new DrivingLicencePage(this.page); + await drivingLicencePage.assertRetryErrorMessage(retryMessageHeading); + } +); + Then( /^I see the issue number error in summary as (.*)$/, async function (errorSummaryText) { @@ -324,6 +332,29 @@ Then( } ); +Then(/^DVLA consent checkbox is unselected$/, async function () { + const drivingLicencePage = new DrivingLicencePage(this.page); + await drivingLicencePage.consentCheckBoxUnselect(); +}); + +Then( + /^I can see the DVLA consent error summary as (.*)$/, + { timeout: 2 * 5000 }, + async function (errorSummaryText) { + const drivingLicencePage = new DrivingLicencePage(this.page); + await drivingLicencePage.assertConsentErrorSummary(errorSummaryText); + } +); + +Then( + /^I can see the DVLA consent error on the checkbox as (.*)$/, + { timeout: 2 * 5000 }, + async function (fieldErrorText) { + const drivingLicencePage = new DrivingLicencePage(this.page); + await drivingLicencePage.assertConsentErrorOnField(fieldErrorText); + } +); + //##################### DVA ########################## Then( @@ -346,6 +377,11 @@ Given( } ); +Then(/^I check the page Title (.*)$/, async function (dvaErrorPageTitle) { + const dvaDetailsEntryPage = new DVADetailsEntryPage(this.page); + await dvaDetailsEntryPage.assertDVAErrorPageTitle(dvaErrorPageTitle); +}); + // Re-enter DVA test data step-defs Then( @@ -444,6 +480,7 @@ Then( Then( /^I see DVA issue date error in summary as (.*)$/, + { timeout: 3 * 5000 }, async function (errorSummaryText) { const dvaDetailsEntryPage = new DVADetailsEntryPage(this.page); await dvaDetailsEntryPage.assertInvalidDVAIssueInErrorSummary( @@ -454,8 +491,32 @@ Then( Then( /^I see DVA invalid issue date field error as (.*)$/, + { timeout: 2 * 5000 }, async function (fieldErrorText) { const dvaDetailsEntryPage = new DVADetailsEntryPage(this.page); await dvaDetailsEntryPage.assertInvalidDVAIssueOnField(fieldErrorText); } ); + +Then(/^DVA consent checkbox is unselected$/, async function () { + const dvaDetailsEntryPage = new DVADetailsEntryPage(this.page); + await dvaDetailsEntryPage.consentDVACheckBoxUnselect(); +}); + +Then( + /^I can see the DVA consent error summary as (.*)$/, + { timeout: 2 * 5000 }, + async function (errorSummaryText) { + const dvaDetailsEntryPage = new DVADetailsEntryPage(this.page); + await dvaDetailsEntryPage.assertConsentDVAErrorSummary(errorSummaryText); + } +); + +Then( + /^I can see the DVA consent error on the checkbox as (.*)$/, + { timeout: 2 * 5000 }, + async function (fieldErrorText) { + const dvaDetailsEntryPage = new DVADetailsEntryPage(this.page); + await dvaDetailsEntryPage.assertConsentDVAErrorOnField(fieldErrorText); + } +); diff --git a/test/browser/util/TestDataCreator.js b/test/browser/util/TestDataCreator.js index 5b3c4c9b..2e2f4dc7 100644 --- a/test/browser/util/TestDataCreator.js +++ b/test/browser/util/TestDataCreator.js @@ -24,11 +24,34 @@ exports.getDVLATestUserFromMap = function ( licenceValidToYear: "2062", postcode: "BS98 1TL", }); + var primaryDVLAKennethLicence = new DrivingLicenceSubject(); + primaryDVLAKennethLicence.fill({ + licenceNumber: "DECER607085KE9LN", + birthDay: "08", + birthMonth: "07", + birthYear: "1965", + licenceIssueDay: "19", + licenceIssueMonth: "04", + licenceIssueYear: "2001", + issueNumber: "23", + consentDVLACheckbox: "true", + middleNames: " ", + lastName: "DECERQUEIRA", + firstName: "KENNETH", + licenceValidToDay: "01", + licenceValidToMonth: "10", + licenceValidToYear: "2042", + postcode: "BA2 5AA", + }); if (issuer === "DVLA") { if (drivingLicenceSubjectScenario === "DrivingLicenceSubjectHappyPeter") { return primaryDVLALicence; } + + if (drivingLicenceSubjectScenario === "DrivingLicenceSubjectHappyKenneth") { + return primaryDVLAKennethLicence; + } } }; diff --git a/test/mocks/mappings/dl-check-error.json b/test/mocks/mappings/dl-check-error.json index d74030f1..4acadabe 100644 --- a/test/mocks/mappings/dl-check-error.json +++ b/test/mocks/mappings/dl-check-error.json @@ -2,7 +2,6 @@ "mappings": [ { "scenarioName": "dl-check-error", - "newScenarioState": "Started", "request": { "method": "GET", "url": "/__reset/drivingLicence-check-error" @@ -13,8 +12,6 @@ }, { "scenarioName": "dl-check-error", - "requiredScenarioState": "Started", - "newScenarioState": "DrivingLicenceCheck", "request": { "method": "POST", "urlPath": "/session", @@ -35,8 +32,6 @@ }, { "scenarioName": "drivingLicence-check-error", - "requiredScenarioState": "DrivingLicenceCheck", - "newScenarioState": "AuthCode", "request": { "method": "POST", "urlPath": "/check-driving-licence", diff --git a/test/mocks/mappings/driving-licence-fail.json b/test/mocks/mappings/driving-licence-fail.json new file mode 100644 index 00000000..86dec195 --- /dev/null +++ b/test/mocks/mappings/driving-licence-fail.json @@ -0,0 +1,83 @@ +{ + "mappings": [ + { + "scenarioName": "dl-failed", + "request": { + "method": "GET", + "url": "/__reset/dl-failed" + }, + "response": { + "status": 200 + } + }, + { + "scenarioName": "dl-failed", + "request": { + "method": "POST", + "urlPath": "/session", + "headers": { + "x-scenario-id": { + "equalTo": "dl-failed" + } + } + }, + "response": { + "status": 200, + "jsonBody": { + "session_id": "ABCDEF", + "state": "sT@t3", + "redirect_uri": "http://example.net/return" + } + } + }, + { + "scenarioName": "dl-failed", + "request": { + "method": "POST", + "urlPath": "/check-driving-licence", + "headers": { + "x-scenario-id": { + "equalTo": "dl-failed" + }, + "session_id": { + "equalTo": "ABCDEF" + } + }, + "bodyPatterns": [ + { + "matchesJsonPath": "$.drivingLicenceNumber" + } + ] + }, + "response": { + "status": 200, + "jsonBody": { + "retry": true + } + } + }, + { + "scenarioName": "dl-failed", + "request": { + "method": "GET", + "urlPath": "/authorization", + "headers": { + "x-scenario-id": { + "equalTo": "dl-failed" + }, + "session-id": { + "equalTo": "ABCDEF" + } + } + }, + "response": { + "status": 200, + "jsonBody": { + "authorizationCode": { + "value": "FACEFEED" + } + } + } + } + ] +} diff --git a/test/mocks/mappings/driving-licence.json b/test/mocks/mappings/driving-licence.json index 98ed4bbf..f295f2d3 100644 --- a/test/mocks/mappings/driving-licence.json +++ b/test/mocks/mappings/driving-licence.json @@ -2,7 +2,6 @@ "mappings": [ { "scenarioName": "dl-success", - "newScenarioState": "Started", "request": { "method": "GET", "url": "/__reset/dl-success" @@ -13,8 +12,6 @@ }, { "scenarioName": "dl-success", - "requiredScenarioState": "Started", - "newScenarioState": "DLCheck", "request": { "method": "POST", "urlPath": "/session", @@ -35,8 +32,6 @@ }, { "scenarioName": "dl-success", - "requiredScenarioState": "DLCheck", - "newScenarioState": "AuthCode", "request": { "method": "POST", "urlPath": "/check-driving-licence", @@ -55,7 +50,6 @@ }, { "scenarioName": "dl-success", - "requiredScenarioState": "AuthCode", "request": { "method": "GET", "urlPath": "/authorization", diff --git a/test/mocks/mappings/drivingLicence-session-error.json b/test/mocks/mappings/drivingLicence-session-error.json index d4f69a0a..654c54d8 100644 --- a/test/mocks/mappings/drivingLicence-session-error.json +++ b/test/mocks/mappings/drivingLicence-session-error.json @@ -2,7 +2,6 @@ "mappings": [ { "scenarioName": "dl-session-error", - "newScenarioState": "Started", "request": { "method": "GET", "url": "/__reset/driving-licence-session-error" @@ -13,8 +12,6 @@ }, { "scenarioName": "dl-session-error", - "requiredScenarioState": "Started", - "newScenarioState": "DLCheck", "request": { "method": "POST", "urlPath": "/session", diff --git a/test/mocks/mappings/drivingLicence-slow.json b/test/mocks/mappings/drivingLicence-slow.json index a507d6d0..5a1af8e9 100644 --- a/test/mocks/mappings/drivingLicence-slow.json +++ b/test/mocks/mappings/drivingLicence-slow.json @@ -2,7 +2,6 @@ "mappings": [ { "scenarioName": "dl-success-slow", - "newScenarioState": "Started", "request": { "method": "GET", "url": "/__reset/driving-licence-success-slow" @@ -13,8 +12,6 @@ }, { "scenarioName": "dl-success-slow", - "requiredScenarioState": "Started", - "newScenarioState": "DLCheck", "request": { "method": "POST", "urlPath": "/session", @@ -35,8 +32,6 @@ }, { "scenarioName": "driving-licence-success-slow", - "requiredScenarioState": "DLCheck", - "newScenarioState": "AuthCode", "request": { "method": "POST", "urlPath": "/check-driving-licence", @@ -56,7 +51,6 @@ }, { "scenarioName": "driving-licence-success-slow", - "requiredScenarioState": "AuthCode", "request": { "method": "GET", "urlPath": "/authorization",