@@ -10,6 +10,7 @@ import {
1010 changeColor ,
1111 changeOpacity ,
1212 expandComponentsType ,
13+ featureSizeOrWidth ,
1314 hideObjectInTree ,
1415 highlightData ,
1516 hoverModelComponentRow ,
@@ -19,9 +20,6 @@ import {
1920 polyhedraAttribute ,
2021 vertexAttribute ,
2122 viewerContextMenu ,
22- featureVisibility ,
23- featureSizeOrWidth ,
24- featureTextures ,
2523} from "@tests/utils/viewer_interaction.js" ;
2624import { test } from "@tests/fixtures.js" ;
2725
@@ -32,6 +30,7 @@ let window = undefined;
3230let cleanup = undefined ;
3331const OFFSET = 10 ;
3432const OPACITY_50 = 50 ;
33+ const POINTS_SIZE = 15 ;
3534const geodeObjectType = "BRep" ;
3635
3736test . beforeAll ( async ( { mode, browser } ) => {
@@ -67,7 +66,7 @@ test("points visibility", async () => {
6766} ) ;
6867
6968test ( "points size" , async ( ) => {
70- await featureSizeOrWidth ( window , "model" , "Points" , 15 ) ;
69+ await featureSizeOrWidth ( window , "model" , "Points" , POINTS_SIZE ) ;
7170 await expect ( window ) . toHaveScreenshot ( ) ;
7271} ) ;
7372
@@ -173,18 +172,18 @@ test("object tree hover first surface", async () => {
173172 await expect ( window ) . toHaveScreenshot ( ) ;
174173} ) ;
175174
176- async function toggleModelTreeRow ( window , rowName ) {
177- const modelComponentsObjectTree = window . getByTestId ( "modelComponentsObjectTree" ) ;
175+ async function toggleModelTreeRow ( appWindow , rowName ) {
176+ const modelComponentsObjectTree = appWindow . getByTestId ( "modelComponentsObjectTree" ) ;
178177 const row = modelComponentsObjectTree
179178 . locator ( ".tree-row-wrapper" )
180179 . filter ( { hasText : rowName } )
181180 . first ( ) ;
182181 await row . locator ( "button:has([class*='mdi-eye'])" ) . first ( ) . click ( ) ;
183- await window . waitForTimeout ( 1500 ) ;
182+ await appWindow . waitForTimeout ( afterActionWait ) ;
184183}
185184
186- async function setModelTreeRowColorRandom ( window , rowName ) {
187- const modelComponentsObjectTree = window . getByTestId ( "modelComponentsObjectTree" ) ;
185+ async function setModelTreeRowColorRandom ( appWindow , rowName ) {
186+ const modelComponentsObjectTree = appWindow . getByTestId ( "modelComponentsObjectTree" ) ;
188187 const row = modelComponentsObjectTree
189188 . locator ( ".tree-row-wrapper" )
190189 . filter ( { hasText : rowName } )
@@ -193,18 +192,19 @@ async function setModelTreeRowColorRandom(window, rowName) {
193192 const box = await label . boundingBox ( ) ;
194193 await label . dispatchEvent ( "contextmenu" , {
195194 button : 2 ,
196- clientX : box . x + 10 ,
197- clientY : box . y + 10 ,
195+ clientX : box . x + OFFSET ,
196+ clientY : box . y + OFFSET ,
198197 } ) ;
199- await window . waitForTimeout ( 1500 ) ;
198+ await appWindow . waitForTimeout ( afterActionWait ) ;
200199
201- await changeColor ( window , "modelStyleMenu" ) ;
200+ await changeColor ( appWindow , "modelStyleMenu" ) ;
202201}
203202
204203test ( "blocks visibility" , async ( ) => {
205204 await toggleModelTreeRow ( window , "Blocks" ) ;
206205 await expect ( window ) . toHaveScreenshot ( ) ;
207- await toggleModelTreeRow ( window , "Blocks" ) ; // revert
206+ // Revert
207+ await toggleModelTreeRow ( window , "Blocks" ) ;
208208} ) ;
209209
210210test ( "blocks color" , async ( ) => {
0 commit comments