Record touch and keyboard acceptance with isolated SQL validation
@@ -0,0 +1,33 @@
|
||||
@page "/density-pilot"
|
||||
@layout ZB.MOM.WW.OtOpcUa.AdminUI.Components.Layout.MainLayout
|
||||
<h1>Local Raw virtualization verification</h1>
|
||||
<p>Actual RawTree with800 synthetic already-loaded tags. Local in-memory context contains fixture-only records; browser/protocol sessions and mutations reject calls.</p>
|
||||
<div id="density-fixture">
|
||||
<RawTree Roots="_roots" PickerMode="true" SelectedTagIds="_selected" OnSelectionChanged="SelectedChanged" ResolveDescendantTagIds="ResolveTags" />
|
||||
</div>
|
||||
<output id="selection-count">@_selected.Count selected</output>
|
||||
<output id="selection-request-count">@_selectionRequests</output>
|
||||
@code {
|
||||
private readonly HashSet<string> _selected = [];
|
||||
private int _selectionRequests;
|
||||
private List<RawNode> _roots = Build();
|
||||
[SupplyParameterFromQuery] public bool Deep { get; set; }
|
||||
protected override void OnParametersSet() { if(Deep) _roots = DeepRoots(); }
|
||||
private static List<RawNode> DeepRoots()
|
||||
{
|
||||
var leaf = new RawNode { Kind=RawNodeKind.Tag, Key="deep-tag", DisplayName="Deep synthetic tag " + new string('x',120), EntityId="deep-tag" };
|
||||
for(int i=24;i>=0;i--)
|
||||
{
|
||||
var parent = new RawNode { Kind=RawNodeKind.Folder, Key="deep-"+i, DisplayName="Synthetic folder level " + i, Expanded=true, Loaded=true, HasLazyChildren=true };
|
||||
parent.Children.Add(leaf); leaf=parent;
|
||||
}
|
||||
return [leaf];
|
||||
}
|
||||
private static List<RawNode> Build()
|
||||
{
|
||||
var root = new RawNode { Kind=RawNodeKind.Device, Key="dev:local", DisplayName="Synthetic device", EntityId="device-local", ClusterId="synthetic", DriverType="Modbus", Expanded=true, Loaded=true, HasLazyChildren=true };
|
||||
root.Children.AddRange(Enumerable.Range(0,800).Select(i => new RawNode { Kind=RawNodeKind.Tag, Key="tag:local-"+i, DisplayName=$"Synthetic tag {i:000}", EntityId="tag-local-"+i, ClusterId="synthetic" }));root.ChildCount=root.Children.Count;return [root];
|
||||
}
|
||||
private void SelectedChanged() { }
|
||||
private Task<IReadOnlyList<string>> ResolveTags(RawNode node) { _selectionRequests++; return Task.FromResult<IReadOnlyList<string>>(node.Children.Select(n => n.EntityId!).ToArray()); }
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
"""Correct native-zoom screenshot framing; repeat only the two affected functional cases."""
|
||||
import verify
|
||||
from playwright.sync_api import sync_playwright
|
||||
verify.OUT=verify.HERE/'confirmation';verify.OUT.mkdir(exist_ok=True)
|
||||
with sync_playwright() as p:
|
||||
with verify.zoom_browser(p) as (ctx,worker):
|
||||
page=ctx.new_page()
|
||||
for width,expected in [(1440,720),(390,195)]:
|
||||
page.set_viewport_size({'width':width,'height':900});verify.ready(page,'/density-pilot')
|
||||
assert verify.set_browser_zoom(worker,page,2)==2
|
||||
verify.tree_case(page,'raw-real200-'+str(expected))
|
||||
data=verify.measure(page);assert data['width']==expected and data['dpr']==2,data
|
||||
verify.set_browser_zoom(worker,page,1)
|
||||
print('PASS2actual zoom cases; viewport screenshots preserve native zoom framing')
|
||||
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 169 KiB |
@@ -0,0 +1,58 @@
|
||||
[
|
||||
{
|
||||
"case": "raw-real200-720",
|
||||
"initial": {
|
||||
"width": 720,
|
||||
"dpr": 2,
|
||||
"scroll": 720,
|
||||
"coarse": false,
|
||||
"rows": 53,
|
||||
"heights": [
|
||||
30
|
||||
],
|
||||
"density": "compact",
|
||||
"treeScroll": 680
|
||||
},
|
||||
"final": {
|
||||
"width": 720,
|
||||
"dpr": 2,
|
||||
"scroll": 720,
|
||||
"coarse": false,
|
||||
"rows": 53,
|
||||
"heights": [
|
||||
30
|
||||
],
|
||||
"density": "compact",
|
||||
"treeScroll": 680
|
||||
},
|
||||
"errors": []
|
||||
},
|
||||
{
|
||||
"case": "raw-real200-195",
|
||||
"initial": {
|
||||
"width": 195,
|
||||
"dpr": 2,
|
||||
"scroll": 195,
|
||||
"coarse": false,
|
||||
"rows": 53,
|
||||
"heights": [
|
||||
30
|
||||
],
|
||||
"density": "compact",
|
||||
"treeScroll": 241
|
||||
},
|
||||
"final": {
|
||||
"width": 195,
|
||||
"dpr": 2,
|
||||
"scroll": 195,
|
||||
"coarse": false,
|
||||
"rows": 53,
|
||||
"heights": [
|
||||
30
|
||||
],
|
||||
"density": "compact",
|
||||
"treeScroll": 215
|
||||
},
|
||||
"errors": []
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,28 @@
|
||||
Traceback (most recent call last):
|
||||
File "/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/components/ui-theme/validation/ot-ui/ot07-root/verify.py", line 38, in <module>
|
||||
ctx=b.new_context(viewport={'width':width,'height':900},has_touch=touch,is_mobile=touch);page=ctx.new_page();tree_case(page,f'raw-{width}-coarse-{touch}',touch);ctx.close()
|
||||
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/components/ui-theme/validation/ot-ui/ot07-root/verify.py", line 33, in tree_case
|
||||
tree.evaluate('(e)=>e.scrollTop=e.scrollHeight');more=page.get_by_role('button',name=re.compile('Show 300 more'));expect(more).to_be_visible();more.click();tree.evaluate('(e)=>e.scrollTop=e.scrollHeight');expect(page.get_by_role('checkbox',name='Synthetic tag 799',exact=True)).to_be_visible();assert page.locator('.raw-tree-row').count()<100
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/sync_api/_generated.py", line 20523, in to_be_visible
|
||||
self._sync(self._impl_obj.to_be_visible(visible=visible, timeout=timeout))
|
||||
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_sync_base.py", line 115, in _sync
|
||||
return task.result()
|
||||
~~~~~~~~~~~^^
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_assertions.py", line 765, in to_be_visible
|
||||
await self._expect_impl(
|
||||
...<5 lines>...
|
||||
)
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_assertions.py", line 85, in _expect_impl
|
||||
raise AssertionError(
|
||||
f"{out_message}\nActual value: {actual}{error_message} {format_call_log(result.get('log'))}"
|
||||
)
|
||||
AssertionError: Locator expected to be visible
|
||||
Actual value: None
|
||||
Error: element(s) not found
|
||||
Call log:
|
||||
- Expect "to_be_visible" with timeout 5000ms
|
||||
- waiting for get_by_role("checkbox", name="Synthetic tag 799", exact=True)
|
||||
|
||||
|
After Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 146 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 80 KiB |
@@ -0,0 +1,303 @@
|
||||
[
|
||||
{
|
||||
"case": "raw-1440-coarse-False",
|
||||
"initial": {
|
||||
"width": 1440,
|
||||
"dpr": 1,
|
||||
"scroll": 1440,
|
||||
"coarse": false,
|
||||
"rows": 62,
|
||||
"heights": [
|
||||
30
|
||||
],
|
||||
"density": "compact",
|
||||
"treeScroll": 1180
|
||||
},
|
||||
"final": {
|
||||
"width": 1440,
|
||||
"dpr": 1,
|
||||
"scroll": 1440,
|
||||
"coarse": false,
|
||||
"rows": 62,
|
||||
"heights": [
|
||||
30
|
||||
],
|
||||
"density": "compact",
|
||||
"treeScroll": 1180
|
||||
},
|
||||
"errors": []
|
||||
},
|
||||
{
|
||||
"case": "raw-390-coarse-False",
|
||||
"initial": {
|
||||
"width": 390,
|
||||
"dpr": 1,
|
||||
"scroll": 390,
|
||||
"coarse": false,
|
||||
"rows": 62,
|
||||
"heights": [
|
||||
30
|
||||
],
|
||||
"density": "compact",
|
||||
"treeScroll": 350
|
||||
},
|
||||
"final": {
|
||||
"width": 390,
|
||||
"dpr": 1,
|
||||
"scroll": 390,
|
||||
"coarse": false,
|
||||
"rows": 62,
|
||||
"heights": [
|
||||
30
|
||||
],
|
||||
"density": "compact",
|
||||
"treeScroll": 350
|
||||
},
|
||||
"errors": []
|
||||
},
|
||||
{
|
||||
"case": "raw-195-coarse-False",
|
||||
"initial": {
|
||||
"width": 195,
|
||||
"dpr": 1,
|
||||
"scroll": 195,
|
||||
"coarse": false,
|
||||
"rows": 62,
|
||||
"heights": [
|
||||
30
|
||||
],
|
||||
"density": "compact",
|
||||
"treeScroll": 245
|
||||
},
|
||||
"final": {
|
||||
"width": 195,
|
||||
"dpr": 1,
|
||||
"scroll": 195,
|
||||
"coarse": false,
|
||||
"rows": 62,
|
||||
"heights": [
|
||||
30
|
||||
],
|
||||
"density": "compact",
|
||||
"treeScroll": 219
|
||||
},
|
||||
"errors": []
|
||||
},
|
||||
{
|
||||
"case": "raw-390-coarse-True",
|
||||
"initial": {
|
||||
"width": 390,
|
||||
"dpr": 1,
|
||||
"scroll": 390,
|
||||
"coarse": true,
|
||||
"rows": 55,
|
||||
"heights": [
|
||||
44
|
||||
],
|
||||
"density": "touch",
|
||||
"treeScroll": 350
|
||||
},
|
||||
"final": {
|
||||
"width": 390,
|
||||
"dpr": 1,
|
||||
"scroll": 390,
|
||||
"coarse": true,
|
||||
"rows": 55,
|
||||
"heights": [
|
||||
44
|
||||
],
|
||||
"density": "touch",
|
||||
"treeScroll": 350
|
||||
},
|
||||
"errors": []
|
||||
},
|
||||
{
|
||||
"case": "live-density-focus",
|
||||
"sameDomNode": true,
|
||||
"selected": true,
|
||||
"initialAndFinalDesktop30": true
|
||||
},
|
||||
{
|
||||
"case": "open-menu-resize",
|
||||
"box": {
|
||||
"x": 198.265625,
|
||||
"y": 273.71875,
|
||||
"width": 183.734375,
|
||||
"height": 74.375
|
||||
}
|
||||
},
|
||||
{
|
||||
"case": "deep-195",
|
||||
"measurements": {
|
||||
"width": 195,
|
||||
"dpr": 1,
|
||||
"scroll": 195,
|
||||
"coarse": false,
|
||||
"rows": 26,
|
||||
"heights": [
|
||||
30
|
||||
],
|
||||
"density": "compact",
|
||||
"treeScroll": 1573
|
||||
},
|
||||
"localKeyboardHorizontalScroll": true,
|
||||
"nativeSelect": true
|
||||
},
|
||||
{
|
||||
"case": "deep-390",
|
||||
"measurements": {
|
||||
"width": 390,
|
||||
"dpr": 1,
|
||||
"scroll": 390,
|
||||
"coarse": true,
|
||||
"rows": 26,
|
||||
"heights": [
|
||||
44
|
||||
],
|
||||
"density": "touch",
|
||||
"treeScroll": 1619
|
||||
},
|
||||
"localKeyboardHorizontalScroll": true,
|
||||
"nativeSelect": true
|
||||
},
|
||||
{
|
||||
"case": "script-log-1440",
|
||||
"measurements": {
|
||||
"width": 1440,
|
||||
"dpr": 1,
|
||||
"scroll": 1440,
|
||||
"coarse": false,
|
||||
"rows": 0,
|
||||
"heights": [],
|
||||
"density": null,
|
||||
"treeScroll": null
|
||||
},
|
||||
"targets": 3
|
||||
},
|
||||
{
|
||||
"case": "script-log-195",
|
||||
"measurements": {
|
||||
"width": 195,
|
||||
"dpr": 1,
|
||||
"scroll": 195,
|
||||
"coarse": false,
|
||||
"rows": 0,
|
||||
"heights": [],
|
||||
"density": null,
|
||||
"treeScroll": null
|
||||
},
|
||||
"targets": 3
|
||||
},
|
||||
{
|
||||
"case": "script-log-390",
|
||||
"measurements": {
|
||||
"width": 390,
|
||||
"dpr": 1,
|
||||
"scroll": 390,
|
||||
"coarse": true,
|
||||
"rows": 0,
|
||||
"heights": [],
|
||||
"density": null,
|
||||
"treeScroll": null
|
||||
},
|
||||
"targets": 3
|
||||
},
|
||||
{
|
||||
"case": "diagnostics-1440",
|
||||
"measurements": {
|
||||
"width": 1440,
|
||||
"dpr": 1,
|
||||
"scroll": 1440,
|
||||
"coarse": false,
|
||||
"rows": 0,
|
||||
"heights": [],
|
||||
"density": null,
|
||||
"treeScroll": null
|
||||
},
|
||||
"targets": 4
|
||||
},
|
||||
{
|
||||
"case": "diagnostics-195",
|
||||
"measurements": {
|
||||
"width": 195,
|
||||
"dpr": 1,
|
||||
"scroll": 195,
|
||||
"coarse": false,
|
||||
"rows": 0,
|
||||
"heights": [],
|
||||
"density": null,
|
||||
"treeScroll": null
|
||||
},
|
||||
"targets": 4
|
||||
},
|
||||
{
|
||||
"case": "diagnostics-390",
|
||||
"measurements": {
|
||||
"width": 390,
|
||||
"dpr": 1,
|
||||
"scroll": 390,
|
||||
"coarse": true,
|
||||
"rows": 0,
|
||||
"heights": [],
|
||||
"density": null,
|
||||
"treeScroll": null
|
||||
},
|
||||
"targets": 4
|
||||
},
|
||||
{
|
||||
"case": "raw-real200",
|
||||
"initial": {
|
||||
"width": 720,
|
||||
"dpr": 2,
|
||||
"scroll": 720,
|
||||
"coarse": false,
|
||||
"rows": 53,
|
||||
"heights": [
|
||||
30
|
||||
],
|
||||
"density": "compact",
|
||||
"treeScroll": 680
|
||||
},
|
||||
"final": {
|
||||
"width": 720,
|
||||
"dpr": 2,
|
||||
"scroll": 720,
|
||||
"coarse": false,
|
||||
"rows": 53,
|
||||
"heights": [
|
||||
30
|
||||
],
|
||||
"density": "compact",
|
||||
"treeScroll": 680
|
||||
},
|
||||
"errors": []
|
||||
},
|
||||
{
|
||||
"case": "raw-narrow-real200",
|
||||
"initial": {
|
||||
"width": 195,
|
||||
"dpr": 2,
|
||||
"scroll": 195,
|
||||
"coarse": false,
|
||||
"rows": 53,
|
||||
"heights": [
|
||||
30
|
||||
],
|
||||
"density": "compact",
|
||||
"treeScroll": 241
|
||||
},
|
||||
"final": {
|
||||
"width": 195,
|
||||
"dpr": 2,
|
||||
"scroll": 195,
|
||||
"coarse": false,
|
||||
"rows": 53,
|
||||
"heights": [
|
||||
30
|
||||
],
|
||||
"density": "compact",
|
||||
"treeScroll": 215
|
||||
},
|
||||
"errors": []
|
||||
}
|
||||
]
|
||||
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 33 KiB |
@@ -0,0 +1,33 @@
|
||||
Traceback (most recent call last):
|
||||
File "/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/components/ui-theme/validation/ot-ui/ot07-root/keyboard_menu.py", line 13, in <module>
|
||||
trigger.focus();page.keyboard.press('Enter');expect(menu).to_be_focused();page.keyboard.press('Tab');page.keyboard.press('Tab');expect(menu.locator('[role=menuitem]').nth(1)).to_be_focused();page.keyboard.press('Enter');expect(menu).to_have_count(0);expect(page.locator('#selection-count')).to_have_text('0 selected');expect(page.locator('#selection-request-count')).to_have_text('2');expect(trigger).to_be_focused();assert not errors
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/sync_api/_generated.py", line 20080, in to_have_text
|
||||
self._sync(
|
||||
~~~~~~~~~~^
|
||||
self._impl_obj.to_have_text(
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
...<4 lines>...
|
||||
)
|
||||
^
|
||||
)
|
||||
^
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_sync_base.py", line 115, in _sync
|
||||
return task.result()
|
||||
~~~~~~~~~~~^^
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_assertions.py", line 561, in to_have_text
|
||||
await self._expect_impl(
|
||||
...<9 lines>...
|
||||
)
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_assertions.py", line 85, in _expect_impl
|
||||
raise AssertionError(
|
||||
f"{out_message}\nActual value: {actual}{error_message} {format_call_log(result.get('log'))}"
|
||||
)
|
||||
AssertionError: Locator expected to have text '0 selected'
|
||||
Actual value: 800 selected
|
||||
Call log:
|
||||
- Expect "to_have_text" with timeout 5000ms
|
||||
- waiting for locator("#selection-count")
|
||||
9 × locator resolved to <output id="selection-count">800 selected</output>
|
||||
- unexpected value "800 selected"
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
[
|
||||
{
|
||||
"engine": "chromium",
|
||||
"version": "145.0.7632.6",
|
||||
"parentEnterDispatches": 1,
|
||||
"selectedAfterParent": 800,
|
||||
"focusedChildEnterDispatches": 1,
|
||||
"selectedAfterChild": 0,
|
||||
"totalLocalRequests": 2,
|
||||
"focusReturned": true,
|
||||
"menuBox": {
|
||||
"x": 198.265625,
|
||||
"y": 273.71875,
|
||||
"width": 183.734375,
|
||||
"height": 74.375
|
||||
},
|
||||
"nativeTopLayer": true,
|
||||
"errors": []
|
||||
},
|
||||
{
|
||||
"engine": "firefox",
|
||||
"version": "146.0.1",
|
||||
"parentEnterDispatches": 1,
|
||||
"selectedAfterParent": 800,
|
||||
"focusedChildEnterDispatches": 1,
|
||||
"selectedAfterChild": 0,
|
||||
"totalLocalRequests": 2,
|
||||
"focusReturned": true,
|
||||
"menuBox": {
|
||||
"x": 198.28334045410156,
|
||||
"y": 273.70001220703125,
|
||||
"width": 183.71665954589844,
|
||||
"height": 74.39999389648438
|
||||
},
|
||||
"nativeTopLayer": true,
|
||||
"errors": []
|
||||
},
|
||||
{
|
||||
"engine": "webkit",
|
||||
"version": "26.0",
|
||||
"parentEnterDispatches": 1,
|
||||
"selectedAfterParent": 800,
|
||||
"focusedChildEnterDispatches": 1,
|
||||
"selectedAfterChild": 0,
|
||||
"totalLocalRequests": 2,
|
||||
"focusReturned": true,
|
||||
"menuBox": {
|
||||
"x": 198.265625,
|
||||
"y": 270,
|
||||
"width": 183.734375,
|
||||
"height": 74.375
|
||||
},
|
||||
"nativeTopLayer": true,
|
||||
"errors": []
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,38 @@
|
||||
Traceback (most recent call last):
|
||||
File "/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/components/ui-theme/validation/ot-ui/ot07-root/keyboard_menu.py", line 9, in <module>
|
||||
page.goto('http://127.0.0.1:18139/density-pilot');page.wait_for_selector('.raw-tree-row');expect(page.locator('#selection-request-count')).to_have_text('0')
|
||||
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/sync_api/_generated.py", line 8217, in wait_for_selector
|
||||
self._sync(
|
||||
~~~~~~~~~~^
|
||||
self._impl_obj.wait_for_selector(
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
selector=selector, timeout=timeout, state=state, strict=strict
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
)
|
||||
^
|
||||
)
|
||||
^
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_sync_base.py", line 115, in _sync
|
||||
return task.result()
|
||||
~~~~~~~~~~~^^
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_page.py", line 419, in wait_for_selector
|
||||
return await self._main_frame.wait_for_selector(**locals_to_params(locals()))
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_frame.py", line 369, in wait_for_selector
|
||||
await self._channel.send(
|
||||
"waitForSelector", self._timeout, locals_to_params(locals())
|
||||
)
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_connection.py", line 69, in send
|
||||
return await self._connection.wrap_api_call(
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
...<3 lines>...
|
||||
)
|
||||
^
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_connection.py", line 559, in wrap_api_call
|
||||
raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None
|
||||
playwright._impl._errors.TimeoutError: Page.wait_for_selector: Timeout 30000ms exceeded.
|
||||
Call log:
|
||||
- waiting for locator(".raw-tree-row") to be visible
|
||||
61 × locator resolved to 61 elements. Proceeding with the first one: <div class="raw-tree-row d-flex align-items-center gap-1">…</div>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
Traceback (most recent call last):
|
||||
File "/Users/dohertj2/.codex/worktrees/scada-ui-consistency/scadaproj/components/ui-theme/validation/ot-ui/ot07-root/keyboard_menu.py", line 12, in <module>
|
||||
assert menu.evaluate('(e)=>e.matches(":popover-open")');page.keyboard.press('Enter');expect(menu).to_have_count(0);expect(page.locator('#selection-count')).to_have_text('800 selected');expect(page.locator('#selection-request-count')).to_have_text('1');expect(trigger).to_be_focused();assert not errors
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/sync_api/_generated.py", line 20572, in to_be_focused
|
||||
self._sync(self._impl_obj.to_be_focused(timeout=timeout))
|
||||
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_sync_base.py", line 115, in _sync
|
||||
return task.result()
|
||||
~~~~~~~~~~~^^
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_assertions.py", line 786, in to_be_focused
|
||||
await self._expect_impl(
|
||||
...<5 lines>...
|
||||
)
|
||||
File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_assertions.py", line 85, in _expect_impl
|
||||
raise AssertionError(
|
||||
f"{out_message}\nActual value: {actual}{error_message} {format_call_log(result.get('log'))}"
|
||||
)
|
||||
AssertionError: Locator expected to be focused
|
||||
Actual value: inactive
|
||||
Call log:
|
||||
- Expect "to_be_focused" with timeout 5000ms
|
||||
- waiting for locator(".ctx-ellipsis").first
|
||||
9 × locator resolved to <button type="button" b-e34sbdwx8a="" class="ctx-ellipsis" aria-haspopup="true" title="More actions for Synthetic device" _bl_4f93a5a6-8648-4182-86fd-0bffbf39f77d="" aria-label="More actions for Synthetic device">…</button>
|
||||
- unexpected value "inactive"
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
"""Actual keyboard dispatch once through the original ContextMenu in three browser engines."""
|
||||
from pathlib import Path
|
||||
import json
|
||||
from playwright.sync_api import sync_playwright,expect
|
||||
out=Path(__file__).resolve().parent;results=[]
|
||||
with sync_playwright() as p:
|
||||
for name in ['chromium','firefox','webkit']:
|
||||
b=getattr(p,name).launch();page=b.new_page(viewport={'width':390,'height':844},reduced_motion='reduce');errors=[];page.on('pageerror',lambda e:errors.append(str(e)))
|
||||
page.goto('http://127.0.0.1:18139/density-pilot');page.wait_for_selector('.raw-tree-row',state='attached');page.evaluate('document.fonts.ready');page.wait_for_timeout(350);expect(page.locator('#selection-request-count')).to_have_text('0')
|
||||
trigger=page.locator('.ctx-ellipsis').first;trigger.focus();expect(trigger).to_be_focused();page.keyboard.press('Enter');menu=page.locator('[role=menu]');expect(menu).to_be_focused()
|
||||
box=menu.bounding_box();assert box and box['x']>=0 and box['x']+box['width']<=390+.5
|
||||
assert menu.evaluate('(e)=>e.matches(":popover-open")');page.keyboard.press('Enter');expect(menu).to_have_count(0);expect(page.locator('#selection-count')).to_have_text('800 selected');expect(page.locator('#selection-request-count')).to_have_text('1');expect(trigger).to_be_focused()
|
||||
trigger.focus();page.keyboard.press('Enter');expect(menu).to_be_focused();page.keyboard.press('Tab');page.keyboard.press('Tab');expect(menu.locator('[role=menuitem]').nth(1)).to_be_focused();page.keyboard.press('Enter');expect(menu).to_have_count(0);expect(page.locator('#selection-count')).to_have_text('0 selected');expect(page.locator('#selection-request-count')).to_have_text('2');expect(trigger).to_be_focused();assert not errors
|
||||
results.append({'engine':name,'version':b.version,'parentEnterDispatches':1,'selectedAfterParent':800,'focusedChildEnterDispatches':1,'selectedAfterChild':0,'totalLocalRequests':2,'focusReturned':True,'menuBox':box,'nativeTopLayer':True,'errors':errors});(out/'keyboard-menu-three-engines.json').write_text(json.dumps(results,indent=2)+'\n');b.close()
|
||||
(out/'keyboard-menu-three-engines.json').write_text(json.dumps(results,indent=2)+'\n');print('PASS3actual keyboard menus;parent+focused-child eachdispatchonce;focusreturn/native top layer')
|
||||
@@ -0,0 +1,11 @@
|
||||
# Independent OT07 density and menu review
|
||||
|
||||
Reviewed the frozen RawTree, ContextMenu, context-menu CSS, site CSS, FleetDiagnostics markup and tree-layout module against the preceding source. No concrete blocker found in this bounded change.
|
||||
|
||||
The new explicit overflow:auto viewport is a deliberate virtualization root. Row geometry and ItemSize use the same30/44 state; node keys, lazy loading, paging, mutation callbacks and selection payloads remain. The checkbox's larger implicit-label target retains the existing visible-node aria-labelledby relationship. Desktop density remains compact; coarse targets use44 without allowing narrow labels to inflate the row estimate.
|
||||
|
||||
Density initialization serializes import/observer/disposal and prevents an older initial media result overwriting a newer observation. Disposed callbacks cannot apply geometry. Menu setup captures its current presentation before awaits and checks generation/disposal before placement/focus. The JS module observes resize/removal, releases listeners/observers, keeps the original Blazor-owned node and uses manual native popover top-layer placement where supported; no cloned/reparented action nodes or replacement action/policy logic were introduced. Key-default prevention remains synchronous while original C# keyboard/action handlers keep ownership.
|
||||
|
||||
The named typed diagnostics field and toolbar geometry preserve values/event expressions. Reviewed retained native16-case records:30/44 exact rows, bounded55–62 mounted of800,500→800 paging,25-level local keyboard pan, selected same DOM/focus through density transitions, menu resize/coarse activation, and real200% innerWidth720/195 with DPR2. Recorded menu size is bounded (resize sample183.73×74.38). The two zoom screenshot framing corrections are capture corrections; the earlier photos are not claimed valid. This review did not rerun those existing suites without a new concern.
|
||||
|
||||
Actual broader browser/support/final whole-app acceptance remains OT14; this is not an exhaustive new certification of every native popover/focus failure mode. RawTree controller target/callback/follow-up sequencing and OT12 semantic/icon work remain the primary agent's next scope after this source commit/handoff.
|
||||
@@ -0,0 +1,61 @@
|
||||
"""Actual loopback OT density/menu/toolbars, real browser zoom and native coarse pointer input."""
|
||||
import hashlib,json,re,sys
|
||||
from pathlib import Path
|
||||
from playwright.sync_api import sync_playwright,expect
|
||||
HERE=Path(__file__).resolve().parent
|
||||
sys.path.insert(0,str(HERE.parents[1]/'theme-1.0.0'/'canary'))
|
||||
from browser_zoom import zoom_browser,set_browser_zoom
|
||||
BASE='http://127.0.0.1:18139';OUT=HERE/'first';OUT.mkdir(exist_ok=True)
|
||||
results=[]
|
||||
def save(): (OUT/'results.json').write_text(json.dumps(results,indent=2)+'\n')
|
||||
def ready(page,path):
|
||||
page.goto(BASE+path);page.wait_for_selector('h1');page.evaluate('document.fonts.ready');page.wait_for_timeout(350)
|
||||
def measure(page):
|
||||
return page.evaluate('''()=>({width:innerWidth,dpr:devicePixelRatio,scroll:document.documentElement.scrollWidth,coarse:matchMedia('(pointer:coarse)').matches,rows:document.querySelectorAll('.raw-tree-row').length,heights:[...new Set([...document.querySelectorAll('.raw-tree-row')].map(e=>e.getBoundingClientRect().height))],density:document.querySelector('.raw-tree-rows')?.dataset.density,treeScroll:document.querySelector('.raw-tree-rows')?.scrollWidth})''')
|
||||
def menu_inside(page):
|
||||
menu=page.locator('[role=menu]');expect(menu).to_be_focused();box=menu.bounding_box();size=page.evaluate('({width:innerWidth,height:innerHeight})')
|
||||
assert box and box['x']>=0 and box['y']>=0 and box['x']+box['width']<=size['width']+.5 and box['y']+box['height']<=size['height']+.5,(box,size)
|
||||
return box
|
||||
def tree_case(page,name,touch=False):
|
||||
errors=[];page.on('pageerror',lambda e:errors.append(str(e)));ready(page,'/density-pilot');tree=page.locator('.raw-tree-rows');expect(tree).to_have_attribute('data-density','touch' if touch else 'compact')
|
||||
d=measure(page);assert d['width']==d['scroll'] and 0<d['rows']<100 and d['heights']==[44 if touch else 30],d
|
||||
if touch:
|
||||
for selector in ['button.tree-twist','.ctx-ellipsis','.raw-select-target']:
|
||||
box=page.locator(selector).first.bounding_box();assert box['width']>=44 and box['height']>=44,(selector,box)
|
||||
page.locator('.raw-select-target').first.tap();expect(page.locator('#selection-count')).to_have_text('1 selected')
|
||||
page.locator('.raw-select-target').first.tap();expect(page.locator('#selection-count')).to_have_text('0 selected')
|
||||
trigger=page.locator('.ctx-ellipsis').first;trigger.focus();page.keyboard.press('Enter');menu=page.locator('[role=menu]');expect(menu).to_be_focused();menu_inside(page)
|
||||
top=page.evaluate('scrollY');page.keyboard.press('ArrowDown');assert page.evaluate('scrollY')==top
|
||||
page.keyboard.press('Escape');expect(menu).to_have_count(0);expect(trigger).to_be_focused()
|
||||
if touch:
|
||||
trigger.tap();menu_inside(page);page.get_by_role('menuitem',name='Select all tags below',exact=False).tap();expect(page.locator('#selection-count')).to_have_text('800 selected');expect(menu).to_have_count(0)
|
||||
# Paging remains local, and only a bounded slice of the source list is mounted.
|
||||
tree.evaluate('(e)=>e.scrollTop=e.scrollHeight');more=page.get_by_role('button',name=re.compile('Show 300 more'));expect(more).to_be_visible();before=tree.evaluate('(e)=>e.scrollHeight');more.click();expect(more).to_have_count(0);page.wait_for_function('(before)=>document.querySelector(".raw-tree-rows").scrollHeight>before',arg=before);tree.evaluate('(e)=>e.scrollTop=e.scrollHeight');expect(page.get_by_role('checkbox',name='Synthetic tag 799',exact=True)).to_be_visible();assert page.locator('.raw-tree-row').count()<100
|
||||
page.screenshot(path=str(OUT/(name+'.png')),full_page='real200' not in name);results.append({'case':name,'initial':d,'final':measure(page),'errors':errors});save();assert not errors
|
||||
def run():
|
||||
with sync_playwright() as p:
|
||||
b=p.chromium.launch()
|
||||
for width,touch in [(1440,False),(390,False),(195,False),(390,True)]:
|
||||
ctx=b.new_context(viewport={'width':width,'height':900},has_touch=touch,is_mobile=touch);page=ctx.new_page();tree_case(page,f'raw-{width}-coarse-{touch}',touch);ctx.close()
|
||||
# Actual media capability change preserves the focused selected row object.
|
||||
ctx=b.new_context(viewport={'width':1440,'height':900});page=ctx.new_page();ready(page,'/density-pilot');tree=page.locator('.raw-tree-rows');tree.evaluate('(e)=>e.scrollTop=3000');check=page.get_by_role('checkbox',name='Synthetic tag 100',exact=True);check.check();expect(page.locator('#selection-count')).to_have_text('1 selected');check.focus();page.evaluate('window.fixtureFocused=document.activeElement');cdp=ctx.new_cdp_session(page)
|
||||
for coarse in [True,False]:
|
||||
cdp.send('Emulation.setTouchEmulationEnabled',{'enabled':coarse,'maxTouchPoints':1});expect(tree).to_have_attribute('data-density','touch' if coarse else 'compact');expect(check).to_be_focused();assert page.evaluate('fixtureFocused===document.activeElement');expect(check).to_be_checked();assert measure(page)['heights']==[44 if coarse else 30]
|
||||
results.append({'case':'live-density-focus','sameDomNode':True,'selected':True,'initialAndFinalDesktop30':True});save()
|
||||
# An open keyboard menu follows viewport changes rather than retaining off-screen coordinates.
|
||||
ready(page,'/density-pilot');trigger=page.locator('.ctx-ellipsis').first;trigger.focus();page.keyboard.press('Enter');menu_inside(page);page.set_viewport_size({'width':390,'height':900});page.wait_for_timeout(200);box=menu_inside(page);page.keyboard.press('Escape');expect(trigger).to_be_focused();results.append({'case':'open-menu-resize','box':box});save();ctx.close()
|
||||
for width,touch in [(195,False),(390,True)]:
|
||||
ctx=b.new_context(viewport={'width':width,'height':900},has_touch=touch,is_mobile=touch);page=ctx.new_page();ready(page,'/density-pilot?deep=true');tree=page.locator('.raw-tree-rows');expect(tree).to_have_attribute('data-density','touch' if touch else 'compact');d=measure(page);assert d['width']==d['scroll'] and d['treeScroll']>d['width'];tree.focus();tree.press('ArrowRight');page.wait_for_function('document.querySelector(".raw-tree-rows").scrollLeft>0');check=page.get_by_role('checkbox',name=re.compile('Deep synthetic tag'));check.check();expect(page.locator('#selection-count')).to_have_text('1 selected');results.append({'case':f'deep-{width}','measurements':d,'localKeyboardHorizontalScroll':True,'nativeSelect':True});save();ctx.close()
|
||||
for sample in ['script-log','diagnostics']:
|
||||
for width,touch in [(1440,False),(195,False),(390,True)]:
|
||||
ctx=b.new_context(viewport={'width':width,'height':900},has_touch=touch,is_mobile=touch);page=ctx.new_page();ready(page,'/grammar-pilot?sample='+sample);d=measure(page);assert d['width']==d['scroll'],d
|
||||
controls=page.locator('.ot-toolbar input,.ot-toolbar select,.ot-toolbar button');assert controls.count()>0
|
||||
if touch:
|
||||
for el in controls.all():assert el.bounding_box()['height']>=44
|
||||
page.screenshot(path=str(OUT/(sample+'-'+str(width)+'.png')),full_page=True);results.append({'case':sample+'-'+str(width),'measurements':d,'targets':controls.count()});save();ctx.close()
|
||||
b.close()
|
||||
with zoom_browser(p) as (ctx,worker):
|
||||
page=ctx.new_page();ready(page,'/density-pilot');assert set_browser_zoom(worker,page,2)==2;page.wait_for_timeout(300);tree_case(page,'raw-real200');d=measure(page);assert d['width']==720 and d['dpr']==2;set_browser_zoom(worker,page,1);page.set_viewport_size({'width':390,'height':900});ready(page,'/density-pilot');assert set_browser_zoom(worker,page,2)==2;page.wait_for_timeout(300);tree_case(page,'raw-narrow-real200');d=measure(page);assert d['width']==195 and d['dpr']==2;set_browser_zoom(worker,page,1)
|
||||
print('PASS',len(results),'actual density/paging/menu/deep/toolbar/real-zoom cases')
|
||||
|
||||
if __name__ == "__main__": run()
|
||||