You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/04-dsl.mdx
+77Lines changed: 77 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4238,12 +4238,89 @@ Since [v4.8.0](https://github.com/gwen-interpreter/gwen-web/releases/tag/v4.8.0)
4238
4238
4239
4239
#### JS actions
4240
4240
4241
+
<detailsid="i-execute-js-on-element">
4242
+
<summaryclass="dsl">
4243
+
4244
+
```gherkin
4245
+
I execute <js|javascript> on <element> "<function>"
4246
+
```
4247
+
4248
+
<p>Executes a javascript function on a web element.</p>
4249
+
</summary>
4250
+
<p>Where</p>
4251
+
<ul>
4252
+
<li><code><element></code> is the name of the element to execute the function on</li>
4253
+
<li>
4254
+
<code><function></code> is the javascript function that will perform the action (can be in <Linkto="/docs/doc-strings">DocString</Link> position)
4255
+
<ul>
4256
+
<li>The function must use <Linkto="/docs/js-functions">Arrow syntax</Link> and define a single argument for accepting the web element.</li>
4257
+
</ul>
4258
+
</li>
4259
+
</ul>
4260
+
<p>Example</p>
4261
+
4262
+
```gherkin {3}
4263
+
Given the todo link can be located by xpath "//a[contains(text(),'TodoMVC')]"
4264
+
When I navigate to "https://todomvc.com/examples/react/dist/"
4265
+
And I execute js on the todo link "(elem) => elem.click()"
0 commit comments