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

Commit

Permalink
Modify to folder structure, add mozwebqa.cfg file
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac authored and Zac committed Apr 30, 2012
1 parent f490e78 commit 75b3f5c
Show file tree
Hide file tree
Showing 31 changed files with 36 additions and 33 deletions.
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
def pytest_funcarg__mozwebqa_logged_in(request):
mozwebqa = request.getfuncargvalue('mozwebqa')

from login_page import MozTrapLoginPage
from pages.login_page import MozTrapLoginPage
login_pg = MozTrapLoginPage(mozwebqa)
login_pg.go_to_login_page()
login_pg.login()
Expand Down
3 changes: 3 additions & 0 deletions mozwebqa.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[DEFAULT]
baseurl = http://caseconductor-dev.allizom.org
tags = moztrap-tests
Empty file added pages/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 14 additions & 14 deletions page.py → pages/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,17 @@ def wait_for_ajax(self, timeout=None):
def record_error(self):
''' Records an error. '''

http_matches = http_regex.match(self.base_url)
file_name = http_matches.group(1)

print '-------------------'
print 'Error at ' + self.selenium.get_location()
print 'Page title ' + self.selenium.get_title()
print '-------------------'
filename = file_name + '_' + str(time.time()).split('.')[0] + '.png'

print 'Screenshot of error in file ' + filename
f = open(filename, 'wb')
f.write(base64.decodestring(
self.selenium.capture_entire_page_screenshot_to_string('')))
f.close()
#http_matches = http_regex.match(self.base_url)
#file_name = http_matches.group(1)
#
#print '-------------------'
#print 'Error at ' + self.selenium.get_location()
#print 'Page title ' + self.selenium.get_title()
#print '-------------------'
#filename = file_name + '_' + str(time.time()).split('.')[0] + '.png'
#
#print 'Screenshot of error in file ' + filename
#f = open(filename, 'wb')
#f.write(base64.decodestring(
# self.selenium.capture_entire_page_screenshot_to_string('')))
#f.close()
File renamed without changes.
File renamed without changes.
Empty file added tests/__init__.py
Empty file.
6 changes: 3 additions & 3 deletions test_homepage.py → tests/test_homepage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from home_page import MozTrapHomePage
from base_test import BaseTest
from pages.home_page import MozTrapHomePage
from pages.base_test import BaseTest
from unittestzero import Assert


class TestHomepage(BaseTest):

def test_that_user_can_login_and_logout(self, mozwebqa):
from login_page import MozTrapLoginPage
from pages.login_page import MozTrapLoginPage
login_pg = MozTrapLoginPage(mozwebqa)
home_pg = MozTrapHomePage(mozwebqa)

Expand Down
4 changes: 2 additions & 2 deletions test_manage_cases_page.py → tests/test_manage_cases_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from manage_cases_page import MozTrapManageCasesPage
from base_test import BaseTest
from pages.manage_cases_page import MozTrapManageCasesPage
from pages.base_test import BaseTest
from unittestzero import Assert


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from manage_products_page import MozTrapManageProductsPage
from base_test import BaseTest
from pages.manage_products_page import MozTrapManageProductsPage
from pages.base_test import BaseTest
from unittestzero import Assert


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from manage_profiles_page import MozTrapManageProfilesPage
from base_test import BaseTest
from pages.manage_profiles_page import MozTrapManageProfilesPage
from pages.base_test import BaseTest
from unittestzero import Assert


class TestManageProfilesPage(BaseTest):

def test_that_user_can_create_and_delete_profile(self, mozwebqa_logged_in):
from create_profile_page import MozTrapCreateProfilePage
from pages.create_profile_page import MozTrapCreateProfilePage
manage_profiles_pg = MozTrapManageProfilesPage(mozwebqa_logged_in)
create_profile_pg = MozTrapCreateProfilePage(mozwebqa_logged_in)

Expand Down
4 changes: 2 additions & 2 deletions test_manage_runs_page.py → tests/test_manage_runs_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from manage_runs_page import MozTrapManageRunsPage
from base_test import BaseTest
from pages.manage_runs_page import MozTrapManageRunsPage
from pages.base_test import BaseTest
from unittestzero import Assert


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from manage_suites_page import MozTrapManageSuitesPage
from base_test import BaseTest
from pages.manage_suites_page import MozTrapManageSuitesPage
from pages.base_test import BaseTest
from unittestzero import Assert


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from manage_versions_page import MozTrapManageVersionsPage
from base_test import BaseTest
from pages.manage_versions_page import MozTrapManageVersionsPage
from pages.base_test import BaseTest
from unittestzero import Assert


Expand Down
4 changes: 2 additions & 2 deletions test_run_tests_page.py → tests/test_run_tests_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from run_tests_page import MozTrapRunTestsPage
from base_test import BaseTest
from pages.run_tests_page import MozTrapRunTestsPage
from pages.base_test import BaseTest
from unittestzero import Assert


Expand Down

0 comments on commit 75b3f5c

Please sign in to comment.