@@ -127,89 +127,91 @@ for (const shapeName of Object.keys(shapes)) {
127127 shapesTable . add ( [ shapeName ] ) ;
128128}
129129
130- Data ( shapesTable ) . Scenario (
131- "Check transformer existing for different shapes, their amount and modes." ,
132- async ( { I, LabelStudio, AtImageView, AtOutliner, AtPanels, current } ) => {
133- const { shapeName } = current ;
134- const Shape = shapes [ shapeName ] ;
135-
136- I . amOnPage ( "/" ) ;
137- const bbox1 = {
138- x : 100 ,
139- y : 100 ,
140- width : 200 ,
141- height : 200 ,
142- } ;
143- const bbox2 = {
144- x : 400 ,
145- y : 100 ,
146- width : 200 ,
147- height : 200 ,
148- } ;
149- const getCenter = ( bbox ) => [ bbox . x + bbox . width / 2 , bbox . y + bbox . height / 2 ] ;
150- let isTransformerExist ;
151- const AtDetailsPanel = AtPanels . usePanel ( AtPanels . PANEL . DETAILS ) ;
130+ Data ( shapesTable )
131+ . Scenario (
132+ "Check transformer existing for different shapes, their amount and modes." ,
133+ async ( { I, LabelStudio, AtImageView, AtOutliner, AtPanels, current } ) => {
134+ const { shapeName } = current ;
135+ const Shape = shapes [ shapeName ] ;
136+
137+ I . amOnPage ( "/" ) ;
138+ const bbox1 = {
139+ x : 100 ,
140+ y : 100 ,
141+ width : 200 ,
142+ height : 200 ,
143+ } ;
144+ const bbox2 = {
145+ x : 400 ,
146+ y : 100 ,
147+ width : 200 ,
148+ height : 200 ,
149+ } ;
150+ const getCenter = ( bbox ) => [ bbox . x + bbox . width / 2 , bbox . y + bbox . height / 2 ] ;
151+ let isTransformerExist ;
152+ const AtDetailsPanel = AtPanels . usePanel ( AtPanels . PANEL . DETAILS ) ;
152153
153- LabelStudio . init ( getParamsWithLabels ( shapeName ) ) ;
154- AtDetailsPanel . collapsePanel ( ) ;
154+ LabelStudio . init ( getParamsWithLabels ( shapeName ) ) ;
155+ AtDetailsPanel . collapsePanel ( ) ;
155156
156- LabelStudio . waitForObjectsReady ( ) ;
157- AtOutliner . seeRegions ( 0 ) ;
158- await AtImageView . lookForStage ( ) ;
157+ LabelStudio . waitForObjectsReady ( ) ;
158+ AtOutliner . seeRegions ( 0 ) ;
159+ await AtImageView . lookForStage ( ) ;
159160
160- // Draw two regions
161- I . pressKey ( "1" ) ;
162- drawShapeByBbox ( Shape , bbox1 . x , bbox1 . y , bbox1 . width , bbox1 . height , AtImageView ) ;
163- AtOutliner . seeRegions ( 1 ) ;
164- I . pressKey ( "1" ) ;
165- drawShapeByBbox ( Shape , bbox2 . x , bbox2 . y , bbox2 . width , bbox2 . height , AtImageView ) ;
166- AtOutliner . seeRegions ( 2 ) ;
161+ // Draw two regions
162+ I . pressKey ( "1" ) ;
163+ drawShapeByBbox ( Shape , bbox1 . x , bbox1 . y , bbox1 . width , bbox1 . height , AtImageView ) ;
164+ AtOutliner . seeRegions ( 1 ) ;
165+ I . pressKey ( "1" ) ;
166+ drawShapeByBbox ( Shape , bbox2 . x , bbox2 . y , bbox2 . width , bbox2 . height , AtImageView ) ;
167+ AtOutliner . seeRegions ( 2 ) ;
167168
168- // Check that it wasn't a cause to show a transformer
169- isTransformerExist = await AtImageView . isTransformerExist ( ) ;
170- assert . strictEqual ( isTransformerExist , false ) ;
169+ // Check that it wasn't a cause to show a transformer
170+ isTransformerExist = await AtImageView . isTransformerExist ( ) ;
171+ assert . strictEqual ( isTransformerExist , false ) ;
171172
172- // Select the first region
173- AtImageView . clickAt ( ...getCenter ( bbox1 ) ) ;
174- AtOutliner . seeSelectedRegion ( ) ;
173+ // Select the first region
174+ AtImageView . clickAt ( ...getCenter ( bbox1 ) ) ;
175+ AtOutliner . seeSelectedRegion ( ) ;
175176
176- // Match if transformer exist with expectations in single selected mode
177- isTransformerExist = await AtImageView . isTransformerExist ( ) ;
178- assert . strictEqual ( isTransformerExist , Shape . hasTransformer ) ;
177+ // Match if transformer exist with expectations in single selected mode
178+ isTransformerExist = await AtImageView . isTransformerExist ( ) ;
179+ assert . strictEqual ( isTransformerExist , Shape . hasTransformer ) ;
179180
180- // Match if rotator at transformer exist with expectations in single selected mode
181- isTransformerExist = await AtImageView . isRotaterExist ( ) ;
182- assert . strictEqual ( isTransformerExist , Shape . hasRotator ) ;
181+ // Match if rotator at transformer exist with expectations in single selected mode
182+ isTransformerExist = await AtImageView . isRotaterExist ( ) ;
183+ assert . strictEqual ( isTransformerExist , Shape . hasRotator ) ;
183184
184- // Switch to move tool
185- I . pressKey ( "v" ) ;
185+ // Switch to move tool
186+ I . pressKey ( "v" ) ;
186187
187- // Match if rotator at transformer exist with expectations in single selected mode with move tool chosen
188- isTransformerExist = await AtImageView . isTransformerExist ( ) ;
189- assert . strictEqual ( isTransformerExist , Shape . hasMoveToolTransformer ) ;
188+ // Match if rotator at transformer exist with expectations in single selected mode with move tool chosen
189+ isTransformerExist = await AtImageView . isTransformerExist ( ) ;
190+ assert . strictEqual ( isTransformerExist , Shape . hasMoveToolTransformer ) ;
190191
191- // Deselect the previous selected region
192- I . pressKey ( [ "u" ] ) ;
192+ // Deselect the previous selected region
193+ I . pressKey ( [ "u" ] ) ;
193194
194- // Select 2 regions
195- AtImageView . drawThroughPoints (
196- [
197- [ bbox1 . x - 5 , bbox1 . y - 5 ] ,
198- [ bbox2 . x + bbox2 . width + 5 , bbox2 . y + bbox2 . height + 5 ] ,
199- ] ,
200- "steps" ,
201- 10 ,
202- ) ;
195+ // Select 2 regions
196+ AtImageView . drawThroughPoints (
197+ [
198+ [ bbox1 . x - 5 , bbox1 . y - 5 ] ,
199+ [ bbox2 . x + bbox2 . width + 5 , bbox2 . y + bbox2 . height + 5 ] ,
200+ ] ,
201+ "steps" ,
202+ 10 ,
203+ ) ;
203204
204- // Match if transformer exist with expectations in multiple selected mode
205- isTransformerExist = await AtImageView . isTransformerExist ( ) ;
206- assert . strictEqual ( isTransformerExist , Shape . hasMultiSelectionTransformer ) ;
205+ // Match if transformer exist with expectations in multiple selected mode
206+ isTransformerExist = await AtImageView . isTransformerExist ( ) ;
207+ assert . strictEqual ( isTransformerExist , Shape . hasMultiSelectionTransformer ) ;
207208
208- // Match if rotator exist with expectations in multiple selected mode
209- isTransformerExist = await AtImageView . isRotaterExist ( ) ;
210- assert . strictEqual ( isTransformerExist , Shape . hasMultiSelectionRotator ) ;
211- } ,
212- ) ;
209+ // Match if rotator exist with expectations in multiple selected mode
210+ isTransformerExist = await AtImageView . isRotaterExist ( ) ;
211+ assert . strictEqual ( isTransformerExist , Shape . hasMultiSelectionRotator ) ;
212+ } ,
213+ )
214+ . retry ( 3 ) ;
213215
214216Data ( shapesTable . filter ( ( { shapeName } ) => shapes [ shapeName ] . hasMoveToolTransformer ) ) . Scenario (
215217 "Resizing a single region" ,
0 commit comments