From 0aef8dc2bd0c28f4bfd1231a0f835780ac711ac0 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Mon, 27 Oct 2025 15:21:19 -0400 Subject: [PATCH 01/35] migrate visibility tests to static fixtures --- .../cypress/e2e/dom/visibility-migration.md | 197 +++ .../driver/cypress/e2e/dom/visibility.cy.ts | 1500 +++-------------- .../visibility/basic-css-properties.html | 71 + .../cypress/fixtures/visibility/empty.html | 4 + .../fixtures/visibility/form-elements.html | 65 + .../cypress/fixtures/visibility/overflow.html | 273 +++ .../fixtures/visibility/positioning.html | 113 ++ .../cypress/fixtures/visibility/style.css | 13 + .../fixtures/visibility/table-visibility.html | 77 + .../fixtures/visibility/transforms.html | 145 ++ .../driver/cypress/fixtures/visibility/ux.js | 37 + packages/driver/src/dom/visibility.ts | 2 +- 12 files changed, 1243 insertions(+), 1254 deletions(-) create mode 100644 packages/driver/cypress/e2e/dom/visibility-migration.md create mode 100644 packages/driver/cypress/fixtures/visibility/basic-css-properties.html create mode 100644 packages/driver/cypress/fixtures/visibility/empty.html create mode 100644 packages/driver/cypress/fixtures/visibility/form-elements.html create mode 100644 packages/driver/cypress/fixtures/visibility/overflow.html create mode 100644 packages/driver/cypress/fixtures/visibility/positioning.html create mode 100644 packages/driver/cypress/fixtures/visibility/style.css create mode 100644 packages/driver/cypress/fixtures/visibility/table-visibility.html create mode 100644 packages/driver/cypress/fixtures/visibility/transforms.html create mode 100644 packages/driver/cypress/fixtures/visibility/ux.js diff --git a/packages/driver/cypress/e2e/dom/visibility-migration.md b/packages/driver/cypress/e2e/dom/visibility-migration.md new file mode 100644 index 00000000000..a8ce2d63ed9 --- /dev/null +++ b/packages/driver/cypress/e2e/dom/visibility-migration.md @@ -0,0 +1,197 @@ +# Visibility Test Migration Guide + +This document outlines the comprehensive matrix of visibility test situations covered in the `hidden/visible overrides` section of `visibility.cy.ts` and tracks their migration status to the declarative format. + +### Migration Status Legend +- ✅ **Migrated** - Covered in declarative HTML fixtures (`visibility scenarios` section) +- ❌ **Not Migrated** - Still in imperative test cases (`hidden/visible overrides` section) +- 🔄 **Partially Migrated** - Some scenarios covered, others remain imperative due to technical constraints + +## CSS Properties Matrix + +| **Element State** | **Parent State** | **Visibility** | **Display** | **Opacity** | **Expected Result** | **Status** | +|-------------------|------------------|----------------|-------------|-------------|---------------------|------------| +| Applied to element | - | `hidden` | - | - | Hidden | ✅ | +| - | Applied to parent | `hidden` | - | - | Child hidden | ✅ | +| Applied to `` | - | `collapse` | - | - | Hidden | ✅ | +| Applied to `` | - | `collapse` | - | - | Hidden | ✅ | +| - | Applied to parent | `collapse` | - | - | Child hidden | ✅ | +| `input type="hidden"` | - | - | - | - | Hidden | ✅ | +| Applied to element | - | - | `none` | - | Hidden | ✅ | +| - | Applied to parent | - | `none` | - | Child hidden | ✅ | +| - | Parent has inline | - | `inline` | - | Child with `display: block` visible | ❌ | +| Applied to element | - | - | - | `0` | Hidden | ✅ | +| - | Applied to parent | - | - | `0` | Child hidden | ✅ | +| Applied to element | - | - | - | `0.5` | Visible | ✅ | + +## Dimensions Matrix + +| **Width** | **Height** | **Content** | **Visibility** | **Display** | **Opacity** | **Expected Result** | **Status** | +|-----------|------------|-------------|----------------|-------------|-------------|---------------------|------------| +| 0 | 100px | Text content | - | - | - | Visible | ✅ | +| 50px | 0 | Text content | - | - | - | Visible | ✅ | +| 0 | 50px | Whitespace only | - | - | - | Hidden | ✅ | +| 0 | 100px | No content | - | - | - | Hidden | ✅ | +| 50px | 0 | No content | - | - | - | Hidden | ✅ | +| 0 | 100px | - | - | - | - | Child hidden (overflow: hidden) | ✅ | +| 100px | 0 | - | - | - | - | Child hidden (overflow: hidden) | ✅ | +| 0 | 100px | - | - | - | - | Descendant hidden (overflow: hidden) | ✅ | +| 100px | 0 | - | - | - | - | Descendant hidden (overflow: hidden) | ✅ | +| 100px | 100px | - | - | - | - | Child visible (overflow: hidden) | ✅ | +| 0 | 0 | - | - | - | - | Child hidden (overflow: auto) | ✅ | + +## Positioning Matrix + +| **Element Position** | **Parent Position** | **Parent Dimensions** | **Visibility** | **Display** | **Opacity** | **Expected Result** | **Status** | +|---------------------|---------------------|----------------------|----------------|-------------|-------------|---------------------|------------| +| `absolute` | - | Zero width | - | - | - | Element visible | ✅ | +| `absolute` | - | Zero width ancestor | - | - | - | Element visible | ✅ | +| Static | `absolute` | Zero width | - | - | - | Element hidden | ✅ | +| `fixed` | - | Normal | - | - | - | Element visible | ✅ | +| `fixed` | - | Normal ancestor | - | - | - | Element visible | ✅ | +| `fixed` | - | Normal | Covered by another | - | - | Element hidden | ✅ | +| `fixed` | - | Normal | Off-screen | - | - | Element hidden | ✅ | +| `fixed` + `pointer-events: none` | - | Normal | - | - | - | Element visible | ✅ | +| `fixed` | `pointer-events: none` | Normal | - | - | - | Element visible | ✅ | +| `fixed` | `pointer-events: none` | Normal | Covered by another | - | - | Element hidden | ✅ | +| `sticky` | - | Normal | - | - | - | Element visible | ✅ | + +## Form Elements Matrix + +| **Element Type** | **Parent State** | **Element State** | **Visibility** | **Display** | **Opacity** | **Expected Result** | **Status** | +|------------------|------------------|-------------------|----------------|-------------|-------------|---------------------|------------| +| `