|
|
|
@ -18,13 +18,13 @@ def test_index_entry( webdriver, webapp ): |
|
|
|
|
results = _do_search( "CCPh", True ) |
|
|
|
|
assert len(results) == 1 |
|
|
|
|
sr_elem = find_child( "#search-results .sr" ) |
|
|
|
|
_check_ruleid( find_child(".subtitle",sr_elem), ("asl-rulebook","A11") ) |
|
|
|
|
_check_ruleid( find_child(".subtitle",sr_elem), ("asl-rulebook!","A11") ) |
|
|
|
|
|
|
|
|
|
# test ruleid's in an index entry's content |
|
|
|
|
results = _do_search( "also want to", False ) |
|
|
|
|
assert len(results) == 1 |
|
|
|
|
sr_elem = find_child( "#search-results .sr" ) |
|
|
|
|
_check_ruleid( find_child(".content",sr_elem), ("asl-rulebook","A3.8") ) |
|
|
|
|
_check_ruleid( find_child(".content",sr_elem), ("asl-rulebook!","A3.8") ) |
|
|
|
|
_dismiss_rule_info_popup() |
|
|
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
|
|
@ -55,18 +55,18 @@ def test_qa( webdriver, webapp ): |
|
|
|
|
results = _do_search( "wp", True ) |
|
|
|
|
assert len(results) == 3 |
|
|
|
|
sr_elem = find_children( "#search-results .sr" )[ 1 ] |
|
|
|
|
_check_ruleid( find_child(".caption",sr_elem), ("asl-rulebook","A24.31") ) |
|
|
|
|
_check_ruleid( find_child(".caption",sr_elem), ("asl-rulebook!","A24.31") ) |
|
|
|
|
_dismiss_rule_info_popup() |
|
|
|
|
_check_ruleid( find_child(".question",sr_elem), ("asl-rulebook","A24.3") ) |
|
|
|
|
_check_ruleid( find_child(".question",sr_elem), ("asl-rulebook!","A24.3") ) |
|
|
|
|
_dismiss_rule_info_popup() |
|
|
|
|
_check_ruleid( find_child(".answer",sr_elem), ("asl-rulebook","A24.31") ) |
|
|
|
|
_check_ruleid( find_child(".answer",sr_elem), ("asl-rulebook!","A24.31") ) |
|
|
|
|
_dismiss_rule_info_popup() |
|
|
|
|
|
|
|
|
|
# test ruleid's in a Q+A entry in the rule info popup |
|
|
|
|
expected = [ |
|
|
|
|
( ".caption", ("asl-rulebook","A24.31") ), |
|
|
|
|
( ".question", ("asl-rulebook","A24.3") ), |
|
|
|
|
( ".answer", ("asl-rulebook","A24.31") ) |
|
|
|
|
( ".caption", ("asl-rulebook!","A24.31") ), |
|
|
|
|
( ".question", ("asl-rulebook!","A24.3") ), |
|
|
|
|
( ".answer", ("asl-rulebook!","A24.31") ) |
|
|
|
|
] |
|
|
|
|
for sel, target in expected: |
|
|
|
|
_do_search( "A24.31", False ) |
|
|
|
@ -88,14 +88,14 @@ def test_errata( webdriver, webapp ): |
|
|
|
|
results = _do_search( "errata", True ) |
|
|
|
|
assert len(results) == 2 |
|
|
|
|
sr_elem = find_children( "#search-results .sr" )[ 1 ] |
|
|
|
|
_check_ruleid( find_child(".caption",sr_elem), ("asl-rulebook","A3.8") ) |
|
|
|
|
_check_ruleid( find_child(".caption",sr_elem), ("asl-rulebook!","A3.8") ) |
|
|
|
|
_dismiss_rule_info_popup() |
|
|
|
|
_check_ruleid( find_child(".content",sr_elem), ("asl-rulebook","A.2") ) |
|
|
|
|
_check_ruleid( find_child(".content",sr_elem), ("asl-rulebook!","A.2") ) |
|
|
|
|
|
|
|
|
|
# test ruleid's in an errata in the rule info popup |
|
|
|
|
expected = [ |
|
|
|
|
( ".caption", ("asl-rulebook","A3.8") ), |
|
|
|
|
( ".content", ("asl-rulebook","A.2") ) |
|
|
|
|
( ".caption", ("asl-rulebook!","A3.8") ), |
|
|
|
|
( ".content", ("asl-rulebook!","A.2") ) |
|
|
|
|
] |
|
|
|
|
for sel, target in expected: |
|
|
|
|
_do_search( "errata", False ) |
|
|
|
@ -116,9 +116,9 @@ def test_user_annotations( webdriver, webapp ): |
|
|
|
|
results = _do_search( "is there anything", False ) |
|
|
|
|
assert len(results) == 1 |
|
|
|
|
sr_elem = find_child( "#search-results .sr" ) |
|
|
|
|
_check_ruleid( find_child(".caption",sr_elem), ("asl-rulebook","A24.3") ) |
|
|
|
|
_check_ruleid( find_child(".caption",sr_elem), ("asl-rulebook!","A24.3") ) |
|
|
|
|
_dismiss_rule_info_popup() |
|
|
|
|
_check_ruleid( find_child(".content",sr_elem), ("asl-rulebook","A24.31") ) |
|
|
|
|
_check_ruleid( find_child(".content",sr_elem), ("asl-rulebook!","A24.31") ) |
|
|
|
|
_dismiss_rule_info_popup() |
|
|
|
|
|
|
|
|
|
# --------------------------------------------------------------------- |
|
|
|
@ -134,11 +134,11 @@ def test_asop( webdriver, webapp ): |
|
|
|
|
results = _do_search( "first/next", False ) |
|
|
|
|
assert len(results) == 1 |
|
|
|
|
sr_elem = find_child( "#search-results .sr" ) |
|
|
|
|
_check_ruleid( find_child(".content",sr_elem), ("asl-rulebook","A11.3-.34") ) |
|
|
|
|
_check_ruleid( find_child(".content",sr_elem), ("asl-rulebook!","A11.3-.34") ) |
|
|
|
|
|
|
|
|
|
# click through to the ASOP section and check the ruleid there |
|
|
|
|
find_child( ".caption", sr_elem ).click() |
|
|
|
|
_check_ruleid( find_child("#asop .section"), ("asl-rulebook","A11.3-.34") ) |
|
|
|
|
_check_ruleid( find_child("#asop .section"), ("asl-rulebook!","A11.3-.34") ) |
|
|
|
|
|
|
|
|
|
# check the ruleid in the ASOP chapter |
|
|
|
|
refresh_webapp( webdriver ) # nb: clear the ASOP overrides |
|
|
|
@ -146,14 +146,14 @@ def test_asop( webdriver, webapp ): |
|
|
|
|
open_asop_chapter( "close-combat" ) |
|
|
|
|
sections = find_children( "#asop .section" ) |
|
|
|
|
assert len(sections) == 4 |
|
|
|
|
_check_ruleid( sections[1], ("asl-rulebook","A11.3-.34") ) |
|
|
|
|
_check_ruleid( sections[1], ("asl-rulebook!","A11.3-.34") ) |
|
|
|
|
|
|
|
|
|
# check the ruleid in the ASOP section |
|
|
|
|
refresh_webapp( webdriver ) |
|
|
|
|
select_tabbed_page( "nav", "asop" ) |
|
|
|
|
open_asop_section( "close-combat", 1 ) |
|
|
|
|
section = find_child( "#asop .section" ) |
|
|
|
|
_check_ruleid( section, ("asl-rulebook","A11.3-.34") ) |
|
|
|
|
_check_ruleid( section, ("asl-rulebook!","A11.3-.34") ) |
|
|
|
|
|
|
|
|
|
# --------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|