forked from IQSS/dataverse
-
Notifications
You must be signed in to change notification settings - Fork 5
/
create_account.py
62 lines (54 loc) · 3.38 KB
/
create_account.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# This is a test to create an account.
import unittest, time
from selenium import webdriver
class CreateAccountSuite(unittest.TestCase):
def setUp(self):
desired_capabilities = webdriver.DesiredCapabilities.FIREFOX
desired_capabilities['version'] = '24'
desired_capabilities['platform'] = 'Linux'
desired_capabilities['name'] = 'Create Account'
self.driver = webdriver.Remote(
desired_capabilities=desired_capabilities,
command_executor="http://esodvn:[email protected]:80/wd/hub"
)
self.driver.implicitly_wait(30)
def test_sauce(self):
driver=self.driver
driver.get('http://dvn-build.hmdc.harvard.edu/dataverseuser.xhtml')
driver.find_element_by_id("dataverseUserForm:editAccountButton_button").click()
driver.find_element_by_link_text("Create Account").click()
driver.find_element_by_id("dataverseUserForm:userName").click()
driver.find_element_by_id("dataverseUserForm:userName").clear()
driver.find_element_by_id("dataverseUserForm:userName").send_keys("user1")
driver.find_element_by_id("dataverseUserForm:inputPassword").click()
driver.find_element_by_id("dataverseUserForm:inputPassword").clear()
driver.find_element_by_id("dataverseUserForm:inputPassword").send_keys("u")
driver.find_element_by_id("dataverseUserForm:retypePassword").click()
driver.find_element_by_id("dataverseUserForm:retypePassword").clear()
driver.find_element_by_id("dataverseUserForm:retypePassword").send_keys("u")
driver.find_element_by_id("dataverseUserForm:firstName").click()
driver.find_element_by_id("dataverseUserForm:firstName").clear()
driver.find_element_by_id("dataverseUserForm:firstName").send_keys("user")
driver.find_element_by_id("dataverseUserForm:lastName").click()
driver.find_element_by_id("dataverseUserForm:lastName").clear()
driver.find_element_by_id("dataverseUserForm:lastName").send_keys("zero")
driver.find_element_by_id("dataverseUserForm:email").click()
driver.find_element_by_id("dataverseUserForm:email").clear()
driver.find_element_by_id("dataverseUserForm:email").send_keys("[email protected]")
driver.find_element_by_id("dataverseUserForm:institution").click()
driver.find_element_by_id("dataverseUserForm:institution").clear()
driver.find_element_by_id("dataverseUserForm:institution").send_keys("IQSS")
driver.find_element_by_id("dataverseUserForm:j_idt45_focus").click()
driver.find_element_by_id("dataverseUserForm:j_idt45_focus").send_keys("\\9")
driver.find_element_by_css_selector("span.ui-icon.ui-icon-triangle-1-s").click()
driver.find_element_by_xpath("//div[@class='ui-selectonemenu-items-wrapper']//li[.='Student']").click()
driver.find_element_by_id("dataverseUserForm:phone").click()
driver.find_element_by_id("dataverseUserForm:phone").click()
driver.find_element_by_id("dataverseUserForm:phone").clear()
driver.find_element_by_id("dataverseUserForm:phone").send_keys("888-888-8888")
driver.find_element_by_id("dataverseUserForm:save").click()
def tearDown(self):
print("Link to your job: https://saucelabs.com/jobs/%s" % self.driver.session_id)
self.driver.quit()
if __name__ == '__main__':
unittest.main()