@@ -8,7 +8,7 @@ import {Locator} from "@playwright/test";
8
8
* @example I execute '$fn' function // fn is function reference
9
9
* @example I execute 'window.scrollBy(0, 100)' function
10
10
*/
11
- When ( 'I execute {value} function' , async function ( fn : MemoryValue ) {
11
+ When ( 'I execute {value} function/script ' , async function ( fn : MemoryValue ) {
12
12
await this . playwright . page . evaluate ( await fn . value ( ) ) ;
13
13
} ) ;
14
14
@@ -19,7 +19,7 @@ When('I execute {value} function', async function (fn: MemoryValue) {
19
19
* @example I execute '$fn' function and save result as 'result' // fn is function reference
20
20
* @example I execute 'window.scrollY' function and save result as 'scroll'
21
21
*/
22
- When ( 'I execute {value} function and save result as {value}' , async function ( fn : MemoryValue , memoryKey : MemoryValue ) {
22
+ When ( 'I execute {value} function/script and save result as {value}' , async function ( fn : MemoryValue , memoryKey : MemoryValue ) {
23
23
memoryKey . set ( await this . playwright . page . evaluate ( await fn . value ( ) ) ) ;
24
24
} ) ;
25
25
@@ -30,7 +30,7 @@ When('I execute {value} function and save result as {value}', async function (fn
30
30
* @example I execute '$fn' function on 'Component > Element' // fn is function reference
31
31
* @example I execute 'arguments[0].scrollIntoView()' function on 'Component > Element'
32
32
*/
33
- When ( 'I execute {value} function on {playwrightLocator}' , async function ( fnKey : MemoryValue , locator : Locator ) {
33
+ When ( 'I execute {value} function/script on {playwrightLocator}' , async function ( fnKey : MemoryValue , locator : Locator ) {
34
34
let fn = await fnKey . value ( ) ;
35
35
if ( typeof fn === 'string' ) {
36
36
fn = new Function ( 'return ' + fn )
@@ -46,7 +46,7 @@ When('I execute {value} function on {playwrightLocator}', async function (fnKey:
46
46
* @example I execute 'arguments[0].innerText' function on 'Component > Element' and save result as 'innerText'
47
47
*/
48
48
When (
49
- 'I execute {value} function on {playwrightLocator} and save result as {value}' ,
49
+ 'I execute {value} function/script on {playwrightLocator} and save result as {value}' ,
50
50
async function ( fnKey : MemoryValue , locator : Locator , memoryKey : MemoryValue ) {
51
51
let fn = await fnKey . value ( ) ;
52
52
if ( typeof fn === 'string' ) {
0 commit comments