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

Commit

Permalink
Setup page object structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac authored and Zac committed Jan 19, 2012
1 parent f5c3246 commit af789fa
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 283 deletions.
Empty file added LICENSE
Empty file.
33 changes: 33 additions & 0 deletions credentials.yaml
Original file line number Diff line number Diff line change
@@ -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>
3 changes: 3 additions & 0 deletions mozwebqa.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[DEFAULT]
api = webdriver
baseurl = https://addons-dev.allizom.org
63 changes: 0 additions & 63 deletions page_object.py

This file was deleted.

Empty file added pages/__init__.py
Empty file.
39 changes: 0 additions & 39 deletions page.py → pages/page.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
25 changes: 25 additions & 0 deletions pages/page_object.py
Original file line number Diff line number Diff line change
@@ -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.
119 changes: 0 additions & 119 deletions templateREADME.md

This file was deleted.

62 changes: 0 additions & 62 deletions test_file.py

This file was deleted.

Empty file added tests/__init__.py
Empty file.
24 changes: 24 additions & 0 deletions tests/test_file.py
Original file line number Diff line number Diff line change
@@ -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.