From 7fdede9f0fb56aa68319b078305964a52032d406 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Mon, 29 May 2023 14:31:02 +0900 Subject: [PATCH] DEV: Speed up slow system tests (#21803) What is the problem? Prior to this change, we had a `has_css?(context + ":not(.is-expanded)"` check when using the select-kit component page object. The problem here is that this check will end up waiting the full capybara default wait time if the select-kit has already been expanded. It turns out that we were calling this check alot of times when the select-kit has already been expanded resulting in many tests waiting the full default wait time. What is the fix? The fix here is to specify the `wait: 0` option such that we do not wait and fundamentally, there is no need for us to wait at all here. --- spec/system/page_objects/components/select_kit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/system/page_objects/components/select_kit.rb b/spec/system/page_objects/components/select_kit.rb index 6419552c1fa..aeafd85406d 100644 --- a/spec/system/page_objects/components/select_kit.rb +++ b/spec/system/page_objects/components/select_kit.rb @@ -27,7 +27,7 @@ module PageObjects end def is_collapsed? - has_css?(context + ":not(.is-expanded)") + has_css?(context + ":not(.is-expanded)", wait: 0) end def has_selected_value?(value)