Skip to content

Commit

Permalink
Fix screenshots]
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Jul 2, 2024
1 parent 811a83f commit 4e17969
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions helpers/playwrightHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,10 @@ def launch_mobile_browser(self, device_name, headless_mode):
def capture_screenshot(self, filename):
screenshot_path = os.path.join(self.screenshots_dir, f'before_action_{filename}.png')
try:
self.page.screenshot(path=screenshot_path, timeout=3000)
self.page.screenshot(path=screenshot_path)
except Exception as error:
if "Timeout" in str(error):
print('Screenshot taking timed out, ignoring...')
self.page.screenshot(path=screenshot_path)
return None
else:
raise error
Expand Down
4 changes: 4 additions & 0 deletions pages/login_page.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
from init_helpers import *

LOGIN_BUTTON_ELEMENT = ("//button[text()='Log In']")
ACCEPT_COOKIES_ELEMENT = ("#nhsuk-cookie-banner__link_accept_analytics")

def navigate_to_ravs_login_page(url):
navigate_to_url(url)
wait_for_element_to_appear(ACCEPT_COOKIES_ELEMENT)
if check_element_exists(ACCEPT_COOKIES_ELEMENT):
find_element_and_perform_action(ACCEPT_COOKIES_ELEMENT, "click")
wait_for_page_to_load()

def check_login_button_exists():
Expand Down

0 comments on commit 4e17969

Please sign in to comment.