File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -176,14 +176,24 @@ def current_active_element
176
176
end
177
177
178
178
def fake_scroll_down_long ( selector_to_make_tall = "#main-outlet" )
179
- # Trick to give a huge vertical space to scroll
180
- page . execute_script (
181
- "document.querySelector('#{ selector_to_make_tall } ').style.height = '10000px'" ,
182
- )
183
-
184
- sleep 0.1 # most resilient solution for now
185
-
186
- page . scroll_to ( 0 , 1000 )
179
+ find ( selector_to_make_tall )
180
+ execute_script ( <<~JS )
181
+ (function() {
182
+ const el = document.querySelector("#{ selector_to_make_tall } ");
183
+ if (!el) {
184
+ throw new Error("Element '#{ selector_to_make_tall } ' not found");
185
+ }
186
+ el.style.minHeight = "10000px";
187
+
188
+ const sentinel = document.createElement("div");
189
+ sentinel.id = "scroll-sentinel";
190
+ sentinel.style.width = "1px";
191
+ sentinel.style.height = "1px";
192
+ document.body.appendChild(sentinel);
193
+ })();
194
+ JS
195
+ find ( "#scroll-sentinel" )
196
+ execute_script ( 'document.getElementById("scroll-sentinel").scrollIntoView()' )
187
197
end
188
198
189
199
def setup_or_skip_s3_system_test ( enable_secure_uploads : false , enable_direct_s3_uploads : true )
You can’t perform that action at this time.
0 commit comments