forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix navigation error in Playwright tool tests.
- Loading branch information
Showing
5 changed files
with
34 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -749,6 +749,7 @@ def login( | |
username: str = "admin-user", | ||
redirect: str = "", | ||
logout_first: bool = True, | ||
explicit_logout: bool = False, | ||
): | ||
if self.is_v2: | ||
# old version had a logout URL, this one needs to check | ||
|
@@ -757,7 +758,7 @@ def login( | |
|
||
# Clear cookies. | ||
if logout_first: | ||
self.logout() | ||
self.logout(explicit=explicit_logout) | ||
# [email protected] is configured as an admin user | ||
previously_created, username_taken, invalid_username = self.create( | ||
email=email, password=password, username=username, redirect=redirect | ||
|
@@ -786,9 +787,19 @@ def _playwright_browser(self) -> PlaywrightShedBrowser: | |
def _page(self) -> Page: | ||
return self._playwright_browser._page | ||
|
||
def logout(self): | ||
def logout(self, explicit: bool = False): | ||
"""logout of the current tool shed session. | ||
By default this is a logout if logged in action, | ||
however if explicit is True - ensure there is a session | ||
and be explicit in logging out to provide extract test | ||
structure. | ||
""" | ||
if self.is_v2: | ||
self._playwright_browser.logout_if_logged_in() | ||
if explicit: | ||
self._playwright_browser.explicit_logout() | ||
else: | ||
self._playwright_browser.logout_if_logged_in() | ||
else: | ||
self.visit_url("/user/logout") | ||
self.check_page_for_string("You have been logged out") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters