Below are the Behavior-Driven Development (BDD) test scripts for the requirement "Certificate with fees." Each script is written in the Given-When-Then format, which helps define the context, actions, and expected outcomes.
Feature: Customer Requests Certificate with Fees
Scenario 1: Customer requests a certificate via digital channels
Given the customer is on the WOL/MOB channel
When the customer selects the option to request a certificate
Then the customer should see the fee amount displayed
Scenario 2: Customer accepts the fee
Given the customer is shown the fee amount for the certificate
When the customer chooses to accept the fee request
Then the customer should be prompted to select the account for payment
Scenario 3: Customer declines the fee
Given the customer is shown the fee amount for the certificate
When the customer chooses to decline the fee request
Then the certificate request process should be canceled
Scenario 4: Customer verifies OTP for payment
Given the customer has selected the account for payment
When the customer receives an OTP via the chosen delivery option (mobile/email)
And the customer enters the OTP correctly
Then the document generation request should be initiated
Scenario 5: Successful document generation and fee deduction
Given the customer has successfully verified the OTP
When the document generation request is processed successfully
Then the fee amount should be deducted from the customer's selected account
And the customer should be notified of the successful document generation
Scenario 6: Customer views the certificate instantly
Given the document generation is successful
When the customer requests to view the certificate
Then the customer should see the certificate in both Arabic and English
Scenario 7: Customer receives the certificate as a password-protected PDF via email
Given the document generation is successful
When the certificate is sent to the customer's email
Then the customer should receive a password-protected PDF of the certificate
And the password should be the customer’s civil ID for individuals and commercial registration number for businesses
Scenario 8: Certificate specifies the institution
Given the document generation is successful
When the customer views the certificate
Then the certificate should specify the institution for which it was requested based on the customer's chosen option
Scenario 9: Certificate contains a QR code
Given the document generation is successful
When the customer views or receives the certificate
Then the certificate should have an embedded QR code for document validation
Notes:
- Each scenario should also have steps to verify the actual values displayed and actions taken.
- Additional scenarios can be added to cover edge cases or error handling (e.g., account balance insufficient, OTP fails, unexpected errors during document generation).