@@ -226,5 +226,87 @@ describe('Test for the Control Panel - color picker', () => {
226226
227227 } )
228228
229+
230+ it ( 'Pick a color for the sublevel I netowrk' , async ( ) => {
231+
232+ console . log ( 'Selecting a color for the I network' )
233+
234+ const rows = await page . $$ ( 'div[class = "MuiTypography-root MuiTreeItem-label MuiTypography-body1"]' )
235+ for ( var i = 0 ; i < rows . length ; i ++ ) {
236+ await rows [ 1 ] . click ( )
237+ }
238+
239+ await page . waitForTimeout ( PAGE_WAIT )
240+
241+ const rows_ = await page . $$ ( 'div[class = "MuiTypography-root MuiTreeItem-label MuiTypography-body1"]' )
242+
243+ for ( var i = 0 ; i < rows_ . length ; i ++ ) {
244+ await rows_ [ 2 ] . click ( )
245+ }
246+
247+ const network_colors = await page . $$eval ( 'rect[rx="5"]' , network_colors => {
248+ return network_colors . map ( network_color => network_color . outerHTML ) ;
249+ } ) ;
250+
251+ // expect(network_colors[2]).toContain('fill="#989898"')
252+ // expect(network_colors[3]).toEqual(network_colors[4])
253+
254+ await page . waitForTimeout ( PAGE_WAIT * 3 )
255+
256+ const buttons = await page . $$ ( 'button[class="MuiButtonBase-root MuiIconButton-root"]' )
257+
258+ for ( var i = 0 ; i < buttons . length ; i ++ ) {
259+ await buttons [ 4 ] . click ( )
260+ }
261+
262+ await page . waitForTimeout ( PAGE_WAIT )
263+
264+ const list_bounds = await page . $ ( 'ul[role="tree"]' ) ;
265+ const rect = await page . evaluate ( ( list_bounds ) => {
266+ const { top, left, bottom, right } = list_bounds . getBoundingClientRect ( ) ;
267+ return { top, left, bottom, right } ;
268+ } , list_bounds ) ;
269+
270+ await page . waitForTimeout ( PAGE_WAIT )
271+
272+ await page . mouse . click ( Math . round ( rect . right ) - 40 , Math . round ( rect . bottom ) + 40 )
273+
274+ await page . waitForTimeout ( PAGE_WAIT * 2 )
275+
276+ const rows_after_colouring_I = await page . $$ ( 'div[class = "MuiTypography-root MuiTreeItem-label MuiTypography-body1"]' )
277+ for ( var i = 0 ; i < rows_after_colouring_I . length ; i ++ ) {
278+ await rows_after_colouring_I [ 2 ] . click ( )
279+ }
280+
281+ const network_colors_after_colouring_I = await page . $$eval ( 'rect[rx="5"]' , network_colors_after_colouring_I => {
282+ return network_colors_after_colouring_I . map ( network_color_after_colouring_I => network_color_after_colouring_I . outerHTML ) ;
283+ } ) ;
284+ await page . waitForTimeout ( PAGE_WAIT )
285+
286+ expect ( network_colors_after_colouring_I [ 2 ] ) . toContain ( 'fill="#420b0b"' )
287+ expect ( network_colors_after_colouring_I [ 2 ] ) . toEqual ( network_colors_after_colouring_I [ 3 ] )
288+ expect ( network_colors_after_colouring_I [ 2 ] ) . toEqual ( network_colors_after_colouring_I [ 4 ] )
289+
290+ console . log ( 'I network color selected successfully' )
291+
292+ } )
293+
294+ it ( 'Filter results from the Control panel' , async ( ) => {
295+
296+ console . log ( 'Filtering results' )
297+
298+
299+
300+
301+ // await page.waitForSelector('ul[role="tree"]')
302+ // const network_items = (await page.$$('li[role="treeitem"]')).length;
303+ // await expect(network_items).toEqual(3)
304+
305+ console . log ( 'Results filtered successfully' )
306+
307+
308+ } )
309+
310+
229311
230312} ) ;
0 commit comments