@@ -357,13 +357,13 @@ def demo(n_clicks):
357357 dash_duo .start_server (app )
358358
359359 dash_duo .wait_for_element ("#add-option" ).click ()
360- for i in range (1 , n + 2 ):
360+ for i in range (n + 1 ):
361361 dash_duo .wait_for_text_to_equal (
362- f" #options label:nth-child( { i } ) span.label-result" , ""
362+ f' #options [data-option-index=" { i } "] span.label-result' , ""
363363 )
364- dash_duo .wait_for_element (f" #options label:nth-child( { i } ) button" ).click ()
364+ dash_duo .wait_for_element (f' #options [data-option-index=" { i } "] button' ).click ()
365365 dash_duo .wait_for_text_to_equal (
366- f" #options label:nth-child( { i } ) span.label-result" , "1"
366+ f' #options [data-option-index=" { i } "] span.label-result' , "1"
367367 )
368368
369369
@@ -393,13 +393,17 @@ def opts(n):
393393
394394 dash_duo .wait_for_text_to_equal ("#counter" , "0" )
395395 dash_duo .find_element ("#a" ).click ()
396- assert len (dash_duo .find_elements ("#b label input" )) == 2
396+ assert (
397+ len (dash_duo .find_elements ('#b label:not([data-option-index="-1"]) input' )) == 2
398+ )
397399 dash_duo .wait_for_text_to_equal ("#counter" , "0" )
398400 dash_duo .find_element ("#a" ).click ()
399- assert len (dash_duo .find_elements ("#b label input" )) == 3
401+ assert (
402+ len (dash_duo .find_elements ('#b label:not([data-option-index="-1"]) input' )) == 3
403+ )
400404 dash_duo .wait_for_text_to_equal ("#counter" , "0" )
401405
402- dash_duo .find_elements (" #b label input" )[0 ].click ()
406+ dash_duo .find_elements (' #b label:not([data-option-index="-1"]) input' )[0 ].click ()
403407 dash_duo .wait_for_text_to_equal ("#counter" , "1" )
404408
405409
0 commit comments