No lexer was found for en (no such file to load -- gherkin/lexer/en). Supported languages are listed in gherkin/i18n.json. (Gherkin::I18n::LexerNotFound)
When /^I dismiss the Favorites tooltip$/ do
wait_for { screen_exists("Venues") }
sleep(STEP_PAUSE) # Wait for the transition animation
tap_center
end
When /^I choose the venue "(.*?)"$/ do |venue|
wait_for { screen_exists("Venues") }
touch("searchBarTextField")
keyboard_enter_text(venue)
done
wait_for { query("tableViewCell index:0", :text).first.to_s.strip == venue }
touch("tableViewCell index:0")
end
When /^I go to the Order screen$/ do
wait_for { screen_exists("Welcome") }
touch("buttonLabel marked:'Order'")
end
When /^I choose "(.*?)" from the "(.*?)" tab$/ do |item, tab|
end
When /^I choose "(.*?)" with modifier "(.*?)" from the "(.*?)" tab$/ do |item, modifier, tab|
end
On Sunday, 11 November 2012 at 03:11, Trevor Harmon wrote:
Hi,I'm getting non-deterministic lexing errors from Gherkin. When parsing a particular file, sometimes Gherkin throws Gherkin::Lexer::LexingError, and sometimes it doesn't, without the input changing in any way. I pasted the stack trace at the end of this message.The symptoms I'm seeing are exactly as described in this unresolved issue. But I don't think my problem has to do with character encoding.I tried setting force_ruby=true in gherkin/i18n.rb, as suggested in the issue comments, but that just gave me a different error:No lexer was found for en (no such file to load -- gherkin/lexer/en). Supported languages are listed in gherkin/i18n.json. (Gherkin::I18n::LexerNotFound)I spent a couple hours altering my Cucumber tests to try to narrow down what token is causing the problem, but I was unsuccessful. However, I did manage to narrow down one of my step definition files into something that is triggering a LexingError every time. And yet the code appears to be lexically valid. That file is also pasted below with the stack trace.Of particular interest are the last two step definitions -- I wasn't having any of the non-deterministic problems until I added them.If I remove either the last step definition, or any combination of the first three, then the lexer error goes away (deterministically, I believe). Very strange...
--
-- Rules --
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
Trevor
On Nov 11, 2012, at 6:32 AM, aslak hellesoy <aslak.h...@gmail.com> wrote:Yes, I'm still working on stripping down to a reproducible test case I can share.
> Can you create a minimal project on Github so others can reproduce this?
In the meantime, I'm curious… What could possibly cause non-determinism in a lexer?
Is Cucumber multithreaded?
Can you create a minimal project on Github so others can reproduce this?
Feature: Registration
Scenario: Successful registration
Given I am on the Register screen
When I register as a new user
# TODO: Finish this later
I'm getting clues that the lexer error might be triggered by a comment at the end of a feature file. Something like:Feature: Registration
Scenario: Successful registration
Given I am on the Register screen
When I register as a new user
# TODO: Finish this later
If I add a comment like this to one of my scenarios, I get the lexer error about 1 out of every 5 runs. If I remove the comment, I can run it 10 times without errors.Thoughts?