Skip to content

Commit

Permalink
ensuring messages include punctuation
Browse files Browse the repository at this point in the history
  • Loading branch information
bandophahita committed Mar 1, 2024
1 parent 8d40dfd commit 0b05999
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion screenpy_selenium/resolutions/is_clickable.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def describe(self) -> str:
"""Describe the Resolution's expectation."""
return "clickable"

@beat("... hoping it's clickable")
@beat("... hoping it's clickable.")
def resolve(self) -> IsClickableElement:
"""Produce the Matcher to make the assertion."""
return is_clickable_element()
2 changes: 1 addition & 1 deletion screenpy_selenium/resolutions/is_invisible.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def describe(self) -> str:
"""Describe the Resolution's expectation."""
return "invisible"

@beat("... hoping it's invisible")
@beat("... hoping it's invisible.")
def resolve(self) -> IsInvisibleElement:
"""Produce the Matcher to make the assertion."""
return is_invisible_element()
2 changes: 1 addition & 1 deletion screenpy_selenium/resolutions/is_present.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def describe(self) -> str:
"""Describe the Resolution's expectation."""
return "present"

@beat("... hoping it's present")
@beat("... hoping it's present.")
def resolve(self) -> IsPresentElement:
"""Produce the Matcher to make the assertion."""
return is_present_element()
2 changes: 1 addition & 1 deletion screenpy_selenium/resolutions/is_visible.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def describe(self) -> str:
"""Describe the Resolution's expectation."""
return "visible"

@beat("... hoping it's visible")
@beat("... hoping it's visible.")
def resolve(self) -> IsVisibleElement:
"""Produce the Matcher to make the assertion."""
return is_visible_element()
22 changes: 20 additions & 2 deletions tests/test_resolutions.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test_beat_logging(self, caplog: pytest.LogCaptureFixture) -> None:
IsClickable().resolve()

assert [r.msg for r in caplog.records] == [
"... hoping it's clickable",
"... hoping it's clickable.",
" => the element is enabled/clickable",
]

Expand Down Expand Up @@ -152,6 +152,15 @@ def test_type_hint(self) -> None:
assert annotation == "IsVisibleElement"
assert type(iv.resolve()) == IsVisibleElement

def test_beat_logging(self, caplog: pytest.LogCaptureFixture) -> None:
caplog.set_level(logging.INFO)
IsVisible().resolve()

assert [r.msg for r in caplog.records] == [
"... hoping it's visible.",
" => the element is visible",
]


class TestIsInvisible:
def test_can_be_instantiated(self) -> None:
Expand Down Expand Up @@ -214,7 +223,7 @@ def test_beat_logging(self, caplog: pytest.LogCaptureFixture) -> None:
IsInvisible().resolve()

assert [r.msg for r in caplog.records] == [
"... hoping it's invisible",
"... hoping it's invisible.",
" => the element is invisible",
]

Expand Down Expand Up @@ -260,3 +269,12 @@ def test_type_hint(self) -> None:
annotation = ip.resolve.__annotations__["return"]
assert annotation == "IsPresentElement"
assert type(ip.resolve()) == IsPresentElement

def test_beat_logging(self, caplog: pytest.LogCaptureFixture) -> None:
caplog.set_level(logging.INFO)
IsPresent().resolve()

assert [r.msg for r in caplog.records] == [
"... hoping it's present.",
" => the element is present",
]

0 comments on commit 0b05999

Please sign in to comment.