Permalink
Browse files

Setup page object structure

  • Loading branch information...
Zac Zac
Zac authored and Zac committed Jan 19, 2012
1 parent f5c3246 commit af789fae97d53b20df13c1bc5e736e0510a06094
View
No changes.
View
@@ -0,0 +1,33 @@
+# File contains users data.
+#
+# Each user is a section named with its role
+# and any number of values. At least email,
+# password and name should be present.
+#
+# Example:
+# admin:
+# email: email@site.com
+# password: password
+# name: Test User
+#
+# Still, you are free to add any more data you wish. It will be kept
+# in the same dictionary.
+#
+# Example:
+# admin:
+# email: email@site.com
+# password: password
+# name: Test User
+# username: testuser
+# some_user_data: data
+#
+# The contents of this file are accessible via the pytest-mozwebqa plugin:
+#
+# Example:
+# credentials = mozwebqa.credentials['default']
+# credentials['email']
+
+default:
+ email: <value>
+ password: <value>
+ name: <value>
View
@@ -0,0 +1,3 @@
+[DEFAULT]
+api = webdriver
+baseurl = https://addons-dev.allizom.org
View
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is Mozilla WebQA Tests.
-#
-# The Initial Developer of the Original Code is Mozilla.
-#
-# Portions created by the Initial Developer are Copyright (C) 2011
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# David Burns
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-
-from selenium import selenium
-from vars import ConnectionParameters
-from page import Page
-
-
-class MySiteHomePage(Page):
-
- _some_locator = 'id=someLocator'
-
- def __init__(self, selenium):
- ''' Creates a new instance of the class and gets the page ready for testing '''
- self.sel = selenium
-
- @property
- def item_on_page(self):
- return self._some_locator
-
- @property
- def get_page_title(self):
- return self.sel.get_title()
-
- def do_something_on_the_page(self):
- pass
View
No changes.
View
@@ -1,44 +1,5 @@
#!/usr/bin/env python
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is Mozilla WebQA Tests.
-#
-# The Initial Developer of the Original Code is Mozilla.
-#
-# Portions created by the Initial Developer are Copyright (C) 2011
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Vishal
-# Dave Hunt <dhunt@mozilla.com>
-# David Burns
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
import re
import time
View
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+
+from selenium import selenium
+from vars import ConnectionParameters
+from page import Page
+
+
+class MySiteHomePage(Page):
+
+ _some_locator = 'id=someLocator'
+
+ def __init__(self, selenium):
+ ''' Creates a new instance of the class and gets the page ready for testing '''
+ self.sel = selenium
+
+ @property
+ def item_on_page(self):
+ return self._some_locator
+
+ @property
+ def get_page_title(self):
+ return self.sel.get_title()
+
+ def do_something_on_the_page(self):
+ pass
File renamed without changes.
View
@@ -1,119 +0,0 @@
-<PROJECT_NAME>
-=====================
-
-Automated tests for the <PROJECT_NAME> web application.
-
-Running Tests
--------------
-
-### Java
-You will need a version of the [Java Runtime Environment][JRE] installed
-
-[JRE]: http://www.oracle.com/technetwork/java/javase/downloads/index.html
-
-### Python
-Before you will be able to run these tests, you'll need to have Python 2.6
-installed.
-
-__note__
-
-The below instructions will install the required Python libraries into your
-global Python installation. If you work on multiple Python projects that might
-end up needing different versions of the same libraries, you might want to
-follow `sudo easy_install pip` with `sudo pip install virtualenv`, and then
-create and activate a [virtualenv](http://www.virtualenv.org) (e.g. `virtualenv
-<PROJECT_NAME>-tests-env; source <PROJECT_NAME>-tests-env/bin/activate`) to
-create a clean "virtual environment" for just this project. Then you can
-`pip install -r requiremenst/requirements.txt` in your virtual environment
-without needing to use `sudo`.
-
-If you don't mind installing globally, just run:
-
- sudo easy_install pip
-
-followed by:
-
- sudo pip install -r <LOCATION_OF_REQUIREMENTS_FILE>
-
-__note__
-
-if you are running on Debian or Ubuntu, you may need to do:
-
- sudo apt-get install python-setuptools
-
-to install the required Python libraries.
-
-### Selenium
-Once this is all set up you will need to download and start a Selenium server. You can download the latest Selenium server from [here][Selenium Downloads]. The filename will be something like 'selenium-server-standalone-x.x.jar (where x.x is current shipping version)'
-
-To start the Selenium server run the following command:
-
- java -jar ~/Downloads/selenium-server-standalone-x.x.jar (where x.x is current shipping version)
-
-Change the path/name to the downloaded Selenium server file.
-
-[Selenium Downloads]: http://code.google.com/p/selenium/downloads/list
-
-Once the above prerequisites have been met, you can run the tests using the
-following command:
-
- py.test --api=<SELENIUM_API> --baseurl=<BASE_URL> --browser=*firefox
-
-For other possible options, type `py.test --help`.
-
-Writing Tests
--------------
-
-If you want to get involved and add more tests, then there's just a few things
-we'd like to ask you to do:
-
-1. Use the [template files][GitHub Templates] for all new tests and page objects
-2. Follow our simple [style guide][Style Guide]
-3. Fork this project with your own GitHub account
-4. Make sure all tests are passing, and submit a pull request with your changes
-
-[GitHub Templates]: https://github.com/AutomatedTester/mozwebqa-test-templates
-[Style Guide]: https://wiki.mozilla.org/QA/Execution/Web_Testing/Docs/Automation/StyleGuide
-
-License
--------
-This software is licensed under the [Mozilla Tri-License][MPL]:
-
- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is Mozilla WebQA Tests.
-
- The Initial Developer of the Original Code is Mozilla.
-
- Portions created by the Initial Developer are Copyright (C) 2011
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Dave Hunt <dhunt@mozilla.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the GPL or the LGPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK *****
-
-[MPL]: http://www.mozilla.org/MPL/
View
@@ -1,62 +0,0 @@
-#!/usr/bin/env python
-
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is Mozilla WebQA Tests.
-#
-# The Initial Developer of the Original Code is Mozilla.
-#
-# Portions created by the Initial Developer are Copyright (C) 2011
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# David Burns
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-
-from selenium import selenium
-from vars import ConnectionParameters
-import unittest
-from page_object import MySiteHomePage
-
-
-class TestTemplate(unittest.TestCase):
-
- def setUp(self):
- self.selenium = selenium(ConnectionParameters.server, ConnectionParameters.port,
- ConnectionParameters.browser, ConnectionParameters.baseurl)
- self.selenium.start()
- self.selenium.set_timeout(vars.ConncetionParameters.page_load_timeout)
-
- def tearDown(self):
- self.selenium.stop()
-
- def test_that_we_do_something_to_find_a_bug(self):
- pass
-
-if __name__ == "__main__":
- unittest.main()
View
No changes.
View
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+
+from selenium import selenium
+from vars import ConnectionParameters
+import unittest
+from page_object import MySiteHomePage
+
+
+class TestTemplate(unittest.TestCase):
+
+ def setUp(self):
+ self.selenium = selenium(ConnectionParameters.server, ConnectionParameters.port,
+ ConnectionParameters.browser, ConnectionParameters.baseurl)
+ self.selenium.start()
+ self.selenium.set_timeout(vars.ConncetionParameters.page_load_timeout)
+
+ def tearDown(self):
+ self.selenium.stop()
+
+ def test_that_we_do_something_to_find_a_bug(self):
+ pass
+
+if __name__ == "__main__":
+ unittest.main()

0 comments on commit af789fa

Please sign in to comment.