Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Removed _navigate_to_first_free_app and placed explicit steps in each test case #44

Merged
merged 4 commits into from
Jun 20, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 27 additions & 16 deletions tests/desktop/test_developer_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@ def test_app_submission(self, mozwebqa):
# check that the app submission procedure finished with success
Assert.equal('Success! What happens now?', finished_form.success_message)

def _navigate_to_first_free_app(self, mozwebqa):
"""Navigate to the first free app submission."""
dev_home = Home(mozwebqa)
dev_home.go_to_developers_homepage()
dev_home.login(user="default")
my_apps = dev_home.header.click_my_apps()
return my_apps.first_free_app

def test_that_checks_editing_basic_info_for_a_free_app(self, mozwebqa):
"""Test the happy path for editing the basic information for a free submitted app.

Expand All @@ -89,10 +81,15 @@ def test_that_checks_editing_basic_info_for_a_free_app(self, mozwebqa):
categories = [('Entertainment', False), ('Games', True), ('Music', True)],
device_type = [('Desktop', True), ('Mobile', True), ('Tablet', True)]
)
app_listing = self._navigate_to_first_free_app(mozwebqa)
dev_home = Home(mozwebqa)
dev_home.go_to_developers_homepage()
dev_home.login(user="default")
my_apps = dev_home.header.click_my_apps()

# bring up the basic info form for the first free app
basic_info = my_apps.first_free_app.click_edit_basic_info()

# update the details of the app
basic_info = app_listing.click_edit_basic_info()
basic_info.type_name(updated_app['name'])
basic_info.type_url_end(updated_app['url_end'])
basic_info.type_summary(updated_app['summary'])
Expand Down Expand Up @@ -123,10 +120,14 @@ def test_that_checks_editing_support_information_for_a_free_app(self, mozwebqa):
Litmus: https://litmus.mozilla.org/show_test.cgi?id=50481
"""
updated_app = MockApplication()
app_listing = self._navigate_to_first_free_app(mozwebqa)

dev_home = Home(mozwebqa)
dev_home.go_to_developers_homepage()
dev_home.login(user="default")
my_apps = dev_home.header.click_my_apps()

# update fields in support information
support_info = app_listing.click_support_information()
support_info = my_apps.first_free_app.click_support_information()
support_info.type_support_email([updated_app['support_email']])
support_info.type_support_url([updated_app['support_website']])

Expand All @@ -143,8 +144,13 @@ def test_that_checks_that_manifest_url_cannot_be_edited_via_basic_info_for_a_fre
Litmus link: https://litmus.mozilla.org/show_test.cgi?id=50478
"""
with pytest.raises(InvalidElementStateException):
app_listing = self._navigate_to_first_free_app(mozwebqa)
basic_info = app_listing.click_edit_basic_info()
dev_home = Home(mozwebqa)
dev_home.go_to_developers_homepage()
dev_home.login(user="default")
my_apps = dev_home.header.click_my_apps()

# bring up the basic info form for the first free app
basic_info = my_apps.first_free_app.click_edit_basic_info()
"""attempting to type into the manifest_url input should raise an
InvalidElementStateException"""
basic_info.type_manifest_url('any value should cause an exception')
Expand All @@ -160,8 +166,13 @@ def test_that_checks_that_summary_must_be_limited_to_250_chars_on_basic_info_for

Litmus link: https://litmus.mozilla.org/show_test.cgi?id=50478
"""
app_listing = self._navigate_to_first_free_app(mozwebqa)
basic_info = app_listing.click_edit_basic_info()
dev_home = Home(mozwebqa)
dev_home.go_to_developers_homepage()
dev_home.login(user="default")
my_apps = dev_home.header.click_my_apps()

# bring up the basic info form for the first free app
basic_info = my_apps.first_free_app.click_edit_basic_info()
basic_info.type_summary('1234567890' * 26)
Assert.false(basic_info.is_summary_char_count_ok,
'The character count for summary should display as an error but it does not')
Expand Down