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

Fix flaky specs around admin credit card filling #3160

Merged
merged 7 commits into from
Apr 8, 2019

Conversation

kennyadsl
Copy link
Member

Description

We are having some other flaky specs around credit card filling with JS enabled, very similar with what we faced on the frontend side with #2911.

Here's an example of failure on the CI:

This PR uses the fill_in_with_force helper that we introduced in the frontend, also in the backend hopefully making disappear these failures.

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change (if needed)

@kennyadsl kennyadsl self-assigned this Apr 2, 2019
@kennyadsl kennyadsl force-pushed the kennyadsl/flaky-admin-card branch from 71f66c0 to 6502f61 Compare April 3, 2019 08:43
This was available to frontend only but we also need it in backend.
These input are controlled by a js plugin (payment.js) that
messes up with Capybara and gives us a lot of flaky specs.

By using this hacky solution we are sure input are filled correctly,
see also solidusio#2911.
We have this helper defined in this file but it was not
always used. The name on card filling has been also delegated
to the helper method.
Credit card number is always the same, unless we want to
test an edge case, which is still possible.
to support when it's not called with a Javascript driver. Now it
raises an exception while its purpose it's not needed without the
Javascript enabled, since the js plugin that does not interact
well with Capybara is not active.
It's not explicitely needed but a lot of js runs in those pages
and it's better to test it in a more realistic way.
At the moment, after the input is filled with value=, the change
event is not fired.

If we had change listeners on that input they will not be executed.

For example we have a .ccType hidden field that is filled with the
type of the card added and this did remain empty since the backbone
view that was responsible to update it after the card number was
added did not get any trigger.
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

This good for now. Ideally we would not test a feature nobody ever (should) use in production. But we want to stabilize the test suite. Thanks Alberto

Copy link
Contributor

@jacobherrington jacobherrington left a comment

Choose a reason for hiding this comment

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

For the sake of pragmatism, let's get this merged. Then we can ask if these specs are necessary.

@kennyadsl kennyadsl merged commit 23d9358 into solidusio:master Apr 8, 2019
@kennyadsl kennyadsl deleted the kennyadsl/flaky-admin-card branch April 8, 2019 18:57
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