Skip to content

Commit fb390cd

Browse files
committed
Avoid stable-scroll flake in browser interactions
1 parent a7cc9d5 commit fb390cd

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/PrompterOne.Web.UITests/Support/UiInteractionDriver.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,14 @@ await Expect(locator).ToBeEnabledAsync(new()
219219
{
220220
Timeout = BrowserTestConstants.Timing.ExtendedVisibleTimeoutMs
221221
});
222-
await locator.ScrollIntoViewIfNeededAsync();
222+
await locator.EvaluateAsync(
223+
"""
224+
element => element.scrollIntoView({
225+
block: 'center',
226+
inline: 'center',
227+
behavior: 'auto'
228+
})
229+
""");
223230
}
224231

225232
private static Task WaitUntilEditableAsync(IPage page, string testId, int timeoutMs) =>

0 commit comments

Comments
 (0)