CucumberSwift icon indicating copy to clipboard operation
CucumberSwift copied to clipboard

@ in steps causes error

Open MarekSlaninka opened this issue 1 year ago • 2 comments

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 "[email protected]" 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.

  • XCode Version: XCode 14.3
  • CucumberSwift Version: 4.2.2
  • Example Feature File:
  #
# **************************************************************************************************
#                      Copyright (C) 2019 Surglogs Inc. - All Rights Reserved
# **************************************************************************************************
# This file is proprietary and confidential. Unauthorized COPYING of this file or any part of its
# content, via ANY MEDIUM, is strictly PROHIBITED.
# **************************************************************************************************
#

@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 "[email protected]" 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 avatar Apr 18 '23 13:04 MarekSlaninka

Any update, please?

MarekSlaninka avatar May 03 '23 11:05 MarekSlaninka

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

Tyler-Keith-Thompson avatar May 03 '23 12:05 Tyler-Keith-Thompson