Skip to content

Commit

Permalink
TEST: disabled element have size test
Browse files Browse the repository at this point in the history
with left todo:
# todo: make it pass both locally and on CI (on CI the field has different size, why?)
  • Loading branch information
yashaka committed Jul 10, 2024
1 parent 5c65c3e commit 381a1c5
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion tests/integration/condition__mixed_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def test_should_have_size__applied_to_collection__passed_and_failed(
ss('li').should(have.no.size_less_than(0))


def test_should_have_size__applied_to_element_or_browser__passed_and_failed(
def test_should_have_size__applied_to_browser__passed_and_failed(
function_browser,
):
browser = function_browser.with_(timeout=0.1, window_width=720, window_height=480)
Expand Down Expand Up @@ -270,6 +270,30 @@ def test_should_have_size__applied_to_element_or_browser__passed_and_failed(
) in str(error)
browser.should(have.no.size({'height': 481, 'width': 720}))


# todo: make it pass both locally and on CI (on CI the field has different size, why?)
def test_should_have_size__applied_to_element__passed_and_failed(
session_browser,
):
browser = session_browser.with_(timeout=0.1)
s = lambda selector: browser.element(selector)
ss = lambda selector: browser.all(selector)
GivenPage(browser).opened_with_body(
'''
<ul>
<form id="form-no-text-with-values">
<div id="empty-inputs">
<input id="hidden-empty" style="display: none">
<input id="visible-empty" style="display: block" value="">
</div>
<div id="non-empty-inputs">
<input id="hidden" style="display: none" value=" One !!!">
<input id="visible" style="display: block" value=" One !!!">
</div>
</form>
'''
)

# element have size?
s('input#hidden-empty').should(have.size({'height': 22, 'width': 147}))
s('input#visible-empty').should(have.size({'height': 22, 'width': 147}))
Expand Down

0 comments on commit 381a1c5

Please sign in to comment.