@@ -11,14 +11,22 @@ import {
1111 dragContextMenu ,
1212 focusObjectInTree ,
1313 hideObjectInTree ,
14+ hoverViewerCenter ,
1415 loadData ,
1516 navigateToApp ,
17+ showObjectInTree ,
1618 viewerContextMenu ,
1719} from "@tests/utils/viewer_interaction.js" ;
1820import {
1921 changeZScaling ,
22+ closeCameraManager ,
2023 resetCamera ,
24+ restoreCameraPosition ,
2125 rotateCamera ,
26+ saveCameraPosition ,
27+ selectCameraOrientation ,
28+ toggleCameraManager ,
29+ toggleCameraOrientation ,
2230 toggleCenterOnClick ,
2331 toggleGridScale ,
2432} from "@tests/utils/camera_interaction.js" ;
@@ -112,3 +120,102 @@ test("z scaling value 6.6", async () => {
112120 await resetCamera ( window ) ;
113121 await expect ( window ) . toHaveScreenshot ( ) ;
114122} ) ;
123+
124+ test ( "save camera position" , async ( ) => {
125+ await toggleCameraManager ( window ) ;
126+ await saveCameraPosition ( window , "angle 1" ) ;
127+ await expect ( window ) . toHaveScreenshot ( ) ;
128+ await closeCameraManager ( window ) ;
129+ } ) ;
130+
131+ test ( "camera orientation" , async ( ) => {
132+ await toggleCameraOrientation ( window ) ;
133+ await selectCameraOrientation ( window , "X+" ) ;
134+ await expect ( window ) . toHaveScreenshot ( ) ;
135+ await window . keyboard . press ( "Escape" ) ;
136+ await window . waitForTimeout ( afterActionWait ) ;
137+ } ) ;
138+
139+ test ( "z scaling value 1" , async ( ) => {
140+ await changeZScaling ( window , 1 ) ;
141+ await resetCamera ( window ) ;
142+ await expect ( window ) . toHaveScreenshot ( ) ;
143+ } ) ;
144+
145+ test ( "cells hover highlight on brep" , async ( ) => {
146+ await window . getByTestId ( "highlightOnHoverButton" ) . click ( ) ;
147+ await window . waitForTimeout ( afterActionWait ) ;
148+ await window . getByTestId ( "highlightOnHoverCellsButton" ) . click ( ) ;
149+ await window . waitForTimeout ( afterActionWait ) ;
150+ await hoverViewerCenter ( window ) ;
151+ await expect ( window ) . toHaveScreenshot ( ) ;
152+ await window . keyboard . press ( "Escape" ) ;
153+ await window . waitForTimeout ( afterActionWait ) ;
154+ } ) ;
155+
156+ test ( "points hover highlight on brep" , async ( ) => {
157+ await window . getByTestId ( "highlightOnHoverButton" ) . click ( ) ;
158+ await window . waitForTimeout ( afterActionWait ) ;
159+ await window . getByTestId ( "highlightOnHoverPointsButton" ) . click ( ) ;
160+ await window . waitForTimeout ( afterActionWait ) ;
161+ await hoverViewerCenter ( window ) ;
162+ await expect ( window ) . toHaveScreenshot ( ) ;
163+ await window . getByTestId ( "hoverHighlightChip" ) . click ( ) ;
164+ await window . waitForTimeout ( afterActionWait ) ;
165+ } ) ;
166+
167+ test ( "highlight cells on grid" , async ( ) => {
168+ await showObjectInTree ( window , "RegularGrid3D" ) ;
169+ await hideObjectInTree ( window , "BRep" ) ;
170+ await resetCamera ( window ) ;
171+ await window . getByTestId ( "highlightOnHoverButton" ) . click ( ) ;
172+ await window . waitForTimeout ( afterActionWait ) ;
173+ await window . getByTestId ( "highlightOnHoverCellsButton" ) . click ( ) ;
174+ await window . waitForTimeout ( afterActionWait ) ;
175+ await hoverViewerCenter ( window ) ;
176+ await expect ( window ) . toHaveScreenshot ( ) ;
177+ await window . getByTestId ( "highlightOnHoverButton" ) . click ( ) ;
178+ await window . waitForTimeout ( afterActionWait ) ;
179+ } ) ;
180+
181+ test ( "highlight points on grid" , async ( ) => {
182+ await window . getByTestId ( "highlightOnHoverButton" ) . click ( ) ;
183+ await window . waitForTimeout ( afterActionWait ) ;
184+ await window . getByTestId ( "highlightOnHoverPointsButton" ) . click ( ) ;
185+ await window . waitForTimeout ( afterActionWait ) ;
186+ await hoverViewerCenter ( window ) ;
187+ await expect ( window ) . toHaveScreenshot ( ) ;
188+ await window . keyboard . press ( "Escape" ) ;
189+ await window . waitForTimeout ( afterActionWait ) ;
190+ } ) ;
191+
192+ test ( "restore camera position" , async ( ) => {
193+ await toggleCameraManager ( window ) ;
194+ await restoreCameraPosition ( window , "angle 1" ) ;
195+ await expect ( window ) . toHaveScreenshot ( ) ;
196+ await closeCameraManager ( window ) ;
197+ } ) ;
198+
199+ test ( "screenshot file without background" , async ( ) => {
200+ await window . getByTestId ( "screenshotButton" ) . click ( ) ;
201+ await window . waitForTimeout ( afterActionWait ) ;
202+ await window . getByTestId ( "screenshotFileNameInput" ) . locator ( "input" ) . fill ( "screenshot 1" ) ;
203+ await window . waitForTimeout ( afterActionWait ) ;
204+ await window . getByTestId ( "screenshotIncludeBackgroundSwitch" ) . getByRole ( "checkbox" ) . uncheck ( ) ;
205+ await window . waitForTimeout ( afterActionWait ) ;
206+ await window . getByTestId ( "screenshotActionButton" ) . click ( ) ;
207+ await window . waitForTimeout ( afterActionWait ) ;
208+ await expect ( window ) . toHaveScreenshot ( ) ;
209+ } ) ;
210+
211+ test ( "screenshot clipboard with background" , async ( ) => {
212+ await window . getByTestId ( "screenshotButton" ) . click ( ) ;
213+ await window . waitForTimeout ( afterActionWait ) ;
214+ await window . getByTestId ( "screenshotClipboardButton" ) . click ( ) ;
215+ await window . waitForTimeout ( afterActionWait ) ;
216+ await window . getByTestId ( "screenshotIncludeBackgroundSwitch" ) . getByRole ( "checkbox" ) . check ( ) ;
217+ await window . waitForTimeout ( afterActionWait ) ;
218+ await window . getByTestId ( "screenshotActionButton" ) . click ( ) ;
219+ await window . waitForTimeout ( afterActionWait ) ;
220+ await expect ( window ) . toHaveScreenshot ( ) ;
221+ } ) ;
0 commit comments