0

I am trying to write my features with a few words from French language, I have followed the behat tutorial and correctly added the comment

#language: fr

at the beginning of the file

I am also saving the file in utf-8 format....

but behat still doesn't run my feature successfully and gives an error

Expected Comment or Scenario or Outline or Step token, but got Text on line: 1

Is it allowed to write features in part french part english

If so , why is it not working in my case.

Thanks,

Taz
  • 173
  • 9
  • Can you give an example of the feature file you are writing as well as your Behat.yml file? That way we can get a better understanding of where the problem is. – Patrick Jul 22 '13 at 20:12

2 Answers2

0

Look at the configuration details in:

[project root]/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n.yml

You can also look in:

[project root]/vendor/behat/gherkin/i18n.php

Make sure you are using the correct syntax for it.

Have you tried using the following just to see if it will work when specifying the language from the command prompt?

$ behat --story-syntax --lang YOUR_LANG

From: http://docs.behat.org/quick_intro.html#more-about-features

Also please provide us with examples of what you are doing. It is kinda hard to troubleshoot something you can't see or analyze.

Patrick
  • 3,302
  • 4
  • 28
  • 47
0

Make sure you don't have a invisible character on your file.

I got the same error because I tried to convert my file from ISO to UTF8 and my editor left some leftover on top of it.

GMartigny
  • 126
  • 8
  • 1
    This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment). – Jens Aug 04 '15 at 08:26
  • I created my account to answer this post. I would have comment if I had enougth reputation. It's weird that comments are locked by default. – GMartigny Aug 05 '15 at 10:13