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

[Flaky] rspec ./spec/system/admin/order_cycles/simple_spec.rb:572 #11037

Closed
Tracked by #8293
filipefurtad0 opened this issue Jun 16, 2023 · 9 comments · Fixed by #13136
Closed
Tracked by #8293

[Flaky] rspec ./spec/system/admin/order_cycles/simple_spec.rb:572 #11037

filipefurtad0 opened this issue Jun 16, 2023 · 9 comments · Fixed by #13136

Comments

@filipefurtad0
Copy link
Contributor

What we should change and why (this is tech debt)

Related to #9894

  1) 
    As an administrator
    I want to manage simple order cycles
 simplified interface for enterprise users selling only their own produce creates order cycles
     Failure/Error: click_button 'Add coordinator fee'
     
     Capybara::Cuprite::MouseEventFailed:
       Firing a click at coordinates [101.1875, 758.28125] failed. Cuprite detected another element with CSS selector "html.webkit.chrome.chrome114.linux.js.orientation_landscape.maxw_1280 body.admin.stimulus-reflex-disconnected div#wrapper div#content div.row div.container div.sixteen.columns form#new_order_cycle.ng.order_cycle.ng-scope.ng-valid-maxlength.ng-valid-max-tags.ng-valid-min-tags.ng-valid-leftover-text.ng-dirty.ng-valid-parse.ng-valid.ng-valid-required save-bar.ng-isolate-scope div#save-bar.animate-show div.container div.seven.columns.alpha" at this position. It may be overlapping the element you are trying to interact with. If you don't care about overlapping elements, try using node.trigger("click").
     
     [Screenshot Image]: /home/runner/work/openfoodnetwork/openfoodnetwork/tmp/capybara/screenshots/failures_r_spec_example_groups_as_an_administrator_i_want_to_manage_simple_order_cycles_simplified_interface_for_enterprise_users_selling_only_their_own_produce_creates_order_cycles_921.png

Context

https://github.com/openfoodfoundation/openfoodnetwork/actions/runs/5286207807/jobs/9565418679?pr=11035

Impact and timeline

@filipefurtad0
Copy link
Contributor Author

filipefurtad0 commented Nov 29, 2023

Same spec file, but this is a new occurrence, introduced by a recent change on this spec file:
https://github.com/openfoodfoundation/openfoodnetwork/actions/runs/7029245004/job/19126549660

Here we get (GH-Actions artifact file):
image

There are other flaky scenarios around OC interactions.

@mkllnk
Copy link
Member

mkllnk commented Dec 4, 2023

Here's another one:

Failures:

  1) 
    As an administrator
    I want to manage simple order cycles
 as an enterprise user that is a manager of the coordinator when variants are hidden via inventory settings behaves like inventory warning shows a warning when going to 'outgoing products' tab
     Failure/Error: expect(page).to have_content product.name.upcase
       expected to find text "PRODUCT #13 - 3892" in "Logged in as : lilia@kub.info Account Logout Store DASHBOARD PRODUCTS ORDER CYCLES ORDERS REPORTS ENTERPRISES CUSTOMERS Edit Order Cycle ADVANCED SETTINGS 1. GENERAL SETTINGS 2. INCOMING PRODUCTS 3. OUTGOING PRODUCTS 4. CHECKOUT OPTIONS OUTGOING DISTRIBUTOR PRODUCTS ( EXPAND ALL ) TAGS DELIVERY DETAILS FEES Managed distributor 0 / 0 selected 0 [missing %{num_of_variants_loaded} value] of 0 Variants Loaded SELECT ALL 0 VARIANTS Permitted distributor"
     
     [Screenshot Image]: /home/runner/work/openfoodnetwork/openfoodnetwork/tmp/capybara/screenshots/failures_r_spec_example_groups_as_an_administrator_i_want_to_manage_simple_order_cycles_as_an_enterprise_user_that_is_a_manager_of_the_coordinator_when_variants_are_hidden_via_inventory_settings_behaves_like_i_14.png

     
     Shared Example Group: "inventory warning" called from ./spec/system/admin/order_cycles/simple_spec.rb:430
     # ./spec/system/admin/order_cycles/simple_spec.rb:420:in `block (6 levels) in <main>'
     # ./spec/system/support/cuprite_setup.rb:39:in `block (2 levels) in <top (required)>'


Finished in 3 minutes 25.6 seconds
33 examples, 1 failure, 4 pending

Failed examples:

rspec ./spec/system/admin/order_cycles/simple_spec.rb:411 # 

@duleorlovic
Copy link
Contributor

@filipefurtad0
Copy link
Contributor Author

Another occurrence here:

 Failures:

  1) 
    As an administrator
    I want to manage simple order cycles
 as an enterprise user that is a manager of a participating producer editing an order cycle
     Failure/Error:
       expect(page).to have_checked_field("order_cycle_outgoing_exchange_0_variants_#{v1.id}",
                                          disabled: false)
     
       expected to find field "order_cycle_outgoing_exchange_0_variants_22" that is not disabled but there were no matches
     
     [Screenshot Image]: /home/runner/work/openfoodnetwork/openfoodnetwork/tmp/capybara/screenshots/failures_r_spec_example_groups_as_an_administrator_i_want_to_manage_simple_order_cycles_as_an_enterprise_user_that_is_a_manager_of_a_participating_producer_editing_an_order_cycle_394.png

     
     # ./spec/system/admin/order_cycles/simple_spec.rb:505:in `block (4 levels) in <main>'
     # ./spec/system/support/cuprite_setup.rb:39:in `block (2 levels) in <top (required)>'

@mkllnk
Copy link
Member

mkllnk commented Oct 2, 2024

This failed again for me and I had a quick look. Server load (race condition) doesn't seem to be the cause. I can't reproduce it. I wonder if the cause is similar to the on fixed in this pr:

@mkllnk
Copy link
Member

mkllnk commented Feb 10, 2025

I just reproduced it by checking out master, resetting the database and then running the specs from CI:

bundle exec rspec --format progress --default-path spec "spec/system/admin/payment_method_spec.rb" "spec/system/admin/order_cycles/simple_spec.rb" "spec/system/admin/users_spec.rb" "spec/system/admin/order_cycles/edit_spec.rb" "spec/system/admin/unit_price_spec.rb" "spec/system/admin/configuration/tax_categories_spec.rb" "spec/system/admin/payments_spec.rb" "spec/system/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb" "spec/system/admin/order_cycles/complex_editing_exchange_same_enterprise_spec.rb" "spec/system/admin/tax_settings_spec.rb"

Failed examples:

rspec ./spec/system/admin/payment_method_spec.rb:317 # 
    As a Super Admin
    I want to be able to set a distributor on each payment method
 Setting transaction fees using Flat Percent calculator inserts values which persist
rspec ./spec/system/admin/payment_method_spec.rb:330 # 
    As a Super Admin
    I want to be able to set a distributor on each payment method
 Setting transaction fees using Flat Rate (per order) calculator inserts values which persist
rspec ./spec/system/admin/payment_method_spec.rb:360 # 
    As a Super Admin
    I want to be able to set a distributor on each payment method
 Setting transaction fees using Flat Rate (per item) calculator inserts values which persist

@mkllnk
Copy link
Member

mkllnk commented Feb 10, 2025

In this case it seems to be that the success flash is overlapping a button. We need to dismiss the flash first:

Image

@mkllnk
Copy link
Member

mkllnk commented Feb 10, 2025

Oh, hang on, that's the wrong spec file. Moving to another issue.

@mkllnk
Copy link
Member

mkllnk commented Feb 10, 2025

After fixing other flaky specs I could reproduce this one now:

./bin/rails db:reset
bundle exec rspec --format progress --default-path spec "spec/system/admin/payment_method_spec.rb" "spec/system/admin/order_cycles/simple_spec.rb" "spec/system/admin/users_spec.rb" "spec/system/admin/order_cycles/edit_spec.rb" "spec/system/admin/unit_price_spec.rb" "spec/system/admin/configuration/tax_categories_spec.rb" "spec/system/admin/payments_spec.rb" "spec/system/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb" "spec/system/admin/order_cycles/complex_editing_exchange_same_enterprise_spec.rb" "spec/system/admin/tax_settings_spec.rb"

Failures:

  1) 
    As an administrator
    I want to manage simple order cycles
 as an enterprise user that is a manager of the coordinator when variants are hidden via inventory settings shows a warning when going to 'outgoing products' tab
     Failure/Error: expect(page).to have_content v1.product.name
       expected to find text "Product #13 - 8933" in "Logged in as : bernadine@osinski.biz Account Logout Store Dashboard Products Order cycles Orders Reports Enterprises Customers Edit Order Cycle Advanced Settings 1. GENERAL SETTINGS 2. INCOMING PRODUCTS 3. OUTGOING PRODUCTS 4. CHECKOUT OPTIONS Outgoing Distributor Products ( Expand all ) Tags Delivery Details Fees Managed distributor 0 / 0 selected 0 [missing %{num_of_variants_loaded} value] of 0 Variants Loaded Select All 0 Variants Permitted distributor"
     
     [Screenshot Image]: /home/maikel/code/openfoodnetwork/tmp/capybara/screenshots/failures_r_spec_example_groups_as_an_administrator_i_want_to_manage_simple_order_cycles_as_an_enterprise_user_that_is_a_manager_of_the_coordinator_when_variants_are_hidden_via_inventory_settings_shows_a_warnin_653.png

     
     # ./spec/system/admin/order_cycles/simple_spec.rb:468:in `block (5 levels) in <main>'
     # ./spec/system/support/cuprite_setup.rb:39:in `block (2 levels) in <main>'
     # ./spec/base_spec_helper.rb:153:in `block (3 levels) in <top (required)>'
     # ./spec/base_spec_helper.rb:153:in `block (2 levels) in <top (required)>'

Finished in 3 minutes 54 seconds (files took 5.37 seconds to load)
81 examples, 1 failure, 1 pending

Failed examples:

rspec ./spec/system/admin/order_cycles/simple_spec.rb:454 # 

@github-project-automation github-project-automation bot moved this from All the things 💤 to Done in OFN Delivery board Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants