ME021-taskStatistics-rejectReceiver-iget-loot.yml 2.8 KB
config:
    name: ME021-抢单任务驳回后-我领取的-待确认-1
    base_url: ${ENV(base_url)}

teststeps:

-   name: $phone 登录系统
    variables:
      phone: ${ENV(phone2)}
    testcase: testcases/common/COM001_task_login_testcases.yml

-   name: 发布抢单任务
    variables:
      action: 1
      title: '抢单任务标题${get_nowtime()}'
      content: '抢单任务内容${get_nowtime()}'
      acceptability: '抢单任务验收标准${get_nowtime()}'
    api: api/app_api/task_api/taskPublish_api.yml


-   name: $phone 登录系统
    variables:
      phone: ${ENV(phone1)}
    testcase: testcases/common/COM001_task_login_testcases.yml

-   name: 查看抢单任务列表
    variables:
      action: 0
      newest: 1
    api: api/app_api/task_api/contendTasks_api.yml
    extract:
      - tasks_id: content.data.tasks.0.id
      - tasks_title: content.data.tasks.0.title
#    validate:
#      - eq:
#          - content.data.tasks.0.title
#          - $title

-   name: 领取任务
    variables:
      action: 0
      id: $tasks_id
    api: api/app_api/task_api/submitCompete_api.yml

-   name: 第一次查看我领取的
    api: api/app_api/taskStatistics_api/taskStatistics_api.yml
    extract:
        - iGetWaitVerify: content.data.taskMsg.iGetWaitVerify
        - iGetInProgress: content.data.taskMsg.iGetInProgress
        - iGetWaitAcceptance: content.data.taskMsg.iGetWaitAcceptance
        - iGetCompleted: content.data.taskMsg.iGetCompleted

-   name: $phone 登录系统
    variables:
      phone: ${ENV(phone2)}
    testcase: testcases/common/COM001_task_login_testcases.yml

-   name: 查看我发布的-待确认
    variables:
      action: 5
    api: api/app_api/task_api/iPublishedTasks_api.yml
    validate:
      - eq:
          - content.data.tasks.0.title
          - $tasks_title
      - eq:
          - content.data.tasks.0.id
          - $tasks_id

-   name: 驳回领取人
    variables:
        taskId: $tasks_id
        reason: "抢单任务驳回理由${get_endtime()}"
    api: api/app_api/task_api/rejectReceiver_api.yml
    validate:
      - eq:
          - content.msg
          - 驳回成功

-   name: $phone 登录系统
    variables:
      phone: ${ENV(phone1)}
    testcase: testcases/common/COM001_task_login_testcases.yml

-   name: 第二次查看我领取的-待确认-1
    api: api/app_api/taskStatistics_api/taskStatistics_api.yml
    validate:
        - eq:
            - content.data.taskMsg.iGetWaitVerify
            - ${add($iGetWaitVerify,-1)}
        - eq:
              - content.data.taskMsg.iGetInProgress
              - ${add($iGetInProgress,0)}
        - eq:
              - content.data.taskMsg.iGetWaitAcceptance
              - ${add($iGetWaitAcceptance,0)}
        - eq:
              - content.data.taskMsg.iGetCompleted
              - ${add($iGetCompleted,0)}