@@ -31,7 +31,7 @@ def open_test_project(self, tester_login):
31
31
# I get a StaleElementReferenceException without
32
32
# this wait. TODO: figure out how to get around this.
33
33
time .sleep (3 )
34
-
34
+
35
35
def test_verify_code (self ):
36
36
"""Ensures that we can compile code and see the success message."""
37
37
compile_button = self .driver .find_element_by_id ("compile" )
@@ -69,10 +69,29 @@ def test_speeds_dropdown(self):
69
69
"""Tests that the speeds dropdown exists."""
70
70
self .get_element (By .ID , "baudrates" )
71
71
72
+ def test_serial_monitor_disables_fields (self ):
73
+ """Tests that opening the serial monitor disables the port and baudrate
74
+ fields."""
75
+ open_serial_monitor_button = self .get_element (By .ID , 'toggle_connect_serial' )
76
+ open_serial_monitor_button .click ()
77
+
78
+ baudrate_field = self .get_element (By .ID , 'baudrates_placeholder' )
79
+ assert baudrate_field .get_attribute ('disabled' ) == 'true'
80
+
81
+ ports_field = self .get_element (By .ID , 'ports_placeholder' )
82
+ assert ports_field .get_attribute ('disabled' ) == 'true'
83
+
84
+
72
85
def test_clone_project (self ):
73
86
"""Tests that clicking the 'Clone Project' link brings us to a new
74
87
sketch with the title 'test_project clone'."""
75
88
clone_link = self .get_element (By .LINK_TEXT , 'Clone Project' )
76
89
clone_link .click ()
77
90
project_name = self .get_element (By .ID , 'editor_heading_project_name' )
91
+ # Here, I use `startswith` in case the user has a bunch of
92
+ # projects like "test_project copy copy copy" ...
78
93
assert project_name .text .startswith ("%s copy" % TEST_PROJECT_NAME )
94
+
95
+ # Cleanup: delete the project we just created.
96
+ self .delete_project ("%s copy" % TEST_PROJECT_NAME )
97
+
0 commit comments