15
15
import re
16
16
import itertools
17
17
import json
18
-
18
+ from selenium .webdriver .common .keys import Keys
19
+ from selenium .webdriver import ActionChains
19
20
20
21
class Tests (IntegrationTests ):
21
22
def setUp (self ):
@@ -486,9 +487,13 @@ def update_output(value):
486
487
self .percy_snapshot (name = 'simple-callback-1' )
487
488
488
489
input1 = self .wait_for_element_by_css_selector ('#input' )
489
- input1 .clear ()
490
+ initialValue = input1 .get_attribute ('value' )
491
+
492
+ action = ActionChains (self .driver )
493
+ action .click (input1 )
494
+ action = action .send_keys (Keys .BACKSPACE * len (initialValue ))
490
495
491
- input1 .send_keys ('hello world' )
496
+ action .send_keys ('hello world' ). perform ( )
492
497
493
498
self .wait_for_text_to_equal ('#output-1' , 'hello world' )
494
499
self .percy_snapshot (name = 'simple-callback-2' )
@@ -497,6 +502,8 @@ def update_output(value):
497
502
call_count .value ,
498
503
# an initial call to retrieve the first value
499
504
1 +
505
+ # delete the initial value
506
+ len (initialValue ) +
500
507
# one for each hello world character
501
508
len ('hello world' )
502
509
)
@@ -612,6 +619,7 @@ def update_input(value):
612
619
def test_radio_buttons_callbacks_generating_children (self ):
613
620
self .maxDiff = 100 * 1000
614
621
app = Dash (__name__ )
622
+
615
623
app .layout = html .Div ([
616
624
dcc .RadioItems (
617
625
options = [
@@ -757,7 +765,7 @@ def generic_chapter_assertions(chapter):
757
765
self .driver .execute_script (
758
766
'return document.'
759
767
'getElementById("{}-graph").' .format (chapter ) +
760
- 'layout.title'
768
+ 'layout.title.text '
761
769
) == value
762
770
)
763
771
)
@@ -1986,7 +1994,7 @@ def render_content(tab):
1986
1994
self .wait_for_text_to_equal ('#graph2_info' , json .dumps (graph_2_expected_clickdata ))
1987
1995
1988
1996
def test_hot_reload (self ):
1989
- app = dash .Dash (__name__ , assets_folder = 'tests/ test_assets' )
1997
+ app = dash .Dash (__name__ , assets_folder = 'test_assets' )
1990
1998
1991
1999
app .layout = html .Div ([
1992
2000
html .H3 ('Hot reload' )
0 commit comments