Add log lines change to settings page and test

I added the option to change the number of log lines to be shown per
instance to settings page and updated test_user_settings.py to verify
it works.

Partially implements blueprint: selenium-integration-testing
Closes-Bug #1424344

Change-Id: I22bf13ace46398078f5a58321e3106bf56fa2701
This commit is contained in:
dkorn 2015-02-22 11:04:07 +02:00
parent 1f2f0c0cc9
commit 2344ac739f
2 changed files with 15 additions and 4 deletions

View File

@ -22,13 +22,15 @@ class UsersettingsPage(basepage.BaseNavigationPage):
DEFAULT_LANGUAGE = "en"
DEFAULT_TIMEZONE = "UTC"
DEFAULT_PAGESIZE = "20"
DEFAULT_LOGLINES = "35"
DEFAULT_SETTINGS = {
"language": DEFAULT_LANGUAGE,
"timezone": DEFAULT_TIMEZONE,
"pagesize": DEFAULT_PAGESIZE
"pagesize": DEFAULT_PAGESIZE,
"loglines": DEFAULT_LOGLINES
}
SETTINGS_FORM_FIELDS = ("language", "timezone", "pagesize")
SETTINGS_FORM_FIELDS = ("language", "timezone", "pagesize", "loglines")
_settings_form_locator = (by.By.ID, 'user_settings_modal')
_change_password_tab_locator = (by.By.CSS_SELECTOR,
@ -64,10 +66,15 @@ class UsersettingsPage(basepage.BaseNavigationPage):
self.settings_form.pagesize.value = size
self.settings_form.submit.click()
def change_loglines(self, lines=DEFAULT_LOGLINES):
self.settings_form.loglines.value = lines
self.settings_form.submit.click()
def return_to_default_settings(self):
self.change_language()
self.change_timezone()
self.change_pagesize()
self.change_loglines()
def go_to_change_password_page(self):
self.change_password_tab.click()

View File

@ -19,10 +19,12 @@ class TestUserSettings(helpers.TestCase):
language = self.settings_page.settings_form.language.value
timezone = self.settings_page.settings_form.timezone.value
pagesize = self.settings_page.settings_form.pagesize.value
loglines = self.settings_page.settings_form.loglines.value
user_settings = (("Language", changed_settings["language"], language),
("Timezone", changed_settings["timezone"], timezone),
("Pagesize", changed_settings["pagesize"], pagesize))
("Pagesize", changed_settings["pagesize"], pagesize),
("Loglines", changed_settings["loglines"], loglines))
for (setting, expected, observed) in user_settings:
self.assertEqual(expected, observed,
@ -34,6 +36,7 @@ class TestUserSettings(helpers.TestCase):
* changes the system's language
* changes the timezone
* changes the number of items per page (page size)
* changes the number of log lines to be shown per instance
* verifies all changes were successfully executed
"""
self.settings_page = self.home_pg.go_to_settings_usersettingspage()
@ -41,9 +44,10 @@ class TestUserSettings(helpers.TestCase):
self.settings_page.change_language("es")
self.settings_page.change_timezone("Asia/Jerusalem")
self.settings_page.change_pagesize("30")
self.settings_page.change_loglines("50")
changed_settings = {"language": "es", "timezone": "Asia/Jerusalem",
"pagesize": "30"}
"pagesize": "30", "loglines": "50"}
self.verify_user_settings_change(changed_settings)
self.settings_page.return_to_default_settings()