Skip to content

Commit

Permalink
fix for send keys update
Browse files Browse the repository at this point in the history
  • Loading branch information
bcpeinhardt committed Jan 9, 2023
1 parent 9d63a58 commit 6443aa3
Show file tree
Hide file tree
Showing 4 changed files with 369 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ impl Interpreter {
};
self.get_curr_elem()
.await?
.send_keys("" + key_to_press)
.send_keys("" + &key_to_press)
.await
.map_err(|_| {
self.error("Error pressing key. Make sure you have an element in focus first.")
Expand Down
367 changes: 367 additions & 0 deletions test_scripts/reports/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,367 @@
<html>
<head>
<title>Test Report: demo</title>
<style>
body {
text-align: center;
}

img {
width: 50vw;
height: auto;
}

header, footer {
position: fixed;
left: 0;
right: 0;
background: #368657;
color: white;
font-weight: bold;
font-style: italic;
text-align: center;
vertical-align: middle;
}
header {
top: 0;
}
footer {
bottom: 0;
}

header h1 {
font-size: 18px;
}

header h2 {
font-size: 16px;
}

.container {
width: 70 vw;
top: 100px;
bottom: 100px;
overflow: hidden;
padding-top: 100px;
padding-bottom: 100px;
text-align: left;
}

div {
font-size: 16px;
}

.comment {
color: #d7cbb2;
}

.successful-stmt {
color: #368657;
}

.errored-stmt {
color: #b52d0e;
}

.error {
color: #d7cbb2;
font-size: 14px;
font-style: italic;
}
</style>
</head>
<body>




<header>
<h1>Test Report: demo</h1>
<h2>Executed at: Mon Jan 9 06:03:55 2023</h2>
</header>
<div class="container">



<div class="comment"># A demo of how SchnauzerUI simplifies complex Selenium tasks</div>









<div class="comment"># Navigate to a website with the url command</div>










<div class="successful-stmt">Statement Succeeded: url &quot;https://automationintesting.com/selenium/testpage/&quot;</div>






<br>





<div class="comment"># Use &quot;smart locators&quot; to easily locate elements without</div>









<div class="comment"># having to think about HTML</div>









<div class="comment"># Locate an input by its label</div>










<div class="successful-stmt">Statement Succeeded: locate &quot;First name&quot; and type &quot;Benjamin&quot;</div>






<br>





<div class="comment"># Or its placeholder</div>










<div class="successful-stmt">Statement Succeeded: locate &quot;Enter your surname&quot; and type &quot;Peinhardt&quot;</div>






<br>





<div class="comment"># Built in select support</div>










<div class="successful-stmt">Statement Succeeded: locate &quot;Gender&quot; and select &quot;Male&quot;</div>






<br>






<div class="successful-stmt">Statement Succeeded: locate &quot;Which continents have you visited&quot; and select &quot;Asia&quot;</div>






<br>





<div class="comment"># Escape to using XPaths for complete control</div>










<div class="successful-stmt">Statement Succeeded: locate &quot;//*[@id=&#039;red&#039;]&quot; and click</div>






<br>





<div class="comment"># It knows about textareas too.</div>










<div class="successful-stmt">Statement Succeeded: locate &quot;Tell me more!&quot; and type &quot;there&#039;s not much to tell&quot;</div>






<br>





<div class="comment"># Easily locate all kinds of inputs</div>










<div class="successful-stmt">Statement Succeeded: locate &quot;Email&quot; and click</div>






<br>






<div class="successful-stmt">Statement Succeeded: locate &quot;SMS&quot; and click</div>






<br>





<div class="comment"># Supporting commands like screenshots, error handling, etc.</div>










<div class="successful-stmt">Statement Succeeded: screenshot</div>





<div>
<img src=./screenshots/demo_screenshot_1.png />
</div>



<br>





<div class="comment"># Now lets cause an error to see what it looks like in the report</div>










<div class="errored-stmt">Statement Failed: locate &quot;I don&#039;t exist&quot; and click</div>
<div class="error">Error: Could not locate the element</div>






<br>



</div>
<footer>Test Report created with SchnauzerUI</footer>
</body>
</html>
1 change: 1 addition & 0 deletions test_scripts/reports/demo.json

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6443aa3

Please sign in to comment.