-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Observation feature hide_bid_if_invisible (#43)
* hide_bid_if_invisible feature * version bump 0.3.3 * ci tests
- Loading branch information
Showing
7 changed files
with
54 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
__version__ = "0.3.3dev" | ||
__version__ = "0.3.3" | ||
|
||
import playwright.sync_api | ||
|
||
|
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 |
---|---|---|
|
@@ -390,6 +390,17 @@ def test_dom_to_text(): | |
assert "Text within in non-html tag" in dom | ||
assert "Text that should not be visible" not in dom | ||
|
||
dom = flatten_dom_to_str( | ||
obs["dom_object"], | ||
extra_properties=obs["extra_element_properties"], | ||
hide_bid_if_invisible=True, | ||
) | ||
assert "<title" in dom | ||
assert "<title bid=" not in dom | ||
assert 'type="submit" value="Submit"' in dom | ||
assert "Text within in non-html tag" in dom | ||
assert "Text that should not be visible" in dom | ||
|
||
dom = flatten_dom_to_str( | ||
obs["dom_object"], | ||
extra_properties=obs["extra_element_properties"], | ||
|
@@ -449,16 +460,17 @@ def test_axtree_to_text(): | |
assert 'box="(' in axtree | ||
assert 'center="(' in axtree | ||
assert ", clickable, visible, som" in axtree | ||
assert "heading 'Simple Form', box=\"(" in axtree | ||
assert "textbox 'Email:' value='[email protected]'" in axtree | ||
assert "] heading 'Simple Form', box=\"(" in axtree | ||
assert "] textbox 'Email:' value='[email protected]'" in axtree | ||
assert "Text within in non-html tag" in axtree | ||
assert "Text that should not be visible" in axtree | ||
assert "] paragraph" in axtree | ||
|
||
axtree = flatten_axtree_to_str( | ||
obs["axtree_object"], extra_properties=obs["extra_element_properties"], filter_som_only=True | ||
) | ||
assert "LabelText" not in axtree | ||
assert "button 'Submit'" in axtree | ||
assert "] button 'Submit'" in axtree | ||
assert "Text within in non-html tag" not in axtree | ||
assert "Text that should not be visible" not in axtree | ||
|
||
|
@@ -468,9 +480,22 @@ def test_axtree_to_text(): | |
filter_visible_only=True, | ||
) | ||
assert "RootWebArea" in axtree | ||
assert "button 'Submit'" in axtree | ||
assert "] button 'Submit'" in axtree | ||
assert "Text within in non-html tag" in axtree | ||
assert "Text that should not be visible" not in axtree | ||
assert "] paragraph" not in axtree | ||
|
||
axtree = flatten_axtree_to_str( | ||
obs["axtree_object"], | ||
extra_properties=obs["extra_element_properties"], | ||
hide_bid_if_invisible=True, | ||
) | ||
assert "RootWebArea" in axtree | ||
assert "] button 'Submit'" in axtree | ||
assert "Text within in non-html tag" in axtree | ||
assert "Text that should not be visible" in axtree | ||
assert "] paragraph '" not in axtree | ||
assert "paragraph '" in axtree | ||
|
||
axtree = flatten_axtree_to_str( | ||
obs["axtree_object"], | ||
|
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
browsergym-core==0.3.3dev | ||
browsergym-core==0.3.3 | ||
tiktoken>=0.4 |
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 |
---|---|---|
@@ -1 +1 @@ | ||
browsergym-core==0.3.3dev | ||
browsergym-core==0.3.3 |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
browsergym-core==0.3.3dev | ||
browsergym-core==0.3.3 | ||
libwebarena==0.0.3 |