From bedcb5bca239c7621cd04ef20cdb0fb50b1514b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 14 Sep 2024 16:52:31 +0200 Subject: [PATCH 1/2] Don't include videos in proposal factories Since August 29, probably due to a change in the browser used by GitHub Actions (since branches whose code we didn't change were suddenly affected that day), many tests related to proposals are failing on GitHub Actions. Although every time the test suite is run different tests fail, on each run at least half a dozen tests fail. Most tests have one thing in common: they click on an element on the `proposals#show` page, and the click isn't done correctly. One possible explanation is that the video included on the page causes the page to scroll at the exact same time that Capybara is clicking on a link, which results in a misclick. I haven't been able to reproduce the issue on my machine, so I'm not sure whether giving the video element a fixed height using CSS (so the page doesn't scroll when the iframe is loaded) could solve the issue. But, after using proposals without videos in the tests (except the tests testing the videos themselves), all these tests are passing in the test suite. So, for now, we're simply removing the videos in the proposal factories. Note this issue wasn't caused by the "no cookie" changes done in commit ee64efe6597, since running the tests in Cosul Democracy 2.1.1 (which didn't contain those changes) also fails on GitHub Actions. --- spec/factories/proposals.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/factories/proposals.rb b/spec/factories/proposals.rb index 052f67f3b..0330eeafa 100644 --- a/spec/factories/proposals.rb +++ b/spec/factories/proposals.rb @@ -3,7 +3,6 @@ FactoryBot.define do sequence(:title) { |n| "Proposal #{n} title" } sequence(:summary) { |n| "In summary, what we want is... #{n}" } description { "Proposal description" } - video_url { "https://youtu.be/nhuNb0XtRhQ" } responsible_name { "John Snow" } terms_of_service { "1" } published_at { Time.current } From ec0bcd427700590c06097460d2e1e2b2726864ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 14 Sep 2024 17:43:52 +0200 Subject: [PATCH 2/2] Use a more realistic size for small window tests The resolution of most devices is at least 640 pixels in at least one of their dimensions. Since we need the width to be smaller than 640 pixels, having a height of 479px wasn't realistic. Doing so caused the tests checking the sticky "support proposal" tests to fail because on 480px-high devices the sticky message covers the whole screen. This is a usability issue, but since I'm not sure how many people use such a small window when browsing the web, for now I'm simply changing the tests. We're changing the width to 320px since it's the width required by the Web Content Accessibility Guidelines 2.2. Quoting these guidelines [1]: > Content can be presented without loss of information or functionality, > and without requiring scrolling in two dimensions for: > * Vertical scrolling content at a width equivalent to 320 CSS pixels; > * Horizontal scrolling content at a height equivalent to 256 CSS > pixels. Note that, using a height of 256px, the sticky message would make the application unusable, though. IMHO we'll have to get rid of the sticky message sooner or later. --- spec/spec_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 61738381b..2ee4b259b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -126,7 +126,7 @@ RSpec.configure do |config| config.before(:each, :small_window) do @window_size = Capybara.current_window.size - Capybara.current_window.resize_to(639, 479) + Capybara.current_window.resize_to(320, 640) end config.after(:each, :small_window) do