Skip to content

Commit

Permalink
- Fix delete cookies check & update test_synonyms test
Browse files Browse the repository at this point in the history
  • Loading branch information
emilghittasv authored and actions-user committed Jan 13, 2025
1 parent 4b7d349 commit 1673664
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions playwright_tests/core/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from datetime import datetime
from nltk import SnowballStemmer, WordNetLemmatizer
from playwright.sync_api import Page, Locator

from playwright_tests.messages.auth_pages_messages.fxa_page_messages import FxAPageMessages
from playwright_tests.messages.homepage_messages import HomepageMessages
from requests.exceptions import HTTPError
from playwright_tests.pages.top_navbar import TopNavbar
Expand Down Expand Up @@ -307,8 +309,11 @@ def delete_cookies(self, tried_once=False, retries=3):
try:
self.page.context.clear_cookies()
self.refresh_page()
self.page.wait_for_selector(top_navbar.TOP_NAVBAR_SIGNIN_SIGNUP_LOCATORS
["signin_signup_button"], timeout=3000)
if FxAPageMessages.AUTH_PAGE_URL in self.get_page_url():
break
else:
self.page.wait_for_selector(top_navbar.TOP_NAVBAR_SIGNIN_SIGNUP_LOCATORS
["signin_signup_button"], timeout=3000)
break
except PlaywrightTimeoutError:
print("Cookies were not successfully deleted. Retrying...")
Expand Down
2 changes: 1 addition & 1 deletion playwright_tests/test_data/search_synonym.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class SearchSynonyms:
'cache': ['cash', 'cookies'],
'popup': ['pop up'],
'pop up': ['popup'],
'popups': ['pop-up', 'pop-ups', 'pop ups'],
'popups': ['pop-up', 'pop-ups', 'pop ups', 'pops up'],

# Actions
'clear': ['delete', 'remove', 'deleting'],
Expand Down

0 comments on commit 1673664

Please sign in to comment.