Skip to content
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

[Split Checkout] Adds tests on payments #8772

Conversation

filipefurtad0
Copy link
Contributor

@filipefurtad0 filipefurtad0 commented Jan 21, 2022

What? Why?

Contributes to #8667 by adding coverage on payment method selection.

  • Adds Cash, Paypal and Stripe SCA UI tests on the payment step (step 2 - Payment)
  • Covers order completion with Cash and Paypal (step 3 - Summary)

These can perhaps be extended in other dedicated spec files, for example on:
spec/system/consumer/shopping/checkout_paypal_spec.rb -> added in commit 1f6157d
spec/system/consumer/shopping/checkout_stripe_spec.rb

What should we test?

Green build.

Release notes

Changelog Category: Technical changes

Adds tests on payment methods for split checkout.

@filipefurtad0 filipefurtad0 marked this pull request as draft January 21, 2022 13:47
@filipefurtad0
Copy link
Contributor Author

filipefurtad0 commented Jan 29, 2022

This draft PR is failing with:
expected to find visible css "#order_total" with text "$15.67" but there were no matches. Also found "$10.00", which matched the selector but not all filters

This is reproducible in staging:

image

@filipefurtad0 filipefurtad0 changed the title Moves Details tests inside context block [Split Checkout] Adds tests on payments Jan 29, 2022
@filipefurtad0 filipefurtad0 force-pushed the add_specs_split_checkout_payment branch from bddb642 to c550408 Compare January 29, 2022 19:48
@filipefurtad0
Copy link
Contributor Author

Commit c550408 should be removed as #8804 introduces the relevant test case.

@filipefurtad0 filipefurtad0 force-pushed the add_specs_split_checkout_payment branch 4 times, most recently from e8e5cca to 82809a5 Compare February 13, 2022 17:23
@filipefurtad0 filipefurtad0 force-pushed the add_specs_split_checkout_payment branch from 82809a5 to e267ae4 Compare February 15, 2022 16:16
@filipefurtad0 filipefurtad0 force-pushed the add_specs_split_checkout_payment branch from e267ae4 to d945e69 Compare February 22, 2022 12:17
@filipefurtad0 filipefurtad0 reopened this Feb 22, 2022
@filipefurtad0 filipefurtad0 marked this pull request as ready for review February 22, 2022 17:39
Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

You are becoming a spec pro!

Can you address those style issues?

Comment on lines 298 to 299
let!(:payment_method3) { create(:payment_method, distributors: [distributor], name: "Cash") }
let!(:payment_method4) { create(:payment_method, distributors: [distributor], name: "BoGuS") }
Copy link
Member

Choose a reason for hiding this comment

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

I would name these cash and bogus instead of payment_method3 and payment_method4.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @mkllnk 🙏

On the payment method re-namings:

  • I've renamed payment_method3 to cash
  • payment_method4 was actually a detour, it got removed on the following commit - sorry if this was a bit misleading.

@filipefurtad0 filipefurtad0 force-pushed the add_specs_split_checkout_payment branch from ac4516c to 82b6d39 Compare February 25, 2022 16:06
Copy link
Contributor

@jibees jibees left a comment

Choose a reason for hiding this comment

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

Sounds perfect! Nice one! 👌
Should we merge it directly?

spec/system/consumer/split_checkout_spec.rb Show resolved Hide resolved
@filipefurtad0 filipefurtad0 merged commit d84b6ce into openfoodfoundation:master Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants