Clear selenium tests code#515
Conversation
Codecov Report
@@ Coverage Diff @@
## master #515 +/- ##
=======================================
Coverage 95.25% 95.25%
=======================================
Files 88 88
Lines 3960 3960
Branches 248 248
=======================================
Hits 3772 3772
Misses 137 137
Partials 51 51Continue to review full report at Codecov.
|
|
There is still some improvements to do, but I think it's enough for this PR. More routines for the AdminDriverTest will come with more tests later. |
| </div> | ||
| <button type="button" class="btn btn-default" @click="close()">Cancel</button> | ||
| <button class="btn btn-primary" type="submit" :disabled="formstate.$invalid">Submit</button> | ||
| <button id="modal-cancel-btn" type="button" class="btn btn-default" @click="close()">Cancel</button> |
There was a problem hiding this comment.
do not put ids in generic components.
| self.wait_until_modal_closed() | ||
|
|
||
| def click_user_policies(self, index=0): | ||
| self.click_element_located(By.ID, "row-{}-action-0".format(index)) |
There was a problem hiding this comment.
you need to namespace the id with respect to the table as well.
| def wait_until_application_list_loaded(self): | ||
| self.wait_until_element_invisible(By.ID, "loading-spinner") | ||
|
|
||
| @contextlib.contextmanager |
There was a problem hiding this comment.
you don't need the context manager anymore. You can simply use the setup/teardown to login and logout specifically for your test cases.
|
|
||
| class TestCreateNewUser(AdminDriverTest): | ||
| def test_cancel(self): | ||
| with self.logged_in(): |
There was a problem hiding this comment.
this goes away if you use setup/teardown on the base class.
It is now clearer the difference between located element and raw elements
| self.click_first_button("Cancel") | ||
| self.wait_until_modal_closed() | ||
|
|
||
| def trigger_row_action(self, row, action_name): |
There was a problem hiding this comment.
document better what is meant with row.
| def click_new_entry_button(self): | ||
| self.click_first_button("Create New Entry") | ||
|
|
||
| def click_submit_button(self): |
| self.click_first_button("Submit") | ||
| self.wait_until_modal_closed() | ||
|
|
||
| def click_ok_button(self): |
There was a problem hiding this comment.
click_dialog_ok_button
| base_url=self.base_url)) | ||
| db.commit() | ||
|
|
||
| def wait_until_presence_of_element_located(self, how, what): |
There was a problem hiding this comment.
All of these need docs.
| def wait_until_modal_closed(self): | ||
| return self.wait.until_not(EC.alert_is_present()) | ||
|
|
||
| def login(self, username="test"): |
| def stop_application(self): | ||
| self.click_first_element_located(By.ID, "stop-button") | ||
|
|
||
| def start_application(self): |
| self.click_submit_button() | ||
|
|
||
| # Click remove button | ||
| self.trigger_row_action("mrenou", "Remove") |
There was a problem hiding this comment.
click_row_action_button
Uh oh!
There was an error while loading. Please reload this page.