Tyler-Keith-Thompson / CucumberSwift

A lightweight swift Cucumber implementation
https://tyler-keith-thompson.github.io/CucumberSwift/documentation/cucumberswift/
MIT License
74 stars 19 forks source link

@ in steps causes error #89

Open MarekSlaninka opened 1 year ago

MarekSlaninka commented 1 year ago

Describe the bug When there is @ in step description, like in email address, library will throw error: ["File: file:///....../logout.feature unexpected end of file, expected: #TagLine, #ScenarioLine, #Comment, #Empty"]

To Reproduce Steps to reproduce the behavior:

  1. Use email address in step:
    When  User types text "test@surglogs.com" into "email" input

Expected behavior Library should not read it like a tag, if @ is in quotation marks

Additional context Add any other context about the problem here.

@authentication @logout Feature: Logout

Allows the User to log out from the Application.

Key aspects: • The User needs to be logged in in order to be able to log out.

Background:

Given No user is logged in
And   'Login' screen is displayed

MAIN -------------------------------------------------------------------------------------------

@C1180178 @main @qa-ready Scenario: Log out

When  User types text "test@surglogs.com" into "email" input
And   User types text "123456" into "password" input
And   User clicks on "log in" button
Then  User should see 'Pin' screen
When  User clicks on "log out" button
Then  User should see dialog:
  | CONTENT  | Are you sure you want to log out from clinic? |
  | POSITIVE | Yes                                           |
  | NEGATIVE | No                                            |
When  User clicks on dialog "Yes" button
Then  User should not see any dialog
And   User should see 'Login' screen
MarekSlaninka commented 1 year ago

Any update, please?

Tyler-Keith-Thompson commented 1 year ago

Apologies, this one is a bit tricky because it's not the presence of quotes that has any effect on it. I haven't hide time to track down what exactly the rules are. My guess is that there's something akin to "tags can only show up at the beginning of a line" or "tags shouldn't be parsed if you're already parsing a known entity like a step or feature" but I need to understand what the spec says about it.

In the meantime, you can work around this by escaping it: When User types text "test\@surglogs.com" into "email" input