@@ -28,15 +28,16 @@ def open_test_project(self, tester_login):
28
28
"""Makes sure we are logged in and have a project open before
29
29
performing any of these tests."""
30
30
self .open_project ()
31
- # I get a StaleElementReferenceException without
32
- # this wait. TODO: figure out how to get around this.
33
- time .sleep (3 )
34
31
35
32
def test_verify_code (self ):
36
33
"""Ensures that we can compile code and see the success message."""
37
- compile_button = self .driver . find_element_by_id ( "compile" )
34
+ compile_button = self .get_element ( By . ID , "compile" )
38
35
compile_button .click ()
39
36
37
+ # test progress bar is visible
38
+ progress_bar = self .get_element (By .ID , 'progress' )
39
+ assert progress_bar .is_displayed ()
40
+
40
41
WebDriverWait (self .driver , VERIFY_TIMEOUT ).until (
41
42
expected_conditions .text_to_be_present_in_element (
42
43
(By .ID , "operation_output" ), "Verification Successful!" )
@@ -95,3 +96,42 @@ def test_clone_project(self):
95
96
# Cleanup: delete the project we just created.
96
97
self .delete_project ("%s copy" % TEST_PROJECT_NAME )
97
98
99
+
100
+ def test_add_projectfile_direct (self ):
101
+ """ Tests that new file can be added to project using create-new-file
102
+ field """
103
+ self .open_project ()
104
+
105
+ add_button = self .get_element (By .CLASS_NAME , 'icon-plus' )
106
+ add_button .click ()
107
+ create_field = self .get_element (By .ID , 'createfield' )
108
+ create_field .send_keys ('test_file.txt' )
109
+ create_button = self .get_element (By .CLASS_NAME , 'btn' )
110
+ create_button .click ()
111
+ self .driver .refresh ()
112
+ assert 'test_file.txt' in self .driver .page_source
113
+
114
+ '''
115
+ def test_add_projectfile_upload(self):
116
+ """ Tests that new file can be added to project using upload dialog """
117
+ add_button = self.get_element(By.CLASS_NAME, 'icon-plus')
118
+ add_button.click()
119
+ drop_zone = self.get_element(By.CLASS_NAME, 'dz-clickable')
120
+ drop_zone.click()
121
+ self.driver.get("http://localhost/js/dropzone/min.js")
122
+ self.driver.execute_script("self.get_element(By.NAME,'uploadType').value = '/test.h'")
123
+ #file_input_element = self.get_element(By.NAME, 'uploadType')'''
124
+
125
+ def test_delete_file (self ):
126
+ """Tests file delete modal """
127
+ delete_file_button = self .get_element (By .CLASS_NAME , 'icon-remove' )
128
+ delete_file_button .click ()
129
+ delete_modal = self .get_element (By .ID , 'filedeleteModal' )
130
+ assert delete_modal .is_displayed ()
131
+
132
+ def test_verify_deletion (self ):
133
+ """ Verifies that file has been deleted """
134
+ confirm_delete_button = self .get_element (By .ID , 'filedeleteButton' )
135
+ confirm_delete_button .click ()
136
+ self .driver .refresh ()
137
+ assert 'test_file.txt' not in self .driver .page_source
0 commit comments