Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

reset screen size switching in feature spec

ulferts9e39ac89a403
diff --git a/spec/features/work_packages/display_representations/switch_display_representations_spec.rb b/spec/features/work_packages/display_representations/switch_display_representations_spec.rb
index 5f9d3ea351b..6c7a14da39e 100644
--- a/spec/features/work_packages/display_representations/switch_display_representations_spec.rb
+++ b/spec/features/work_packages/display_representations/switch_display_representations_spec.rb
@@ -111,9 +111,20 @@ describe 'Switching work package view',
end
context 'switching to mobile card view' do
+ let!(:height_before) do
+ page.driver.browser.manage.window.size.height
+ end
+ let!(:width_before) do
+ page.driver.browser.manage.window.size.width
+ end
+
+ after do
+ page.driver.browser.manage.window.resize_to(width_before, height_before)
+ end
+
it 'can switch the representation automatically on mobile after a refresh' do
# Change browser size to mobile
- page.driver.browser.manage.window.resize_to(679,1080)
+ page.driver.browser.manage.window.resize_to(679, 1080)
# Expect the representation to switch to card on mobile
page.driver.browser.navigate.refresh
@@ -133,7 +144,7 @@ describe 'Switching work package view',
expect(url).not_to match(/query_props=.+/)
# Since the query is unchanged, the WPs will be displayed as list on larger screens again
- page.driver.browser.manage.window.resize_to(680,1080)
+ page.driver.browser.manage.window.resize_to(680, 1080)
page.driver.browser.navigate.refresh
wp_table.expect_work_package_listed wp_1, wp_2
wp_table.expect_work_package_order wp_1, wp_2