Permalink
Browse files

[dev]Fix for failing profile tests

- TestProfile.test_profile_creation
- TestProfile.test_edit_profile_information

The last name field has been removed and we only have a full name field.
Updated locators and methods accordingly.
  • Loading branch information...
teodosia committed Dec 10, 2012
1 parent 20e701c commit 2b2ec04be34964f614d886fe97b78ed2a907a7a6
Showing with 14 additions and 28 deletions.
  1. +4 −10 pages/edit_profile.py
  2. +5 −9 pages/register.py
  3. +5 −9 tests/test_profile.py
View
@@ -46,20 +46,14 @@ def go_to_tab(self, tab_name):
class ProfileTab(EditProfile):
- _first_name_field_locator = (By.ID, 'id_first_name')
- _last_name_field_locator = (By.ID, 'id_last_name')
+ _full_name_field_locator = (By.ID, 'id_full_name')
_website_field_locator = (By.ID, 'id_website')
_bio_field_locator = (By.ID, 'id_bio')
- def set_first_name(self, first_name):
- element = self.selenium.find_element(*self._first_name_field_locator)
+ def set_full_name(self, full_name):
+ element = self.selenium.find_element(*self._full_name_field_locator)
element.clear()
- element.send_keys(first_name)
-
- def set_last_name(self, last_name):
- element = self.selenium.find_element(*self._last_name_field_locator)
- element.clear()
- element.send_keys(last_name)
+ element.send_keys(full_name)
def set_website(self, website):
element = self.selenium.find_element(*self._website_field_locator)
View
@@ -35,22 +35,18 @@ def go_to_tab(self, tab_name):
self.selenium.find_element(*self._location_tab_locator).click()
return LocationTab(self.testsetup)
+
class ProfileTab(Register):
- _first_name_field_locator = (By.ID, 'id_first_name')
- _last_name_field_locator = (By.ID, 'id_last_name')
+ _full_name_field_locator = (By.ID, 'id_full_name')
_website_field_locator = (By.ID, 'id_website')
_bio_field_locator = (By.ID, 'id_bio')
_next_button_locator = (By.ID, 'page2button')
- def set_first_name(self, first_name):
- element = self.selenium.find_element(*self._first_name_field_locator)
- element.send_keys(first_name)
-
- def set_last_name(self, last_name):
- element = self.selenium.find_element(*self._last_name_field_locator)
- element.send_keys(last_name)
+ def set_full_name(self, full_name):
+ element = self.selenium.find_element(*self._full_name_field_locator)
+ element.send_keys(full_name)
def set_website(self, website):
element = self.selenium.find_element(*self._website_field_locator)
View
@@ -38,19 +38,17 @@ def test_edit_profile_information(self, mozwebqa):
profile_tab = edit_profile_page.go_to_tab("profile")
Assert.true(edit_profile_page.is_csrf_token_present)
current_time = str(time.time()).split('.')[0]
- new_first_name = "Updated %s" % current_time
- new_last_name = "Mozillians User %s" % current_time
+ new_full_name = "Updated Mozillians User %s" % current_time
new_biography = "Hello, I'm new here and trying stuff out. Oh, and by the way: I'm a robot, run in a cronjob, most likely, run at %s" % current_time
new_website = "http://%s.com/" % current_time
- profile_tab.set_first_name(new_first_name)
- profile_tab.set_last_name(new_last_name)
+ profile_tab.set_full_name(new_full_name)
profile_tab.set_website(new_website)
profile_tab.set_bio(new_biography)
profile_tab.click_update_button()
name = profile_page.name
biography = profile_page.biography
website = profile_page.website
- Assert.equal(name, new_first_name + " " + new_last_name)
+ Assert.equal(name, new_full_name)
Assert.equal(biography, new_biography)
Assert.equal(website, new_website)
@@ -71,8 +69,7 @@ def test_creating_profile_without_checking_privacy_policy_checkbox(self, mozwebq
profile = home_page.create_new_user(user)
- profile.set_first_name("User that doesn't like policy")
- profile.set_last_name("MozilliansUser")
+ profile.set_full_name("User that doesn't like policy")
profile.set_bio("Hello, I'm new here and trying stuff out. Oh, and by the way: I'm a robot, run in a cronjob, and will not check accept the privacy policy")
skills = profile.click_next_button()
@@ -99,8 +96,7 @@ def test_profile_creation(self, mozwebqa):
profile = home_page.create_new_user(user)
- profile.set_first_name("New")
- profile.set_last_name("MozilliansUser")
+ profile.set_full_name("New MozilliansUser")
profile.set_bio("Hello, I'm new here and trying stuff out. Oh, and by the way: I'm a robot, run in a cronjob, most likely")
skills = profile.click_next_button()

0 comments on commit 2b2ec04

Please sign in to comment.