Browse Source

test(cypress): Scroll element in the center of the view

This avoid elements to be hided by a fixed top bar.
Especially useful for the file list.

Signed-off-by: Louis Chemineau <louis@chmn.me>
Louis Chemineau 1 month ago
parent
commit
d9e09d5883
1 changed files with 4 additions and 0 deletions
  1. 4 0
      cypress.config.ts

+ 4 - 0
cypress.config.ts

@@ -32,6 +32,10 @@ export default defineConfig({
 	// faster video processing
 	videoCompression: false,
 
+	// Prevent elements to be scrolled under a top bar during actions (click, clear, type, etc). Default is 'top'.
+	// https://github.com/cypress-io/cypress/issues/871
+	scrollBehavior: 'center',
+
 	// Visual regression testing
 	env: {
 		failSilently: false,