Skip to content

Fix user flows#1645

Merged
jmhooper merged 1 commit intomasterfrom
jmhooper-fix-user-flows
Aug 29, 2017
Merged

Fix user flows#1645
jmhooper merged 1 commit intomasterfrom
jmhooper-fix-user-flows

Conversation

@jmhooper
Copy link
Contributor

Add idv_job metadata to LOA3 user flow specs

Why: Setting idv_job to true is necessary for LOA3 specs to
simulate the background jobs running to verify the user's identity.

Use valid phone in phone form during user flows

Why: Faker::PhoneNumber does not always produce valid phone numbers,
which leads to flickering specs. This change loops until a valid phone
number is generated

Use rack_test driver for user flow specs

Why: The rake_test_desktop driver does not support the
screenshot_and_save_page function. Using the rack test driver allows
us to save screenshot and save pages for the user flows.

before do
fill_in 'user_phone_form_phone', with: Faker::PhoneNumber.cell_phone
phone = Faker::PhoneNumber.cell_phone
until PhonyRails.plausible_number? phone, country_code: :us
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we break out a helper method to generate a number like this? With git grep Faker::PhoneNumber.cell_phone I find two uses in this file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this into a helper at the end of the spec. PTAL!

end

config.around(:each, user_flow: true) do |example|
Capybara.current_driver = :rack_test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the opposite of our js: true -- don't some of our user flow tests use JS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default driver is rack_test_desktop which does not support screenshots, so it isn't quite the opposite of js: true.

Also, there's issues with poltergeist coming from the SP so our JS user flows are disabled right now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok thanks for clarifying!

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had meant just pulling the part that generates the valid-looking phone number into a helper, not the fillin in part, but this works too

**Why**: The rake_test_desktop driver does not support the
`screenshot_and_save_page` function. Using the rack test driver allows
us to save screenshot and save pages for the user flows.

Use valid phone in phone form during user flows

**Why**: Faker::PhoneNumber does not always produce valid phone numbers,
which leads to flickering specs. This change loops until a valid phone
number is generated

Add idv_job metadata to LOA3 user flow specs

**Why**: Setting `idv_job` to true is necessary for LOA3 specs to
simulate the background jobs running to verify the user's identity.
@jmhooper jmhooper force-pushed the jmhooper-fix-user-flows branch from 3ff4316 to c27df46 Compare August 29, 2017 13:14
@jmhooper jmhooper merged commit 883d9ca into master Aug 29, 2017
@jmhooper jmhooper deleted the jmhooper-fix-user-flows branch December 12, 2017 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants