Skip to content
This repository was archived by the owner on Jul 24, 2020. It is now read-only.
This repository was archived by the owner on Jul 24, 2020. It is now read-only.

Intermittently failing test due to another spec not cleaning up after itself #1514

Closed
@orenyk

Description

@orenyk
1) Reservations can be created by checkout persons with override permissions behaves like can create failing reservation successfully

     Failure/Error:

       within(:css, "#add_to_cart_#{eq_model.id}") do

         click_link 'Add to Cart'



     Capybara::ElementNotFound:

       Unable to find css "#add_to_cart_474"

     Shared Example Group: "can create failing reservation" called from ./spec/features/reservations_spec.rb:141

     # ./spec/support/feature_helpers.rb:56:in `add_item_to_cart'

     # ./spec/features/reservations_spec.rb:87:in `block (4 levels) in <top (required)>'

In the test environment we default to having a single equipment model per page displayed on the catalog, so if there are any other categories / equipment models in the database, depending on the sort order, the expected equipment model's add_to_cart button won't be present when the catalog loads (e.g. on the first page). Since this test only fails intermittently, it appears as though at least one of our specs isn't properly cleaning up after itself and is leaving other equipment in the database, so if this spec runs after the problem spec, it fails, but otherwise it passes.

We could simply leave the tests and just increase the default pagination value in test, but that's more treating the symptom, not the cause, so I'd like to figure out which test is causing the problem and to fix it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions