test: deflakes blocks e2e (#11640)
The blocks e2e tests were flaky due to how we conditionally render fields as they enter the viewport. This prevented Playwright from every reaching the target element when running `locator.scrollIntoViewIfNeeded()`. This is especially flaky on pages with many fields because the page size would continually grow as it was scrolled. To fix this there are new `scrollEntirePage` and `waitForPageStability` helpers. Together, these will ensure that all fields are rendered and fully loaded before we start testing. An early attempt at this was made via `page.mouse.wheel(0, 1750)`, but this is an arbitrary pixel value that is error prone and is not future proof. These tests were also flaky by an attempt to trigger a form state action before it was ready to receive events. The fix here is to disable any buttons while the form is initializing and let Playwright wait for an interactive state.
This commit is contained in:
@@ -1086,6 +1086,7 @@ export interface CodeField {
|
||||
json?: string | null;
|
||||
html?: string | null;
|
||||
css?: string | null;
|
||||
codeWithPadding?: string | null;
|
||||
updatedAt: string;
|
||||
createdAt: string;
|
||||
}
|
||||
@@ -2853,6 +2854,7 @@ export interface CodeFieldsSelect<T extends boolean = true> {
|
||||
json?: T;
|
||||
html?: T;
|
||||
css?: T;
|
||||
codeWithPadding?: T;
|
||||
updatedAt?: T;
|
||||
createdAt?: T;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user