Cucumberish icon indicating copy to clipboard operation
Cucumberish copied to clipboard

Step implementation with parameters

Open David-Grigoryan opened this issue 6 years ago • 2 comments

I have Then step in my .feature file Then I have entered valid <username> and <password> And also examples provided like:

Examples:
        |      username    | password   |
        | "[email protected]" | "password" |

I stuck on swift implementation part and unable to write any correct swift code as I can't find any example or documentation. The simple steps without parameters are working as they should but I'm unable to match step implementation with step definition and even pass actual arguments. Everything I found is usual steps without parameters or it's obj-c code. If anyone can help me with step definition in Swift for this particular step I'll be more than happy.

David-Grigoryan avatar May 17 '18 10:05 David-Grigoryan

@David-Grigoryan
How about write scenarios outline as follow?

Examples:
        |   username      | password       |
        |  [email protected] | xxxxxx         |

jerseysu avatar May 17 '18 16:05 jerseysu

You don't need to add commas around your identifier

Examples: | username | password | username field | password field | | [email protected] | password | username_textfield | password_textfield |

And then use like this OR use as per your step defination And i type "<username>" into "<username field>" And i type "<password>" into "<password field>"

kk143g avatar Aug 21 '20 10:08 kk143g