-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix flaky specs around admin credit card filling #3160
Conversation
71f66c0
to
6502f61
Compare
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.
6502f61
to
841ba45
Compare
There was a problem hiding this 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
There was a problem hiding this 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.
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: