<commit_before>This test ensures we can wait for elements explicitly (which means test will stop on timeout), but also implicitly (which will cause exception).


!define HTML { {{{
<html>
<title>Start Page Title</title>
<body>
<input name="remove" type="button" value="Remove">
<label>Add button<input name="add" type="button" value="Add"></label>
<a id="link" href="#">My link</a>
<script type="text/javascript">
    window.onload = function() {
		setTimeout(function() { document.title = "Changed Page Title"; }, 1000);
		setTimeout(function() { document.getElementById("link").innerHTML = "Hallo link"; }, 1500);
		setTimeout(function() { document.getElementsByName("add")[0].setAttribute("value", "Add more"); }, 2000);
		setTimeout(function() { document.getElementsByName("remove")[0].setAttribute("value", "\nRemove more"); }, 2500);
    }
</script>
</body>
</html>}}} }


|script      |mock xml server setup|
|add response|${HTML}              |
|$url=       |get mock server url  |

|script                          |browser test                                           |
|open                            |$url                                                   |
|check                           |page title                      |Start Page Title      |
|check                           |value of                        |Add button|Add        |
|seconds before timeout          |1                                                      |
|check                           |seconds before timeout          |1                     |
|check                           |seconds before page load timeout|1                     |
|seconds before page load timeout|4                                                      |
|check                           |seconds before timeout          |1                     |
|check                           |seconds before page load timeout|4                     |
|wait for page                   |Changed Page Title                                     |
|click                           |Hallo link                                             |
|check                           |value of                        |add       |Add more   |
|note                            |non-existing item's value is null                      |
|check                           |value of                        |delete    |null       |
|note                            |text may be value of actual text                       |
|wait for tag                    |a                               |with text |Hallo link |
|wait for tag                    |input                           |with text |Remove more|
|wait for visible                |Add button                                             |
|show                            |page source                                            |

|script|mock xml server setup|
|stop                        |<commit_msg>Extra newline is more likely in text then in attribute<commit_after>This test ensures we can wait for elements explicitly (which means test will stop on timeout), but also implicitly (which will cause exception).


!define HTML { {{{
<html>
<title>Start Page Title</title>
<body>
<input name="remove" type="button" value="Remove">
<label>Add button<input name="add" type="button" value="Add"></label>
<a id="link" href="#">My link</a>
<script type="text/javascript">
    window.onload = function() {
		setTimeout(function() { document.title = "Changed Page Title"; }, 1000);
		setTimeout(function() { document.getElementById("link").innerHTML = "Hallo link\n"; }, 1500);
		setTimeout(function() { document.getElementsByName("add")[0].setAttribute("value", "Add more"); }, 2000);
		setTimeout(function() { document.getElementsByName("remove")[0].setAttribute("value", "Remove more"); }, 2500);
    }
</script>
</body>
</html>}}} }


|script      |mock xml server setup|
|add response|${HTML}              |
|$url=       |get mock server url  |

|script                          |browser test                                           |
|open                            |$url                                                   |
|check                           |page title                      |Start Page Title      |
|check                           |value of                        |Add button|Add        |
|seconds before timeout          |1                                                      |
|check                           |seconds before timeout          |1                     |
|check                           |seconds before page load timeout|1                     |
|seconds before page load timeout|4                                                      |
|check                           |seconds before timeout          |1                     |
|check                           |seconds before page load timeout|4                     |
|wait for page                   |Changed Page Title                                     |
|click                           |Hallo link                                             |
|check                           |value of                        |add       |Add more   |
|note                            |non-existing item's value is null                      |
|check                           |value of                        |delete    |null       |
|note                            |text may be value or actual text, and will be trimmed  |
|wait for tag                    |a                               |with text |Hallo link |
|wait for tag                    |input                           |with text |Remove more|
|wait for visible                |Add button                                             |
|show                            |page source                                            |

|script|mock xml server setup|
|stop                        |
{'fraction_non_alphanumeric': 0.09103424539666151, 'fraction_numerical': 0.008260196179659268, 'mean_word_length': 1.0145580589254766, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 35, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4560821', 'n_tokens_mistral': 1239, 'n_tokens_neox': 1159, 'n_words': 399}