discourse/spec/system
Joffrey JAFFEUX 71330961dc
DEV: more reliable toggle_setting spec helper (#21779)
Page settings can be very long and the setting can be way out of viewport. This should ensure the setting can be found and clicked.

This was for example causing this flakey in discourse-topic-voting:

```
Failures:

  1) Voting enables voting in category topics and votes
     Failure/Error: find(".edit-category-tab .#{setting} label.checkbox-label", text: text).click

     Capybara::ElementNotFound:
       Unable to find css ".edit-category-tab .enable-topic-voting label.checkbox-label"

     [Screenshot Image]: /__w/discourse/discourse/tmp/capybara/failures_r_spec_example_groups_voting_enables_voting_in_category_topics_and_votes_873.png

     ~~~~~~~ JS LOGS ~~~~~~~
     http://localhost:31341/favicon.ico - Failed to load resource: the server responded with a status of 404 (Not Found)
     ~~~~~ END JS LOGS ~~~~~

     # ./vendor/bundle/ruby/3.2.0/gems/capybara-3.39.1/lib/capybara/node/finders.rb:312:in `block in synced_resolve'
     # ./vendor/bundle/ruby/3.2.0/gems/capybara-3.39.1/lib/capybara/node/base.rb:84:in `synchronize'
     # ./vendor/bundle/ruby/3.2.0/gems/capybara-3.39.1/lib/capybara/node/finders.rb:301:in `synced_resolve'
     # ./vendor/bundle/ruby/3.2.0/gems/capybara-3.39.1/lib/capybara/node/finders.rb:60:in `find'
     # ./vendor/bundle/ruby/3.2.0/gems/capybara-3.39.1/lib/capybara/session.rb:773:in `find'
     # ./vendor/bundle/ruby/3.2.0/gems/capybara-3.39.1/lib/capybara/dsl.rb:52:in `call'
     # ./vendor/bundle/ruby/3.2.0/gems/capybara-3.39.1/lib/capybara/dsl.rb:52:in `find'
     # ./spec/system/page_objects/pages/category.rb:34:in `toggle_setting'
     # ./plugins/discourse-topic-voting/spec/system/voting_spec.rb:39:in `block (2 levels) in <main>'
     # ./spec/rails_helper.rb:368:in `block (3 levels) in <top (required)>'
     # ./vendor/bundle/ruby/3.2.0/gems/timeout-0.3.2/lib/timeout.rb:189:in `block in timeout'
     # ./vendor/bundle/ruby/3.2.0/gems/timeout-0.3.2/lib/timeout.rb:36:in `block in catch'
     # ./vendor/bundle/ruby/3.2.0/gems/timeout-0.3.2/lib/timeout.rb:36:in `catch'
     # ./vendor/bundle/ruby/3.2.0/gems/timeout-0.3.2/lib/timeout.rb:36:in `catch'
     # ./vendor/bundle/ruby/3.2.0/gems/timeout-0.3.2/lib/timeout.rb:198:in `timeout'
     # ./spec/rails_helper.rb:364:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:356:in `block (2 levels) in <top (required)>'
     # ./vendor/bundle/ruby/3.2.0/gems/webmock-3.18.1/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'

Finished in 7 minutes 18 seconds (files took 0 seconds to load)
445 examples, 1 failure, 17 pending, 1 error occurred outside of examples

Failed examples:

rspec ./plugins/discourse-topic-voting/spec/system/voting_spec.rb:27 # Voting enables voting in category topics and votes
```
2023-05-28 14:15:10 +02:00
..
composer FIX: Fix for Default to subcategory when parent category does not allow posting (#21537) 2023-05-19 07:37:23 -05:00
emojis DEV: Speed up core system tests (#21394) 2023-05-05 07:45:53 +08:00
page_objects DEV: more reliable toggle_setting spec helper (#21779) 2023-05-28 14:15:10 +02:00
user_page FIX: all staff_counters should be pluralized strings (#21048) 2023-04-12 17:13:37 +08:00
admin_customize_form_templates_spec.rb DEV: Show active categories in form templates customize table (#20498) 2023-03-01 12:37:14 -08:00
admin_customize_themes_spec.rb PERF: Don't serialize value for theme_fields unnecessarily (#21201) 2023-04-24 09:30:51 -05:00
bookmarks_spec.rb DEV: Speed up core system tests (#21394) 2023-05-05 07:45:53 +08:00
category_edit_spec.rb DEV: Speed up core system tests (#21394) 2023-05-05 07:45:53 +08:00
custom_sidebar_sections_spec.rb FIX: allow published pages to be added to sidebar (#21687) 2023-05-24 08:59:19 +10:00
discovery_breadcrumb_navigation_spec.rb FIX: default_list_filter = none navigation and preloading (#20641) 2023-03-14 10:46:05 +00:00
ember_deprecation_test.rb DEV: Include ember deprecation messages in production builds (#20587) 2023-03-10 10:37:28 +00:00
fast_edit_spec.rb FIX: Fast edit doesn’t work on content with certain characters (#20410) 2023-02-23 11:30:16 +08:00
filtering_topics_spec.rb DEV: Update experimental /filter route with tags support (#20874) 2023-03-30 09:00:42 +08:00
hashtag_autocomplete_spec.rb FIX: Do not cook icon with hashtags (#21676) 2023-05-23 09:33:55 +02:00
search_spec.rb DEV: Speed up core system tests (#21394) 2023-05-05 07:45:53 +08:00
tag_notification_level_spec.rb FIX: ensures tag notification level is changed (#21106) 2023-04-17 10:48:41 +02:00
tag_synonyms_spec.rb FEATURE: add new tags from edit tag synonyms page (#20553) 2023-03-08 14:26:20 +08:00
user_preferences_interface_spec.rb FIX: Remove user_option saving for bookmark auto delete pref (#19476) 2022-12-16 08:50:31 +10:00
user_preferences_navigation_spec.rb UX: Release new user profile navigation for sidebar compatibility (#20134) 2023-02-21 10:16:16 +08:00
user_selector_spec.rb DEV: Disable SearchIndexer after fabrication (#21378) 2023-05-04 09:20:52 +08:00
viewing_category_spec.rb FIX: Incorrect topic tracking state count when a new category is created (#20506) 2023-03-06 10:13:10 +08:00
viewing_sidebar_mobile_spec.rb DEV: Port sidebar mobile view acceptance tests to system tests (#20421) 2023-02-23 15:01:39 +08:00
viewing_sidebar_preferences_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
viewing_sidebar_spec.rb DEV: Change sidebar header dropdown to use wait_for_animation (#20627) 2023-03-10 14:54:57 +10:00