@@ -145,5 +145,52 @@ describe('Test for the Control Panel - color picker', () => {
145145
146146 } )
147147
148+ it ( 'Randomize Main Level network color' , async ( ) => {
149+
150+ console . log ( 'Randomize Main Level network color' )
151+
152+ await page . waitForTimeout ( PAGE_WAIT * 3 )
153+
154+ await page . waitForSelector ( 'div[class="MuiGrid-root MuiGrid-container MuiGrid-justify-content-xs-space-between"]' )
155+
156+
157+ const primary_level_colors = await page . $$eval ( 'rect[rx="5"]' , primary_level_colors => {
158+ return primary_level_colors . map ( primary_level_color => primary_level_color . outerHTML ) ;
159+ } ) ;
160+
161+ expect ( primary_level_colors [ 0 ] ) . toContain ( 'fill="#FF7F99"' )
162+ expect ( primary_level_colors [ 0 ] ) . toEqual ( primary_level_colors [ 1 ] )
163+ expect ( primary_level_colors [ 1 ] ) . toEqual ( primary_level_colors [ 2 ] )
164+
165+ await page . waitForTimeout ( PAGE_WAIT )
166+
167+ const rows = await page . $$ ( 'div[class = "MuiTypography-root MuiTreeItem-label MuiTypography-body1"]' )
168+ for ( var i = 0 ; i < rows . length ; i ++ ) {
169+ await rows [ 0 ] . hover ( )
170+ }
171+
172+ const buttons = await page . $$ ( 'button[class="MuiButtonBase-root MuiIconButton-root"]' )
173+
174+ for ( var i = 0 ; i < buttons . length ; i ++ ) {
175+ await buttons [ 1 ] . click ( )
176+ }
177+
178+ await page . waitForTimeout ( PAGE_WAIT )
179+
180+ const rndm_primary_level_colors = await page . $$eval ( 'rect[rx="5"]' , rndm_primary_level_colors => {
181+ return rndm_primary_level_colors . map ( rndm_primary_level_color => rndm_primary_level_color . outerHTML ) ;
182+ } ) ;
183+
184+ expect ( rndm_primary_level_colors [ 0 ] ) . toContain ( 'fill="#989898"' )
185+ // expect(rndm_primary_level_colors[1]).not.toEqual(rndm_primary_level_colors[0])
186+ // expect(rndm_primary_level_colors[2]).not.toEqual(rndm_primary_level_colors[0])
187+ // expect(rndm_primary_level_colors[2]).not.toEqual(rndm_primary_level_colors[1])
188+
189+ console . log ( 'Main Network color randomized successfully' )
190+
191+ await page . waitForTimeout ( PAGE_WAIT )
192+
193+ } )
194+
148195
149196} ) ;
0 commit comments