Skip to content

After installing version 1.0.0 and executing [Find step definition] service , there is nothing happened. #319

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

Closed
daipn1995 opened this issue Jan 8, 2019 · 9 comments · Fixed by #326
Assignees
Labels
🐛 bug Defect / Bug
Milestone

Comments

@daipn1995
Copy link

Step to reproduce:

  • Step 1: Install new version cucumber-eclipse-plugin-1.0.0-SNAPSHOT ( I'm using Neon.3 Release (4.6.3)).
  • Step 2: Create a new feature file as the picture below:
    screenshot_1
  • Step 3: Create stepDefinition class as the picture below:
    screenshot_2
  • Step 4: Create Runner class to run the feature file with JUnit.
    screenshot_3
  • Step 5: Try to run the feature file As Cucumber Feature. It returns passed results with the correct resources as the picture below.
    screenshot_4
  • Step 6: Using [Find step definition] service (F3).
    Issue:
  • Actual results: There is nothing happened and no service in progress.
  • Expected results: Eclipse will automatically redirect to corresponding step definition.
    Please help me to find out what 's wrong with this behavior.
@qvdk
Copy link
Member

qvdk commented Jan 8, 2019

Hello @PNDAI,

You should configure your project as Cucumber project.
On each cucumber project, right clic > Configure > Convert to Cucumber Project.

screenshot from 2019-01-08 10-08-36

This will enable Cucumber builders.

@daipn1995
Copy link
Author

daipn1995 commented Jan 8, 2019

Thanks a lot for your answer.
However, after I convert it to Cucumber project, the warning message is displayed as below.
screenshot_1
Then, I tried to use the [Find step definition] service again but it still does not work.
Nothing happened.
This is my sample project (Java project): https://drive.google.com/drive/folders/1v1h-oFcAGnTP7hVVAy9t-zTayrGTPX5U

@qvdk
Copy link
Member

qvdk commented Jan 8, 2019

I will try your project later.

But for now, I think your project seems to be misconfigured from the screenshot.
Could you try to add the /src/test/java as source folder. (Right click on the folder > Build path > Use a source folder), same for src/main/java.
And ensure your classes are compiled.

Thanks for your feedback.

@qvdk
Copy link
Member

qvdk commented Jan 8, 2019

In the v1.0.0, you should obtain a little Cucumber logo when the plugin found a step definition.

screenshot from 2019-01-08 15-40-17

On mouse hover, a popup will show the step definition location.

@qvdk
Copy link
Member

qvdk commented Jan 8, 2019

The Find step definition (with shortcut F3) is the same functionnality than CTRL+clic

It is not a refresh. Maybe we could rename it Go to step definition, and it should be enabled only when a step definition is found.

You have 2 ways to force a new step definitions scan:

  • clean and rebuild your project
  • F5 Recalculate steps, maybe this one should be renamed too as Refresh step definitions scan

@qvdk qvdk self-assigned this Jan 8, 2019
@daipn1995
Copy link
Author

Hi @qvdk
After updating /src/test/java & src/main/java as source folder, the warning 's still appear.
Then, I tried to clean the project and it displays an alert with content: "Errors occurred during the build.
Errors running builder 'Cucumber step definitions builder' on project 'Test'. java.lang.NullPointerException"
in every version of cucumber-eclipse.
screenshot_1

@daipn1995
Copy link
Author

Hi @qvdk,
I tried to build a new project with the same original structure. And it's worked.
You can see my new project on Cucumber
AND old project on Cucumbers
Pleases helps me to figure out!

@qvdk
Copy link
Member

qvdk commented Jan 10, 2019

Hi @PNDAI

I can reproduce your issue with your attachments.

The NullPointerException comes from an issue in the search engine of the JDT plugin used when searching step definitions.
This is related to #313, but the issue was not totally solved due to a duplicate code.

More, they was an issue when using wildcards cucumber imports.

I also fix the setup of your project to compile it:

  • configure build path, adding src/main/java src/main/resources src/test/java src/test/resources
  • fix package and imports: removing main.java. and test.java.
  • add all libraries to classpath

And it's finally works !

screenshot from 2019-01-10 23-02-54

Thanks a lot for your feedback.

You can use fully qualified imports as workaround until the next snapshot. This one will be automatically done after the merge of the pull request #326

@qvdk qvdk added this to the 1.0.0 milestone Jan 10, 2019
@qvdk qvdk added the 🐛 bug Defect / Bug label Jan 10, 2019
@daipn1995
Copy link
Author

Thank you for all your help!

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

Successfully merging a pull request may close this issue.

2 participants