Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean up, and add some keyboard shortcut tests
- Loading branch information
1 parent
4f0f22f
commit d4e2aa7
Showing
10 changed files
with
71 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/usr/bin/python | ||
|
||
from base import WebTest, USER, PASS, SITE_URL | ||
from runner import test_runner | ||
from selenium.webdriver.common.keys import Keys | ||
from settings import SettingsHelpers | ||
from selenium.common.exceptions import ElementNotVisibleException | ||
|
||
|
||
class KeyboardShortcutTests(SettingsHelpers): | ||
|
||
def __init__(self): | ||
WebTest.__init__(self) | ||
self.login(USER, PASS) | ||
self.wait_with_folder_list() | ||
self.checkbox_test('general_setting', 'enable_keyboard_shortcuts', False, 'keyboard_shortcuts') | ||
|
||
def nav_to_page(self, key_combo, titlestr, title_class): | ||
el = self.by_tag('body') | ||
el.send_keys(key_combo) | ||
self.wait_with_folder_list() | ||
assert self.by_class(title_class).text.startswith(titlestr) | ||
|
||
def nav_to_unread(self): | ||
self.nav_to_page(Keys.META + 'u', 'Unread', 'mailbox_list_title') | ||
|
||
def nav_to_everything(self): | ||
self.nav_to_page(Keys.META + 'e', 'Everything', 'mailbox_list_title') | ||
|
||
def nav_to_flagged(self): | ||
self.nav_to_page(Keys.META + 'f', 'Flagged', 'mailbox_list_title') | ||
|
||
def nav_to_history(self): | ||
self.nav_to_page(Keys.META + 'h', 'Message history', 'content_title') | ||
|
||
def nav_to_contacts(self): | ||
self.nav_to_page(Keys.META + 'c', 'Contacts', 'content_title') | ||
|
||
def nav_to_compose(self): | ||
self.nav_to_page(Keys.META + 's', 'Compose', 'content_title') | ||
|
||
def toggle_folders(self): | ||
el = self.by_tag('body') | ||
el.send_keys(Keys.META + 't') | ||
try: | ||
self.by_class('folder_list').click() | ||
assert False == True | ||
except ElementNotVisibleException: | ||
pass | ||
el.send_keys(Keys.META + 't') | ||
|
||
|
||
if __name__ == '__main__': | ||
|
||
print("KEYBOARD SHORTCUT TESTS") | ||
test_runner(KeyboardShortcutTests, [ | ||
|
||
'nav_to_history', | ||
'nav_to_contacts', | ||
'nav_to_everything', | ||
'nav_to_flagged', | ||
'nav_to_unread', | ||
'nav_to_compose', | ||
'toggle_folders', | ||
'logout' | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters