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

Formatters should report feature paths as relative paths #337

Closed
aslakhellesoy opened this issue Jun 5, 2012 · 6 comments
Closed

Formatters should report feature paths as relative paths #337

aslakhellesoy opened this issue Jun 5, 2012 · 6 comments

Comments

@aslakhellesoy
Copy link
Contributor

See https://groups.google.com/d/msg/cukes/aeBqm6i6F6Y/MgEUjX_01KQJ

The change needs to happen in FileResource.getPath() which uses File.getAbsolutePath()

@mattharr
Copy link

mattharr commented Jun 5, 2012

At the moment can you not choose how features get resolved, i.e. finding it on the classpath using:

@Cucumber.Options(features = "classpath:newyork.feature",format = {"pretty", "html:target/cucumber","json:target/newyork.json" })

Which then gives short names I think?

@shahb
Copy link

shahb commented Jun 6, 2012

Yes, I tried using class path there

@RunWith(Cucumber.class)
@Cucumber.Options(features = "src/test/resources/com/******/test/automation/newyork.feature",format = {"pretty", "html:target/cucumber","json:target/newyork.json" })
public class RunNewYorkTests {
}

This works but output is still the same.
Also I tried

@RunWith(Cucumber.class)
@Cucumber.Options(features = "classpath:newyork.feature",format = {"pretty", "html:target/cucumber","json:target/newyork.json" })
public class RunNewYorkTests {
}

This didn't work:

@mattharr
Copy link

mattharr commented Jun 6, 2012

Maybe try this:

@RunWith(Cucumber.class)
@Cucumber.Options(features = "classpath:com/******/test/automation/newyork.feature",format = {"pretty", "html:target/cucumber","json:target/newyork.json" })
public class RunNewYorkTests {
}

I'm guessing src/test/resources is on the classpath?

@shahb
Copy link

shahb commented Jun 7, 2012

I tried that too and tests was failed with initialization errors.

Output:

Tests in error: 
  initializationError(com.****.test.automation.RunNewYorkTests): No features found at [classpath:src/test/resources/com/****/test/automation/newyork.feature]
  initializationError(com.****.test.automation.RunStockTests): No features found at [classpath:src/test/resources/com/***/test/automation/stock.feature]

Tests run: 2, Failures: 0, Errors: 2, Skipped: 0

I even tried hard coding feature file path C:/Documents and Setting/....../newyork.feature. Tests were passed but JSON report had absolute path in "uri"

@aslakhellesoy
Copy link
Contributor Author

Folks, I have outlined the solution above. The various tweaks you're proposing isn't going to fix this in a reliable way.

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants