@@ -232,21 +232,21 @@ def test_widget_answer(self, selenium_driver):
232
232
233
233
assert len (text_inputs ) == 1
234
234
text_input = text_inputs [0 ]
235
- text_input .send_keys ("test-answers " )
235
+ text_input .send_keys ("test-E " )
236
236
# wait till typing finished
237
237
WebDriverWait (driver , 5 ).until (
238
238
expected_conditions .text_to_be_present_in_element_attribute (
239
239
(By .CLASS_NAME , TEXT_INPUT_CLASS_NAME ),
240
240
"value" ,
241
- "test-answers " ,
241
+ "test-E " ,
242
242
)
243
243
)
244
244
# wait till everything is sync with python kernel
245
245
time .sleep (0.1 )
246
246
create_file_button .click ()
247
247
248
248
output = nb_cell .find_element (By .CLASS_NAME , OUTPUT_CLASS_NAME )
249
- assert output .text == "File 'pytest-test-answers .json' created and loaded."
249
+ assert output .text == "File 'pytest-test-E .json' created and loaded."
250
250
251
251
answer_registry_buttons = nb_cell .find_elements (
252
252
By .CLASS_NAME , BUTTON_CLASS_NAME
@@ -286,7 +286,7 @@ def test_widget_answer(self, selenium_driver):
286
286
)
287
287
output = nb_cell .find_element (By .CLASS_NAME , OUTPUT_CLASS_NAME )
288
288
assert (
289
- output .text == "All answers were saved in file 'pytest-test-answers .json'."
289
+ output .text == "All answers were saved in file 'pytest-test-E .json'."
290
290
)
291
291
# cancel
292
292
# wait till everything is sync with python kernel
@@ -321,7 +321,7 @@ def test_widget_answer(self, selenium_driver):
321
321
expected_conditions .invisibility_of_element_located (output )
322
322
)
323
323
output = nb_cell .find_element (By .CLASS_NAME , OUTPUT_CLASS_NAME )
324
- assert output .text == "All answers loaded from file 'pytest-test-answers .json'."
324
+ assert output .text == "All answers loaded from file 'pytest-test-E .json'."
325
325
326
326
# TODO test interaction of ExerciseWidgets with ExerciseRegistry
327
327
@@ -346,7 +346,7 @@ def test_widget_answer(self, selenium_driver):
346
346
load_button = answer_buttons [1 ]
347
347
348
348
# tests save button
349
- input_answer = "answer text "
349
+ input_answer = "T "
350
350
text_input .send_keys (input_answer )
351
351
# wait till everything is sync with python kernel
352
352
time .sleep (0.1 )
@@ -378,11 +378,12 @@ def test_widget_answer(self, selenium_driver):
378
378
assert text_input .get_attribute ("value" ) == input_answer
379
379
output = nb_cell .find_element (By .CLASS_NAME , OUTPUT_CLASS_NAME )
380
380
assert (
381
- output .text == "Exercise has been saved in file 'pytest-test-answers .json'."
381
+ output .text == "Exercise has been saved in file 'pytest-test-E .json'."
382
382
)
383
383
384
384
# tests load button
385
- text_input .send_keys (" update" )
385
+ update_keys = " up"
386
+ text_input .send_keys (update_keys )
386
387
# wait till everything is sync with python kernel
387
388
time .sleep (0.1 )
388
389
# wait for cued box
@@ -394,7 +395,7 @@ def test_widget_answer(self, selenium_driver):
394
395
By .CLASS_NAME , reset_cue_button_class_name ("save" , True )
395
396
)
396
397
assert len (reset_cue_buttons ) == 2
397
- assert text_input .get_attribute ("value" ) == input_answer + " update"
398
+ assert text_input .get_attribute ("value" ) == input_answer + update_keys
398
399
#
399
400
WebDriverWait (driver , 1 ).until (
400
401
expected_conditions .element_to_be_clickable (load_button )
@@ -419,7 +420,7 @@ def test_widget_answer(self, selenium_driver):
419
420
output = nb_cell .find_element (By .CLASS_NAME , OUTPUT_CLASS_NAME )
420
421
assert (
421
422
output .text
422
- == "Exercise has been loaded from file 'pytest-test-answers .json'."
423
+ == "Exercise has been loaded from file 'pytest-test-E .json'."
423
424
)
424
425
assert text_input .get_attribute ("value" ) == input_answer
425
426
@@ -444,7 +445,7 @@ def test_widget_answer(self, selenium_driver):
444
445
445
446
output = nb_cell .find_element (By .CLASS_NAME , OUTPUT_CLASS_NAME )
446
447
assert (
447
- output .text == "Exercise has been saved in file 'pytest-test-answers .json'."
448
+ output .text == "Exercise has been saved in file 'pytest-test-E .json'."
448
449
)
449
450
# not cued
450
451
cue_box = nb_cell .find_element (By .CLASS_NAME , cue_box_class_name ("save" , False ))
@@ -479,7 +480,7 @@ def test_widget_answer(self, selenium_driver):
479
480
output = nb_cell .find_element (By .CLASS_NAME , OUTPUT_CLASS_NAME )
480
481
assert (
481
482
output .text
482
- == "Exercise has been loaded from file 'pytest-test-answers .json'."
483
+ == "Exercise has been loaded from file 'pytest-test-E .json'."
483
484
)
484
485
# not cued
485
486
cue_box = nb_cell .find_element (By .CLASS_NAME , cue_box_class_name ("save" , False ))
@@ -671,9 +672,9 @@ def test_cue_box_cued(nb_cell, cue_box_name, cued_on_init):
671
672
# some input that changes the widget
672
673
673
674
# Check if cue is added once text input is changed
674
- text_input .send_keys ("a " )
675
+ text_input .send_keys ("E " )
675
676
time .sleep (0.1 )
676
- assert text_input .get_attribute ("value" ) == "Texta "
677
+ assert text_input .get_attribute ("value" ) == "TextE "
677
678
assert cue_box_class_name (cue_box_name , True ).replace (
678
679
"." , " "
679
680
) == cue_box_widget .get_attribute ("class" )
@@ -725,9 +726,9 @@ def test_reset_cue_button(
725
726
) == RESET_CUE_BUTTON_CLASS_NAME .replace ("." , " " )
726
727
727
728
# Check if unused text input does not effect cueing of button
728
- unused_text_input .send_keys ("a " )
729
+ unused_text_input .send_keys ("E " )
729
730
time .sleep (0.1 )
730
- assert unused_text_input .get_attribute ("value" ) == "Unuseda "
731
+ assert unused_text_input .get_attribute ("value" ) == "UnusedE "
731
732
assert (
732
733
sum (
733
734
[
@@ -758,8 +759,8 @@ def test_reset_cue_button(
758
759
assert reset_cue_button .is_enabled ()
759
760
760
761
# Checks if two more widgets are cued on change
761
- text_input .send_keys ("a " )
762
- assert text_input .get_attribute ("value" ) == "Texta "
762
+ text_input .send_keys ("E " )
763
+ assert text_input .get_attribute ("value" ) == "TextE "
763
764
764
765
WebDriverWait (driver , 1 ).until (
765
766
expected_conditions .element_to_be_clickable (reset_cue_button )
@@ -1121,7 +1122,7 @@ def test_code_exercise(
1121
1122
# Issue #22
1122
1123
# sending keys to code widget does not work at the moment
1123
1124
# once this works please add this code
1124
- # code_input.send_keys("a=5 \n")
1125
+ # code_input.send_keys("v=9 \n")
1125
1126
# time.sleep(0.1)
1126
1127
# assert (scwidget_cue_box_class_name("check", True) in
1127
1128
# check_code_input.get_attribute("class"))
@@ -1138,7 +1139,7 @@ def test_code_exercise(
1138
1139
slider_input_box = nb_cell .find_element (By .CLASS_NAME , "widget-readout" )
1139
1140
slider_input_box .send_keys (Keys .BACKSPACE )
1140
1141
slider_input_box .send_keys (Keys .BACKSPACE )
1141
- slider_input_box .send_keys (2 )
1142
+ slider_input_box .send_keys (9 )
1142
1143
slider_input_box .send_keys (Keys .ENTER )
1143
1144
time .sleep (0.2 )
1144
1145
0 commit comments