You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Execute tests from absolute path of a scenario file #722
@TargetEnv("github_host.properties")
@RunWith(ZeroCodeUnitRunner.class)
public class JustHelloWorldTest {
@Test
@Scenario("helloworld/hello_world_status_ok_assertions.json") <---------- picks from Classapth
public void testGet() throws Exception {
}
}
AC1:
But, we need a mechanism to make it flexible to run even if
absolute path is provided to the scenario file
Example :
@Test
// should pick from absolute path and run //
@Scenario("/home/authorj/code/zerocode/http-testing-examples/src/test/resources/helloworld/hello_world_status_ok_assertions.json")
public void testGet() throws Exception {
}
This will give us flexibility help to run from a CI tool by any path.
Then we need a test-scenario I think in our test pack here in the "http-testing-examples" module here
or
anywhere(e.g. here) TBH to run it via the CI pipeline.
Just check(when you get chance), if it's possible to add or already there (before by chance) ?
Then we need a test-scenario I think in our test pack here in the "http-testing-examples" module here or anywhere(e.g. here) TBH to run it via the CI pipeline.
Just check(when you get chance), if it's possible to add or already there (before by chance) ?
Hi @authorjapps, whenever you can time can you please check #726 and let me know if it passess the acceptance criteria. Also I am open to suggestion for any code improvement.
Activity
poseidontor commentedon Aug 20, 2025
Hi @authorjapps , I can see that even in the current implementation reading scenario file from absolute path is supported.
zerocode/core/src/main/java/org/jsmart/zerocode/core/utils/SmartUtils.java
Line 67 in 9659ccd
I tested the same too. Is anything else expected here?
authorjapps commentedon Aug 20, 2025
That's interesting, good spot @poseidontor ! 👍
Then we need a test-scenario I think in our test pack here in the "http-testing-examples" module here
or
anywhere(e.g. here) TBH to run it via the CI pipeline.
Just check(when you get chance), if it's possible to add or already there (before by chance) ?
poseidontor commentedon Aug 20, 2025
@authorjapps there are test cases for this here
authorjapps commentedon Aug 20, 2025
Yep, thanks for finding that @poseidontor ! Good spot once again. That's a unit test.
Is there any integration test?
I understand it may not be straightforward to write one, but please check if one already exists.
Otherwise, we'll need to add one to confirm it works in an integration scenario.
I am also thinking how we can achieve it. Probably the same way the unit test works out the abs path?
Once we figure out this, we can add a IT test and close this ticket.
poseidontor commentedon Aug 25, 2025
Sure! @authorjapps I will try to figure out how we can have a IT test for this scenario
poseidontor commentedon Aug 26, 2025
Hi @authorjapps, whenever you can time can you please check #726 and let me know if it passess the acceptance criteria. Also I am open to suggestion for any code improvement.