0

I am using IntelliJ, when I make a change in one of my .feature (It is paired with JBehave plugin, so it is recognized) files it does not automatically copy the changes to the target folder, where the same file exists.

It is a problem, because when I run SerenityRunner it gets the data from the story file which is in the target.

I got !?*.feature added as a resource pattern into the compiler as it was described in this question: copy jbehave stories into target directory using IntelliJ Idea

Edit: When I am running mvn clean install (or mvn clean package), then the target folders are created, and it is updated accordingly to my most recent story files. However, if I do (Build -> Rebuild project) then the comp folder disappears from the target and SerenityRunner does not even find the story files anymore

So yes, I can add a maven goal (clean package) to the run configuration, but it is more like a workaround

Dániel Flach
  • 85
  • 1
  • 13
  • Not familiar with JBehave but "to the target folder, where the same file exists" sounds suspicious. Maybe that _existing target file_ was created, overwriting the generated file? – Joop Eggen Sep 20 '18 at 15:24
  • Its not exactly the same, just the same name and type, and when I make change to the original file, the changes should be copied into the one which is in the target folder, as I know. – Dániel Flach Sep 20 '18 at 15:27
  • Where is that file located in your project? – JB Nizet Sep 20 '18 at 15:34
  • Typically the "target" folder is dynamic and is only updated by maven if maven detects changes, typicially to code (recompiling classes as needed). This is why you should probably just run a `maven clean` anytime you need to have your feature files updated. They are called story files in JBehave, by the way. You should never have to "copy" anything into the target folder, as far as I know - the application build process should be taking care of those steps for you. – Bill Hileman Sep 20 '18 at 18:25
  • Under the terms of copying I meant that maven automatically copies it into the target. In one of my other project it was done every time I made a change, I dont want to run mvn clean every time before I run tests. /target/test-classes/comp/feature/user_search.feature. – Dániel Flach Sep 21 '18 at 08:16
  • Where the file which you change is located in project exactly? Do you build by IDE or by Maven? If you clean all output directories and invoke Build | Rebuild project - will the file be copied to target directory? – Andrey Sep 21 '18 at 11:11
  • There is no problem with the location, the other project has the same structure. When I am running mvn clean install, then the target folders are created, and it is updated accordingly to my most recent story files. However, if I do (Build -> Rebuild project) then the comp folder disappears from the target and SerenityRunner does not even find the story files anymore. – Dániel Flach Sep 21 '18 at 12:08

0 Answers0