| 1 | # -*- coding: iso-8859-15 -*- |
|---|
| 2 | ################################################################################## |
|---|
| 3 | # Copyright (c) 2009 enPraxis, All rights reserved. |
|---|
| 4 | # |
|---|
| 5 | # This program is free software; you can redistribute it and/or modify |
|---|
| 6 | # it under the terms of the GNU General Public License as published by |
|---|
| 7 | # the Free Software Foundation; either version 2 of the License, or |
|---|
| 8 | # (at your option) any later version. |
|---|
| 9 | # |
|---|
| 10 | # This program is distributed in the hope that it will be useful, |
|---|
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | # GNU General Public License for more details. |
|---|
| 14 | # |
|---|
| 15 | # You should have received a copy of the GNU General Public License |
|---|
| 16 | # along with this program; if not, write to the Free Software |
|---|
| 17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 18 | # |
|---|
| 19 | ################################################################################## |
|---|
| 20 | |
|---|
| 21 | __author__ = '''Zerin Bates''' |
|---|
| 22 | __version__ = '$ Revision 0.0 $'[11:-2] |
|---|
| 23 | |
|---|
| 24 | # adds new users |
|---|
| 25 | |
|---|
| 26 | from seleniumWrapper import selenium |
|---|
| 27 | import unittest, time, re |
|---|
| 28 | import unittest |
|---|
| 29 | import random |
|---|
| 30 | import time |
|---|
| 31 | class AddUsersTest(unittest.TestCase): |
|---|
| 32 | def setUp(self): |
|---|
| 33 | self.verificationErrors = [] |
|---|
| 34 | self.selenium = selenium("localhost",port, browser,url,instance) |
|---|
| 35 | self.selenium.start() |
|---|
| 36 | |
|---|
| 37 | def createUsers(self): |
|---|
| 38 | sel = self.selenium |
|---|
| 39 | sel.open("/eduCommons/logged_out") |
|---|
| 40 | sel.type("__ac_name", "admin") |
|---|
| 41 | sel.type("__ac_password", "test1234") |
|---|
| 42 | sel.click("submit") |
|---|
| 43 | sel.wait_for_page_to_load("30000") |
|---|
| 44 | sel.click("link=Site Setup") |
|---|
| 45 | sel.wait_for_page_to_load("30000") |
|---|
| 46 | sel.click("link=Users and Groups") |
|---|
| 47 | sel.wait_for_page_to_load("30000") |
|---|
| 48 | sel.click("form.button.FindAll") |
|---|
| 49 | sel.wait_for_page_to_load("30000") |
|---|
| 50 | sel.click("form.button.AddUser") |
|---|
| 51 | sel.wait_for_page_to_load("30000") |
|---|
| 52 | sel.type("fullname", "john doe") |
|---|
| 53 | sel.type("username", "admin") |
|---|
| 54 | sel.type("email", "test@test.com") |
|---|
| 55 | sel.type("password", "admin") |
|---|
| 56 | sel.type("password_confirm", "admin") |
|---|
| 57 | time.sleep(20) |
|---|
| 58 | sel.click("form.button.Register") |
|---|
| 59 | sel.wait_for_page_to_load("30000") |
|---|
| 60 | sel.open("/eduCommons") |
|---|
| 61 | sel.click("link=Site Setup") |
|---|
| 62 | sel.wait_for_page_to_load("30000") |
|---|
| 63 | sel.click("link=Users and Groups") |
|---|
| 64 | sel.wait_for_page_to_load("30000") |
|---|
| 65 | sel.click("form.button.FindAll") |
|---|
| 66 | sel.wait_for_page_to_load("30000") |
|---|
| 67 | sel.click("form.button.AddUser") |
|---|
| 68 | sel.wait_for_page_to_load("30000") |
|---|
| 69 | sel.type("fullname", "john doe") |
|---|
| 70 | sel.type("username", "producer") |
|---|
| 71 | sel.type("email", "test@test.com") |
|---|
| 72 | sel.type("password", "producer") |
|---|
| 73 | sel.type("password_confirm", "producer") |
|---|
| 74 | time.sleep(20) |
|---|
| 75 | sel.click("form.button.Register") |
|---|
| 76 | import pdb;pdb.set_trace() |
|---|
| 77 | sel.click("form.button.FindAll") |
|---|
| 78 | sel.wait_for_page_to_load("30000") |
|---|
| 79 | sel.open("/eduCommons") |
|---|
| 80 | sel.click("link=Site Setup") |
|---|
| 81 | sel.wait_for_page_to_load("30000") |
|---|
| 82 | sel.click("link=Users and Groups") |
|---|
| 83 | sel.wait_for_page_to_load("30000") |
|---|
| 84 | sel.click("form.button.FindAll") |
|---|
| 85 | sel.wait_for_page_to_load("30000") |
|---|
| 86 | sel.click("form.button.AddUser") |
|---|
| 87 | sel.wait_for_page_to_load("30000") |
|---|
| 88 | sel.type("fullname", "john doe") |
|---|
| 89 | sel.type("username", "quality") |
|---|
| 90 | sel.type("email", "test@test.com") |
|---|
| 91 | sel.type("password", "asdfasdf") |
|---|
| 92 | sel.type("password_confirm", "asdfasdf") |
|---|
| 93 | time.sleep(20) |
|---|
| 94 | sel.click("form.button.Register") |
|---|
| 95 | sel.wait_for_page_to_load("30000") |
|---|
| 96 | sel.click("form.button.FindAll") |
|---|
| 97 | sel.wait_for_page_to_load("30000") |
|---|
| 98 | sel.open("/eduCommons") |
|---|
| 99 | sel.click("link=Site Setup") |
|---|
| 100 | sel.wait_for_page_to_load("30000") |
|---|
| 101 | sel.click("link=Users and Groups") |
|---|
| 102 | sel.wait_for_page_to_load("30000") |
|---|
| 103 | sel.click("form.button.FindAll") |
|---|
| 104 | sel.wait_for_page_to_load("30000") |
|---|
| 105 | sel.click("form.button.AddUser") |
|---|
| 106 | sel.wait_for_page_to_load("30000") |
|---|
| 107 | sel.type("fullname", "john doe") |
|---|
| 108 | sel.type("username", "publisher") |
|---|
| 109 | sel.type("email", "test@test.com") |
|---|
| 110 | sel.type("password", "publisher") |
|---|
| 111 | sel.type("password_confirm", "publisher") |
|---|
| 112 | time.sleep(20) |
|---|
| 113 | sel.click("form.button.Register") |
|---|
| 114 | sel.wait_for_page_to_load("30000") |
|---|
| 115 | sel.click("form.button.FindAll") |
|---|
| 116 | sel.wait_for_page_to_load("30000") |
|---|
| 117 | sel.open("/eduCommons") |
|---|
| 118 | sel.click("link=Site Setup") |
|---|
| 119 | sel.wait_for_page_to_load("30000") |
|---|
| 120 | sel.click("link=Users and Groups") |
|---|
| 121 | sel.wait_for_page_to_load("30000") |
|---|
| 122 | sel.click("form.button.FindAll") |
|---|
| 123 | sel.wait_for_page_to_load("30000") |
|---|
| 124 | sel.click("form.button.AddUser") |
|---|
| 125 | sel.wait_for_page_to_load("30000") |
|---|
| 126 | sel.type("fullname", "john doe") |
|---|
| 127 | sel.type("username", "viewer") |
|---|
| 128 | sel.type("email", "test@test.com") |
|---|
| 129 | sel.type("password", "viewer") |
|---|
| 130 | sel.type("password_confirm", "viewer") |
|---|
| 131 | time.sleep(20) |
|---|
| 132 | sel.click("form.button.Register") |
|---|
| 133 | sel.wait_for_page_to_load("30000") |
|---|
| 134 | sel.click("form.button.FindAll") |
|---|
| 135 | sel.wait_for_page_to_load("30000") |
|---|
| 136 | |
|---|
| 137 | def tearDown(self): |
|---|
| 138 | self.selenium.stop() |
|---|
| 139 | self.assertEqual([], self.verificationErrors) |
|---|
| 140 | |
|---|
| 141 | if __name__ == "__main__": |
|---|
| 142 | unittest.main() |
|---|