Skip to content

Commit

Permalink
push helpers too
Browse files Browse the repository at this point in the history
  • Loading branch information
trinity-1686a committed Aug 28, 2019
1 parent 428b2c4 commit 1b0c2fa
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions script/browser_test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,45 @@ def tearDown(self):

def get(self, url):
return self.driver.get("https://localhost" + url)

def create_account(self, name, email, password):
self.get("/users/new")

inp = self.driver.find_element_by_id("username")
inp.send_keys(name)

inp = self.driver.find_element_by_id("email")
inp.send_keys(email)

inp = self.driver.find_element_by_id("password")
inp.send_keys(password)

inp = self.driver.find_element_by_id("password_confirmation")
inp.send_keys(password)


driver.find_element_by_xpath("//input[@type='submit']").click()

def delete_account(self):
self.get("/me")
self.get("{}/edit".format(self.driver.current_url))

self.driver.find_element_by_xpath("//input[@type='submit' and contains(@class, 'destructive')]").click()

def login(self, name, password):
self.get("/login")

inp = self.driver.find_element_by_id("eamil_or_name")
inp.send_keys(name)

inp = self.driver.find_element_by_id("password")
inp.send_keys(password)

driver.find_element_by_xpath("//input[@type='submit']").click()

def logout(self):
self.get("/logout")

def follow(self, other):
self.get("/@/"+other)
driver.find_element_by_xpath("//input[@type='submit']").click()

0 comments on commit 1b0c2fa

Please sign in to comment.