Wait for spatial tab content before layout acceptance
This commit is contained in:
parent
6a84d0e5b3
commit
3ae4fad2b4
@ -12,7 +12,7 @@ let session,stage='login';
|
|||||||
const pane=p.locator('[data-context-pane="0"]'),tab=pane.locator('[data-context-tab]'),handle=pane.getByRole('separator'),layout=pane.locator('[data-spatial-layout]'),orientation=pane.locator('[data-spatial-orientation]');
|
const pane=p.locator('[data-context-pane="0"]'),tab=pane.locator('[data-context-tab]'),handle=pane.getByRole('separator'),layout=pane.locator('[data-spatial-layout]'),orientation=pane.locator('[data-spatial-orientation]');
|
||||||
const initial=await p.evaluate(()=>({...document.querySelector('[data-context-workspace]').contextController.position}));
|
const initial=await p.evaluate(()=>({...document.querySelector('[data-context-workspace]').contextController.position}));
|
||||||
for(const kind of ['locations','maps','floorplans']){
|
for(const kind of ['locations','maps','floorplans']){
|
||||||
stage=kind+' resize';await tab.selectOption(kind);await handle.waitFor();assert.equal(await handle.getAttribute('aria-valuenow'),'30');
|
stage=kind+' resize';await tab.selectOption(kind);await pane.locator(`[data-spatial-context="${kind}"]`).waitFor();await handle.waitFor();assert.equal(await handle.getAttribute('aria-valuenow'),'30');
|
||||||
if(kind==='locations'){await pane.getByRole('heading',{name:'Layout harbour',exact:true}).waitFor();const scroll=await pane.locator('[data-spatial-details]').evaluate(n=>{n.scrollTop=100;return {top:n.scrollTop,scroll:n.scrollHeight,height:n.clientHeight};});assert(scroll.top>0&&scroll.scroll>scroll.height);assert.equal(await pane.locator('[data-spatial-scenes]').evaluate(n=>n.scrollTop),0);}
|
if(kind==='locations'){await pane.getByRole('heading',{name:'Layout harbour',exact:true}).waitFor();const scroll=await pane.locator('[data-spatial-details]').evaluate(n=>{n.scrollTop=100;return {top:n.scrollTop,scroll:n.scrollHeight,height:n.clientHeight};});assert(scroll.top>0&&scroll.scroll>scroll.height);assert.equal(await pane.locator('[data-spatial-scenes]').evaluate(n=>n.scrollTop),0);}
|
||||||
await handle.focus();await handle.press('ArrowRight');assert.equal(await handle.getAttribute('aria-valuenow'),'32');
|
await handle.focus();await handle.press('ArrowRight');assert.equal(await handle.getAttribute('aria-valuenow'),'32');
|
||||||
await orientation.selectOption('vertical');assert.equal(await handle.getAttribute('aria-valuenow'),'30');await handle.focus();await handle.press('ArrowDown');assert.equal(await handle.getAttribute('aria-valuenow'),'32');
|
await orientation.selectOption('vertical');assert.equal(await handle.getAttribute('aria-valuenow'),'30');await handle.focus();await handle.press('ArrowDown');assert.equal(await handle.getAttribute('aria-valuenow'),'32');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user