authorjapps/zerocode

Execute tests from absolute path of a scenario file

オープン

#722 opened on 2025/08/11

 (6 件のコメント) (0 件のリアクション) (1 人の担当者)Java (447 件のフォーク)auto 404
good first issue

Repository metrics

Stars
 (1,010 個のスター)
PR merge metrics
 (平均マージ 1d 4h) (30d で 1 merged PR)

説明

Currently the Zerocode runner can execute a test from the Classpath. That's fine and we will retain this as this is given default to us. See example: https://github.com/authorjapps/zerocode/blob/master/http-testing-examples/src/test/java/org/jsmart/zerocode/testhelp/tests/helloworld/JustHelloWorldTest.java

@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.

AC = Acceptance Criteria

コントリビューターガイド