Skip to content

Commit

Permalink
Merge pull request #3921 from 3scale/fix-narrow-width-cucumber-failures
Browse files Browse the repository at this point in the history
Resize browser width with a hook
  • Loading branch information
mayorova authored Oct 17, 2024
2 parents af9d8bb + 5c9bd26 commit 11f3b76
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion features/provider/dashboard.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: Dashboard
And they follow "Quick starts"
Then the current page is the quick start catalog page

@narrow-screen
Scenario: Quick start button is not displayed on narrow screens
When they go to the dashboard
And they set the screen width to "1190" pixels
Then they should not see "Quick starts"
6 changes: 0 additions & 6 deletions features/step_definitions/window_steps.rb

This file was deleted.

9 changes: 9 additions & 0 deletions features/support/hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@
end
end

Before '@narrow-screen' do
@browser_width, @browser_height = page.driver.browser.manage.window.size.to_a
page.driver.browser.manage.window.resize_to(1190, @browser_height)
end

After '@narrow-screen' do
page.driver.browser.manage.window.resize_to(@browser_width, @browser_height)
end

Before do
begin
Backend::Storage.instance.flushdb
Expand Down

0 comments on commit 11f3b76

Please sign in to comment.