Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step Reuse #21

Open
benjamine opened this issue Jan 6, 2012 · 1 comment
Open

Step Reuse #21

benjamine opened this issue Jan 6, 2012 · 1 comment

Comments

@benjamine
Copy link

Maybe I'm missing something, but it looks like the current implementation is not compatible with one of the greatest features when using gherkin: Step defintion reuse!

That means, I want to define steps (ie. methods) that are mapped to gherkin lines based on a regular expression.
Maybe kyuri is not that far from that, with something like this (modified from the README example):


vows.describe('Addition').addBatch({
  "Add two numbers": {
    "GIVEN I have entered 50 into the calculator": {
          topic: function () {
            Given('I have entered 50 into the calculator');
          },
            "AND I have entered 70 into the calculator": {
              topic: function () {
                Given('I have entered 70 into the calculator');
              },
                "WHEN I press add": {
                  topic: function () {
                   When('I press add');
                  },
                    "THEN the result should be 120 on the screen": function () {
                      Then('the result should be 120 on the screen);
                    },
                }
            }
        }
  }
}).export(module);

then on runtime, those methods could use regex to call the appropiate step method defined somewhere else.
Given, When, and Then methods could be implemented easily.
It could be just a flag for kyuri to generate tests like this.

@benjamine
Copy link
Author

Sorry for the delay,
I tried what you said on the google.com search homepage textbox:

  • Keyboard es-ar (spanish argentina), ALT+(key at right of zero) = textbox loose focus and no backslash appears
  • Keyboard any, ALT+92 = backslash appears, OK
  • Keyboard en-US, backslash key = backslash appears, OK

I tried debugging a little and I have screenshot I think that could help, here it is:

http://i39.tinypic.com/b8spqb.png

the screenshot is at the moment I pressed backslash (alt+keyatrightofzero) in the twitter.com search textbox, noticed that for some reason exitInsertMode is being called on keydown)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant