Skip to content

Commit

Permalink
try using CSS selector
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-chung committed Aug 15, 2024
1 parent 5288f21 commit 8e58d85
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions give_kudos.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,21 @@ def email_login(self):
self.page.get_by_role("button", name="Reject").click(timeout=5000)
except:
pass
self.page.get_by_placeholder("Your Email").fill(self.EMAIL)
self.page.get_by_placeholder("Password").fill(self.PASSWORD)

try:
self.page.get_by_placeholder("Your Email").fill(self.EMAIL, timeout=5000)
print("Using placeholder")
except:
self.page.locator("input#email").fill(self.EMAIL, timeout=5000)
print("Using CSS selector (using ID)")

try:
self.page.get_by_placeholder("Password").fill(self.PASSWORD, timeout=5000)
print("Using placeholder")
except:
self.page.locator("input#password").fill(self.PASSWORD, timeout=5000)
print("Using CSS selector (using ID)")

self.page.get_by_role("button", name='Log In').click()
print("---Logged in!!---")
self._run_with_retries(func=self._get_page_and_own_profile)
Expand Down

0 comments on commit 8e58d85

Please sign in to comment.