Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playwright - Fix delete cookies check & update test_synonyms file #6444

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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