You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Automatics API can be created using two custom annotations: @AutomaticsApi and @AutomaticsApiParam. The former is used to declare the automatics API, while the latter is used to declare automatics API parameters.


Below is the example which showcase the code of Automatics API.

@AutomaticsApi(category = AutomaticsApiCategory.TUNE_CHANNEL, applicableFor = {
        ApplicableFor.RDKV, }, description = "Tune to particular IP channel", name = "TUNE_TO_PARTICULAR_IPCHANNEL", returntype = "String")
    public static ResponseObject tuneToAnIpChannelAndCheckAV(AutomaticsTapApi tapEnv, Dut device,
        @AutomaticsApiParam(name = "channelNo", description = "Channel Number", defaultOptions = "120,121") String channel No,
        @AutomaticsApiParam(name = "streamType", description = "Stream Type", defaultOptions = "HD, SD") String stream Type) {

{
    //code to perform
}

      1. @AutomaticsApi: It is custom annotation need to be written at the very beginning of function definition as shown in example. so, whenever API is called the below defined function will be executed. This annotation takes below mentioned parameter values:

        1. category: Automatics API category for which the API is created.

        2. applicable for: For which environment the API is applicable, such as RDKB, RDKC, RDKV.

        3.  description: A short description of what the API does.

        4.  name: Name of the API. Whatever name is defined over here will be seen as the API name in the Automatics UI under the available method section during TC automation.

        5.  returntype: Datatype of the response which is going to be returned by the API.

      2. @AutomaticsApiParam:  It is custom annotation using which we can take a parameter value from user from the automatics UI.
        This annotation takes below mentioned parameter values:
        1. description: A short description of what this parameter is used for.

        2. name: Name of the parameter. Whatever name is defined over here will be seen as the API parameter with an input box in the input configuration of the API.

        3. default options : It will be seen as a value suggestion in the input box of the parameter.Multiple values can be added using comma.

  1. Trigger the Jenkins pipeline for creating the rdkb-utils JAR.
    1. Open relatable URL.
      1. RDK_B Test utils : https://code.rdkcentral.com/r/admin/repos/rdk/tools/automatics/rdkb-test-utils
      2. RDK_B Tests:  https://code.rdkcentral.com/r/admin/repos/rdk/tools/automatics/rdkb-tests
    2. Click on "Build with parameters"
    3. Select "RDKB-UTILS" as profile.
    4. Click on "Build" button.

 3.Jenkins Builds for API Scan.

Finally, trigger the job to scan the newly created API for automatics. This step is mandatory to make the new API available in the Automatics UI.

  • No labels