Skip to main content

robot grpc support

Project description

环境要求

  • python >= 2.7
  • pip
  • node >= 10

安装

  • npm i -g robot-grpc
  • pip install RobotGrpc

使用示例

robot脚本文件

*** Settings ***
Library   RobotGrpc      api.myscrm.cn:30051    https://git.myscrm.cn/jiangj01/panther-proto.git    f-20180508-project   ${accessToken}

*** Test Cases ***
调用grpc方法
    ${res} =  invoke grpc method  article_project.ProjectArticleService.GetArticleInfo  { "sid": "12323553" }
    log  ${res}

执行所有用例
    run grpc cases  ${CURDIR}/GetArticleInfo.js

指定运行特定用例
    run grpc cases  ${CURDIR}/GetArticleInfo.js  异常

运行场景用例
    run grpc cases  ${CURDIR}/login.js

GetArticleInfo.js

const id = "article_project.ProjectArticleService.GetArticleInfo";

module.exports = {
  id: id,
  cases: {
    正常: {
      id: id,
      name: "正常",
      desc: 'desc',
      request: {
        "article_id": 0,
        "yk_org_code": "string",
        "project_id": 0
      },
      response: {
        "article_id": 0,
        "yk_org_code": "string",
        "user_id": 0,
        "title": "string", // 标题
        "thumbnail": "string",
        "publish_time": 0,
        "record_info": {
          "read_num": 0,
          "read_person_num": 0,
          "forwarded_num": 0,
          "forwarded_person_num": 0,
          "like_num": 0,
          "like_list": [{}]
        },
        "project_id": 0,
        "post_content": "string",
        "status": 0
      }
    },
    异常: {
      id: id,
      name: "异常",
      desc: '',
      request: {
        "article_id": 0,
        "yk_org_code": "string",
        "project_id": 0
      },
      response: {
        "article_id": 1,
        "yk_org_code": "string",
        "user_id": 0,
        "title": "string", // 标题
        "thumbnail": "string",
        "publish_time": 0,
        "record_info": {
          "read_num": 0,
          "read_person_num": 0,
          "forwarded_num": 0,
          "forwarded_person_num": 0,
          "like_num": 0,
          "like_list": [
            {
            }
          ]
        },
        "project_id": 0,
        "post_content": "string",
        "status": 0
      }
    }
  }
}

login.js

const GetArticleInfo = require('./GetArticleInfo');

module.exports = {
  id: 'login',
  cases: [
    GetArticleInfo.cases.正常,
    GetArticleInfo.cases.异常,
  ],
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

RobotGrpc-0.0.6.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

RobotGrpc-0.0.6-py2-none-any.whl (2.7 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page