Skip to content

Commit

Permalink
proof of concept that Self works in 3.8+
Browse files Browse the repository at this point in the history
  • Loading branch information
bandophahita committed Feb 7, 2024
1 parent 5296570 commit 15a2cb3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions screenpy_selenium/actions/open.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ def browser_on(cls, location: str | object) -> Self:
"""Alias for :meth:`~screenpy_selenium.actions.Open.their_browser_on`."""
return cls.their_browser_on(location=location)

def describe(self: Self) -> str:
def describe(self) -> str:
"""Describe the Action in present tense."""
return f"Visit {self.url}."

@beat("{} visits {url}")
def perform_as(self: Self, the_actor: Actor) -> None:
def perform_as(self, the_actor: Actor) -> None:
"""Direct the Actor to visit the specified URL."""
browser = the_actor.ability_to(BrowseTheWeb).browser
browser.get(self.url)

def __init__(self: Self, location: str | object) -> None:
def __init__(self, location: str | object) -> None:
url = getattr(location, "url", location)
url = f'{os.getenv("BASE_URL", "")}{url}'
self.url = url

0 comments on commit 15a2cb3

Please sign in to comment.