import request from '@/utils/request'

// 测试-列表查询
export function getPerfromanceList(query) {
  return request({
    url: '/test/performanceTest/list',
    method: 'get',
    params: query
  })
}

// 测试-列表删除
export function deleteTest(data) {
  return request({
    url: '/test/performanceTest/' + data,
    method: 'put',
    data: data
  })
}

// 测试-列表新增
export function addTest(data) {
  return request({
    url: '/test/performanceTest/add',
    method: 'post',
    data: data
  })
}

// 测试-列表新增并执行
export function addAndExecuteTest(data) {
  return request({
    url: '/test/performanceTest/addAndExecute',
    method: 'post',
    data: data
  })
}

// 引用接口自动化场景
export function getTestCaseList(query) {
  return request({
    url: '/test/performanceTest/testCaseList',
    method: 'get',
    params: query
  })
}

// 测试-详情
export function getTestDetail(query) {
  return request({
    url: 'test/performanceTest/' + query,
    method: 'get',
  })
}

//测试-编辑
export function editTest(data) {
  return request({
    url: '/test/performanceTest',
    method: 'put',
    data: data
  })
}
//测试-编辑-保存并执行
export function editAndExecuteTest(data) {
  return request({
    url: '/test/performanceTest/editAndExecute',
    method: 'put',
    data: data
  })
}

// 测试-编辑-立即执行
export function executeTest(query) {
  return request({
    url: '/test/performanceTest/executeNow?id=' + query,
    method: 'get'
  })
}
