美文网首页
TestLinkJ -02- rest api v2 list

TestLinkJ -02- rest api v2 list

作者: antony已经被占用 | 来源:发表于2019-07-13 11:05 被阅读0次

在着手开始TestLinkJ的开发之前,先来分析下TestLink原生提供的restful api包括了哪些接口。

Location

在TestLink的发布包或者安装目录中,通过以下路径可以找到完整的api。目前Test Link的API版本是v2。

\testlink\lib\api\rest\v2

APIs

TestLink并没有提供类似Javadoc或者swagger openapi 之类的接口说明,但是在tlRestApi.class.php文件中,可以找到如下的api。

    $this->app->contentType('application/json');


    // test route with anonymous function 
    $this->app->get('/who', function () { echo __CLASS__ . ' : Get Route /who';});

    $this->app->get('/whoAmI', array($this,'authenticate'), array($this,'whoAmI'));
    $this->app->get('/testprojects', array($this,'authenticate'), array($this,'getProjects'));

    $this->app->get('/testprojects/:id', array($this,'authenticate'), array($this,'getProjects'));
    $this->app->get('/testprojects/:id/testcases', array($this,'authenticate'), array($this,'getProjectTestCases'));
    $this->app->get('/testprojects/:id/testplans', array($this,'authenticate'), array($this,'getProjectTestPlans'));

    $this->app->post('/testprojects', array($this,'authenticate'), array($this,'createTestProject'));
    $this->app->post('/executions', array($this,'authenticate'), array($this,'createTestCaseExecution'));
    $this->app->post('/testplans', array($this,'authenticate'), array($this,'createTestPlan'));
    $this->app->post('/testplans/:id', array($this,'authenticate'), array($this,'updateTestPlan'));

    $this->app->post('/testsuites', array($this,'authenticate'), array($this,'createTestSuite'));
    $this->app->post('/testcases', array($this,'authenticate'), array($this,'createTestCase'));

    // $this->app->get('/testplans/:id', array($this,'getTestPlan'));

从中我们可以看出,
1)TestLink主要使用了get/post两种http请求类型
2)除了 “/who” 这个接口以外,其余的接口都是需要认证才能访问的。这个接口可以扮演类似ping的作用。
3)TestLink目前提供的rest 接口主要集中在测试项目、测试计划、测试执行、测试用例集和测试用例上。可以看出功能是非常有限的,主要是完成上述业务对象的新建和查询功能。当然也有更新。
可以看出,TestLink 对于api的定位是client通过api访问后台,其前台是通过php代码直接和后台代码耦合在一起的。如果对TestLink进行SpringBoot改造,前后台分离,前台主要通过API来访问后台实现功能的化,需要对现有API的功能进行大幅扩充。当然这是后面的事情了,首先我们将选取1-2个既有接口,按照其实现逻辑迁移到SrpingBoot上。

相关文章

网友评论

      本文标题:TestLinkJ -02- rest api v2 list

      本文链接:https://www.haomeiwen.com/subject/fhypkctx.html