DEV: Change sidebar header dropdown to use wait_for_animation (#20627)

* DEV: Change sidebar header dropdown to use wait_for_animation

Introduced in 54351e1b8a9b070bfce6a478e9912a76f1545a54, this
helper should remove the need to have to add the .animated
CSS class in JS for the sidebar.

* DEV: Revert spec change
This commit is contained in:
Martin Brennan
2023-03-10 14:54:57 +10:00
committed by GitHub
parent 5893ad46ba
commit 168de52538
6 changed files with 5 additions and 8 deletions

View File

@ -5,6 +5,7 @@ module PageObjects
class Base
include Capybara::DSL
include RSpec::Matchers
include SystemHelpers
end
end
end

View File

@ -5,9 +5,7 @@ module PageObjects
class SidebarHeaderDropdown < PageObjects::Components::Base
def click
page.find(".hamburger-dropdown").click
# `.animated` is important here because we want to wait until dropdown has finished its animation completely
page.has_css?(".menu-panel.animated")
wait_for_animation(find(".menu-panel"), timeout: 5)
self
end

View File

@ -4,6 +4,8 @@ module PageObjects
module Pages
class Base
include Capybara::DSL
include RSpec::Matchers
include SystemHelpers
end
end
end