JBehave
  1. JBehave
  2. JBEHAVE-1050

Last of two subsequent AND-clauses with translated keywords is not performed

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: 3.9.4
    • Fix Version/s: 3.9.5
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Windows 7 x64
    • Number of attachments :
      1

      Description

      I translated 'And' keyword to 'Ande' (actually I use russian word, but in order to simplify I will use plain latin letters). All other keywords remain the same.

      When I try to execute simple scenario with three THEN-clauses concatenated by AND:

      When something happened
      Then check first condition
      Ande check second condition
      Ande check third condition
      

      Then last clause is not matched with corresponding step and marked as pending. Although corresponding step is present in code. If I use english keyword 'And' all work fine.

      I created sample project for reproducing bug: https://github.com/nartamonov/jbehave-i18n-bug

        Activity

        Nikolay Artamonov made changes -
        Field Original Value New Value
        Description I translated jbehave scenario keywords to russian, so that:

        {noformat:nopanel=true}
        Given -> Если
        When -> Когда
        Then -> Тогда
        And -> Также
        {noformat}

        When I try to execute simple scenario with three THEN-clauses concatenated with AND:

        {noformat:nopanel=true}
        Когда something happened
        Тогда check first condition
        Также check second condition
        Также check third condition
        {noformat}

        Then last clause is not matched with corresponding step and marked as pending. Although corresponding step is present in code. *If I use english keywords all work fine*.

        I created sample project for reproducing bug: https://github.com/nartamonov/jbehave-i18n-bug
        I translated jbehave scenario keywords to russian, so that:

        {noformat:nopanel=true}
        Given -> Если
        When -> Когда
        Then -> Тогда
        And -> Также
        {noformat}

        When I try to execute simple scenario with three THEN-clauses concatenated with AND:

        {noformat:nopanel=true}
        Когда something happened
        Тогда check first condition
        Также check second condition
        Также check third condition
        {noformat}

        Then last clause is not matched with corresponding step and marked as pending. Although corresponding step is present in code. *If I use english keywords all work fine*.

        I created sample project for reproducing bug: https://github.com/nartamonov/jbehave-i18n-bug
        Nikolay Artamonov made changes -
        Description I translated jbehave scenario keywords to russian, so that:

        {noformat:nopanel=true}
        Given -> Если
        When -> Когда
        Then -> Тогда
        And -> Также
        {noformat}

        When I try to execute simple scenario with three THEN-clauses concatenated with AND:

        {noformat:nopanel=true}
        Когда something happened
        Тогда check first condition
        Также check second condition
        Также check third condition
        {noformat}

        Then last clause is not matched with corresponding step and marked as pending. Although corresponding step is present in code. *If I use english keywords all work fine*.

        I created sample project for reproducing bug: https://github.com/nartamonov/jbehave-i18n-bug
        I translated jbehave scenario keywords to russian, so that: Если

        {noformat:nopanel=true}
        Given -> Если
        When -> Когда
        Then -> Тогда
        And -> Также
        {noformat}

        When I try to execute simple scenario with three THEN-clauses concatenated with AND:

        {noformat:nopanel=true}
        Когда something happened
        Тогда check first condition
        Также check second condition
        Также check third condition
        {noformat}

        Then last clause is not matched with corresponding step and marked as pending. Although corresponding step is present in code. *If I use english keywords all work fine*.

        I created sample project for reproducing bug: https://github.com/nartamonov/jbehave-i18n-bug
        Nikolay Artamonov made changes -
        Description I translated jbehave scenario keywords to russian, so that: Если

        {noformat:nopanel=true}
        Given -> Если
        When -> Когда
        Then -> Тогда
        And -> Также
        {noformat}

        When I try to execute simple scenario with three THEN-clauses concatenated with AND:

        {noformat:nopanel=true}
        Когда something happened
        Тогда check first condition
        Также check second condition
        Также check third condition
        {noformat}

        Then last clause is not matched with corresponding step and marked as pending. Although corresponding step is present in code. *If I use english keywords all work fine*.

        I created sample project for reproducing bug: https://github.com/nartamonov/jbehave-i18n-bug
        I translated jbehave scenario keywords to russian, so that:

        {noformat:nopanel=true}
        Given -> Если
        When -> Когда
        Then -> Тогда
        And -> Также
        {noformat}

        When I try to execute simple scenario with three THEN-clauses concatenated with AND:

        {noformat:nopanel=true}
        Когда something happened
        Тогда check first condition
        Также check second condition
        Также check third condition
        {noformat}

        Then last clause is not matched with corresponding step and marked as pending. Although corresponding step is present in code. *If I use english keywords all work fine*.

        I created sample project for reproducing bug: https://github.com/nartamonov/jbehave-i18n-bug
        Nikolay Artamonov made changes -
        Description I translated jbehave scenario keywords to russian, so that:

        {noformat:nopanel=true}
        Given -> Если
        When -> Когда
        Then -> Тогда
        And -> Также
        {noformat}

        When I try to execute simple scenario with three THEN-clauses concatenated with AND:

        {noformat:nopanel=true}
        Когда something happened
        Тогда check first condition
        Также check second condition
        Также check third condition
        {noformat}

        Then last clause is not matched with corresponding step and marked as pending. Although corresponding step is present in code. *If I use english keywords all work fine*.

        I created sample project for reproducing bug: https://github.com/nartamonov/jbehave-i18n-bug
        I translated 'And' keyword to 'Ande' (actually I use russian word, but in order to simplify I will use plain latin letters). All other keywords remain the same.

        When I try to execute simple scenario with three THEN-clauses concatenated by AND:

        {noformat:nopanel=true}
        When something happened
        Then check first condition
        Ande check second condition
        Ande check third condition
        {noformat}

        Then last clause is not matched with corresponding step and marked as pending. Although corresponding step is present in code. *If I use english keyword 'And' all work fine*.

        I created sample project for reproducing bug: https://github.com/nartamonov/jbehave-i18n-bug
        Summary Last of two subsequent internationalized AND-clauses is not performed Last of two subsequent AND-clauses with translated keywords is not performed
        Hide
        Mauro Talevi added a comment -

        Patch with configuration changes to get the step matching working with custom locale.

        Show
        Mauro Talevi added a comment - Patch with configuration changes to get the step matching working with custom locale.
        Mauro Talevi made changes -
        Attachment JBEHAVE-1050.patch [ 66522 ]
        Hide
        Mauro Talevi added a comment -

        You had two misconfigurations:

        1. The i18n/keywords_ru.properties was not in the Maven classpath, masked by the (unnecessary) override of the resources
        2. The StepCollector also needs to know about the keywords used.

        Please refer to the attached patch for a working version.

        PS: Note that JBehave is not yet tested with JDK 1.8. It should work but I've tested with 1.7.

        Show
        Mauro Talevi added a comment - You had two misconfigurations: 1. The i18n/keywords_ru.properties was not in the Maven classpath, masked by the (unnecessary) override of the resources 2. The StepCollector also needs to know about the keywords used. Please refer to the attached patch for a working version. PS: Note that JBehave is not yet tested with JDK 1.8. It should work but I've tested with 1.7.
        Mauro Talevi made changes -
        Resolution Not A Bug [ 6 ]
        Fix Version/s 3.9.5 [ 20598 ]
        Assignee Mauro Talevi [ maurotalevi ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        Nikolay Artamonov added a comment -

        Thank you very much, Mauro, it works!

        Show
        Nikolay Artamonov added a comment - Thank you very much, Mauro, it works!

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Nikolay Artamonov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: