From 900c93f0cb048c5969d6735a15979478c56bb126 Mon Sep 17 00:00:00 2001 From: Brian Hall Date: Fri, 10 May 2024 07:16:49 -0500 Subject: [PATCH] Add the ability to generate a random zip code (#964) * Add the ability to generate a random zip code * Fix linting * Fix typow --------- Co-authored-by: Brian Hall --- .../playwright/page-objects/broker-protection.js | 1 + .../broker-protection/actions/fill-form.json | 4 ++++ .../test-pages/broker-protection/pages/form.html | 4 ++++ src/features/broker-protection/actions/fill-form.js | 7 +++++++ unit-test/broker-protection.js | 11 ++++++++++- 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/integration-test/playwright/page-objects/broker-protection.js b/integration-test/playwright/page-objects/broker-protection.js index 9a0d04403..06c4b50d5 100644 --- a/integration-test/playwright/page-objects/broker-protection.js +++ b/integration-test/playwright/page-objects/broker-protection.js @@ -56,6 +56,7 @@ export class BrokerProtectionPage { await expect(this.page.getByLabel('Last Name:')).toHaveValue('Smith') await expect(this.page.getByLabel('Phone Number:')).toHaveValue(/^\d{10}$/) await expect(this.page.getByLabel('State:')).toHaveValue('IL') + await expect(this.page.getByLabel('Zip Code:')).toHaveValue(/^\d{5}$/) } /** diff --git a/integration-test/test-pages/broker-protection/actions/fill-form.json b/integration-test/test-pages/broker-protection/actions/fill-form.json index d918a0c94..3a66178f6 100644 --- a/integration-test/test-pages/broker-protection/actions/fill-form.json +++ b/integration-test/test-pages/broker-protection/actions/fill-form.json @@ -20,6 +20,10 @@ { "type": "state", "selector": "#state" + }, + { + "type": "$generated_zip_code$", + "selector": "#user_zip_code" } ] }, diff --git a/integration-test/test-pages/broker-protection/pages/form.html b/integration-test/test-pages/broker-protection/pages/form.html index 126459c82..4f2d497af 100644 --- a/integration-test/test-pages/broker-protection/pages/form.html +++ b/integration-test/test-pages/broker-protection/pages/form.html @@ -39,6 +39,10 @@ +