Skip to content

A platform for community discussion. Free, open, simple.

DEV: Try fix flaky search shortcut variation test (#33169)

Martin Brennanfbe754108f9e
diff --git a/spec/system/search_shortcut_variation_spec.rb b/spec/system/search_shortcut_variation_spec.rb
index 04992da71f8..8cbed157122 100644
--- a/spec/system/search_shortcut_variation_spec.rb
+++ b/spec/system/search_shortcut_variation_spec.rb
@@ -25,17 +25,11 @@ describe "Search | Shortcuts for variations of search input", type: :system do
end
context "when welcome banner is not in the viewport" do
- before do
+ it "displays and focuses header search when / is pressed and hides it when Escape is pressed" do
visit("/")
+ expect(welcome_banner).to be_visible
fake_scroll_down_long
- end
-
- # Test is flaky on CI even after reruns
- #
- # 1) Search | Shortcuts for variations of search input when search_experience is search_field when enable_welcome_banner is true when welcome banner is not in the viewport displays and focuses header search when / is pressed and hides it when Escape is pressed
- # Failure/Error: expect(page).to have_css("#header-search-input:focus")
- #
- xit "displays and focuses header search when / is pressed and hides it when Escape is pressed" do
+ expect(search_page).to have_search_field
expect(welcome_banner).to be_invisible
page.send_keys("/")
expect(search_page).to have_search_menu
@@ -78,17 +72,11 @@ describe "Search | Shortcuts for variations of search input", type: :system do
end
context "when welcome banner is not in the viewport" do
- before do
+ it "displays and focuses search icon search when / is pressed and hides it when Escape is pressed" do
visit("/")
+ expect(welcome_banner).to be_visible
fake_scroll_down_long
- end
-
- # Test is flaky on CI even after reruns
- #
- # 1) Search | Shortcuts for variations of search input when search_experience is search_icon when enable_welcome_banner is true when welcome banner is not in the viewport displays and focuses search icon search when / is pressed and hides it when Escape is pressed
- # Failure/Error: expect(page).to have_css("#icon-search-input:focus")
- #
- xit "displays and focuses search icon search when / is pressed and hides it when Escape is pressed" do
+ expect(search_page).to have_search_icon
expect(welcome_banner).to be_invisible
page.send_keys("/")
expect(search_page).to have_search_menu