From ead008c96b43ac20a4daf716a5855decd844741b Mon Sep 17 00:00:00 2001 From: floraachy <1622042529@qq.com> Date: Thu, 14 Dec 2023 17:07:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BB=A3=E7=A0=81=E5=BA=93?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E7=9B=B8=E5=85=B3=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projects/branch/test_branches.yaml | 36 ++++++++++ .../projects/branch/test_branches_all.yaml | 33 +++++++++ .../projects/branch/test_delete_branch.yaml | 40 +++++++++++ .../projects/branch/test_new_branch.yaml | 35 +++++++++ .../branch/test_set_default_branch.yaml | 36 ++++++++++ .../pull_request/test_edit_pull_request.yaml | 54 ++++++++++++++ .../pull_request/test_new_pull_request.yaml | 54 ++++++++++++++ .../projects/pull_request/test_pr_merge.yaml | 45 ++++++++++++ .../pull_request/test_pull_request.yaml | 42 +++++++++++ .../pull_request/test_refuse_merge.yaml | 40 +++++++++++ .../projects/releases/test_new_releases.yaml | 46 ++++++++++++ .../repository/test_create_files.yaml | 71 ++++++++++++++++++ .../repository/test_project_detail_full.yaml | 34 +++++++++ .../test_project_detail_simple.yaml | 34 +++++++++ .../repository/test_repo_contributors.yaml | 33 +++++++++ .../repository/test_repo_entries.yaml | 34 +++++++++ .../repository/test_repo_sub_entries.yaml | 37 ++++++++++ .../repository/test_update_files.yaml | 72 +++++++++++++++++++ .../gitlink/projects/test_follow_project.yaml | 48 +++++++++++++ .../gitlink/projects/test_fork_project.yaml | 44 ++++++++++++ .../gitlink/projects/test_like_project.yaml | 46 ++++++++++++ .../gitlink/projects/test_new_project.yaml | 14 ++-- .../projects/test_unfollow_project.yaml | 48 +++++++++++++ .../gitlink/projects/test_unlike_project.yaml | 46 ++++++++++++ .../gitlink/projects/test_upload_files.yaml | 6 +- .../gitlink/users/test_user_change_email.yaml | 4 +- .../users/test_user_change_password.yaml | 2 +- .../gitlink/users/test_user_change_phone.yaml | 4 +- .../gitlink/users/test_user_register.yaml | 55 ++++++++++++++ 29 files changed, 1077 insertions(+), 16 deletions(-) create mode 100644 interface/gitlink/projects/branch/test_branches.yaml create mode 100644 interface/gitlink/projects/branch/test_branches_all.yaml create mode 100644 interface/gitlink/projects/branch/test_delete_branch.yaml create mode 100644 interface/gitlink/projects/branch/test_new_branch.yaml create mode 100644 interface/gitlink/projects/branch/test_set_default_branch.yaml create mode 100644 interface/gitlink/projects/pull_request/test_edit_pull_request.yaml create mode 100644 interface/gitlink/projects/pull_request/test_new_pull_request.yaml create mode 100644 interface/gitlink/projects/pull_request/test_pr_merge.yaml create mode 100644 interface/gitlink/projects/pull_request/test_pull_request.yaml create mode 100644 interface/gitlink/projects/pull_request/test_refuse_merge.yaml create mode 100644 interface/gitlink/projects/releases/test_new_releases.yaml create mode 100644 interface/gitlink/projects/repository/test_create_files.yaml create mode 100644 interface/gitlink/projects/repository/test_project_detail_full.yaml create mode 100644 interface/gitlink/projects/repository/test_project_detail_simple.yaml create mode 100644 interface/gitlink/projects/repository/test_repo_contributors.yaml create mode 100644 interface/gitlink/projects/repository/test_repo_entries.yaml create mode 100644 interface/gitlink/projects/repository/test_repo_sub_entries.yaml create mode 100644 interface/gitlink/projects/repository/test_update_files.yaml create mode 100644 interface/gitlink/projects/test_follow_project.yaml create mode 100644 interface/gitlink/projects/test_fork_project.yaml create mode 100644 interface/gitlink/projects/test_like_project.yaml create mode 100644 interface/gitlink/projects/test_unfollow_project.yaml create mode 100644 interface/gitlink/projects/test_unlike_project.yaml create mode 100644 interface/gitlink/users/test_user_register.yaml diff --git a/interface/gitlink/projects/branch/test_branches.yaml b/interface/gitlink/projects/branch/test_branches.yaml new file mode 100644 index 0000000..52ebc12 --- /dev/null +++ b/interface/gitlink/projects/branch/test_branches.yaml @@ -0,0 +1,36 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 分支 + case_markers: + - gitlink + - branches + - gitea + - usefixtures: get_oauth_token + +case_info: +- + id: gitlink_repo_branches_001 + title: 获取项目分支列表 + severity: + run: True + url: /api/v1/${project_url}/branches.json + method: GET + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: params + payload: + keyword: # 搜索关键词 + page: 1 + limit: 10 + files: + assert_response: + status_code: 200 + assertAutor: + message: 断言接口返回存在total_count字段 + assert_type: contains + expect_value: total_count + assert_sql: + extract: diff --git a/interface/gitlink/projects/branch/test_branches_all.yaml b/interface/gitlink/projects/branch/test_branches_all.yaml new file mode 100644 index 0000000..54f7129 --- /dev/null +++ b/interface/gitlink/projects/branch/test_branches_all.yaml @@ -0,0 +1,33 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 分支 + case_markers: + - gitlink + - branches + - gitea + - usefixtures: get_oauth_token + +case_info: +- + id: gitlink_repo_branches_001 + title: 获取项目分支列表(无分页) + severity: + run: True + url: /api/v1/${project_url}/branches/all.json + method: GET + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: params + payload: + files: + assert_response: + status_code: 200 + assertAutor: + message: 断言接口返回存在name字段 + assert_type: contains + expect_value: name + assert_sql: + extract: diff --git a/interface/gitlink/projects/branch/test_delete_branch.yaml b/interface/gitlink/projects/branch/test_delete_branch.yaml new file mode 100644 index 0000000..de0cc4e --- /dev/null +++ b/interface/gitlink/projects/branch/test_delete_branch.yaml @@ -0,0 +1,40 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 分支 + case_markers: + - gitlink + - branches + - gitea + - usefixtures: get_oauth_token + - skip: 前提得存在一个分支,暂时略过 + +case_info: +- + id: gitlink_repo_delete_branch_001 + title: 删除一个项目分支 + severity: + run: True + url: /api/v1/${project_url}/branches/${branch}.json + method: DELETE + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: json + payload: + files: + assert_response: + status_code: 200 + assertStatus: + message: 断言接口返回status=0 + expect_value: 0 + assert_type: == + type_jsonpath: $.status + assertMessage: + message: 断言接口返回message + expect_value: fork项目成功 + assert_type: == + type_jsonpath: $.message + assert_sql: + extract: diff --git a/interface/gitlink/projects/branch/test_new_branch.yaml b/interface/gitlink/projects/branch/test_new_branch.yaml new file mode 100644 index 0000000..ceedcfd --- /dev/null +++ b/interface/gitlink/projects/branch/test_new_branch.yaml @@ -0,0 +1,35 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 分支 + case_markers: + - gitlink + - branches + - gitea + - usefixtures: get_oauth_token + +case_info: +- + id: gitlink_repo_new_branch_001 + title: 创建一个项目分支 + severity: + run: True + url: /api/v1/${project_url}/branches.json + method: POST + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: json + payload: + new_branch_name: ${generate_words()} + old_branch_name: master + files: + assert_response: + status_code: 200 + assertAutor: + message: 断言接口返回存在name字段 + assert_type: contains + expect_value: name + assert_sql: + extract: diff --git a/interface/gitlink/projects/branch/test_set_default_branch.yaml b/interface/gitlink/projects/branch/test_set_default_branch.yaml new file mode 100644 index 0000000..d00a989 --- /dev/null +++ b/interface/gitlink/projects/branch/test_set_default_branch.yaml @@ -0,0 +1,36 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 分支 + case_markers: + - gitlink + - branches + - gitea + - usefixtures: get_oauth_token + - skip: 这个需要仓库管理员角色才能操作,暂时略过 + +case_info: +- + id: gitlink_repo_set_default_branch_001 + title: 更新项目默认分支 + severity: + run: True + url: /api/${project_url}.json + method: PUT + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: json + payload: + default_branch: master + files: + assert_response: + status_code: 200 + assertProjectId: + message: 断言projectid + assert_type: == + expect_value: ${project_id} + type_jsonpath: $.id + assert_sql: + extract: diff --git a/interface/gitlink/projects/pull_request/test_edit_pull_request.yaml b/interface/gitlink/projects/pull_request/test_edit_pull_request.yaml new file mode 100644 index 0000000..3175669 --- /dev/null +++ b/interface/gitlink/projects/pull_request/test_edit_pull_request.yaml @@ -0,0 +1,54 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 合并请求 + case_markers: + - gitlink + - pr + - gitea + - usefixtures: get_oauth_token + - skip: 前提是有一个开启状态的PR,暂时略过 + +case_info: +- + id: gitlink_repo_edit_pull_request_001 + title: 编辑一个合并请求 + severity: + run: True + url: /api/v1/${project_url}/edit/${pr_id}.json + method: PUT + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: json + payload: + title: ${generate_words()} # 合并请求标题 + body: ${generate_paragraph()} # 合并请求内容 + head: # 源分支 + base: master # 目标分支 + is_original: false # 是否为fork仓库发来的合并请求 + fork_project_id: # fork仓库ID + merge_project_identifier: + files_count: 1 + commits_count: 1 + receivers_login: [] # @人员的login + issue_tag_ids: master # 标记ID数组 + assigned_to_id: # 指派人员ID + fixed_version_id: # 里程碑ID + priority_id: # 优先级ID + files: + assert_response: + status_code: 200 + assertStatus: + message: 断言接口返回status=0 + expect_value: 0 + assert_type: == + type_jsonpath: $.status + assertMessage: + message: 断言接口返回message + expect_value: PullRequest更新成功 + assert_type: == + type_jsonpath: $.message + assert_sql: + extract: diff --git a/interface/gitlink/projects/pull_request/test_new_pull_request.yaml b/interface/gitlink/projects/pull_request/test_new_pull_request.yaml new file mode 100644 index 0000000..475322b --- /dev/null +++ b/interface/gitlink/projects/pull_request/test_new_pull_request.yaml @@ -0,0 +1,54 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 合并请求 + case_markers: + - gitlink + - pr + - gitea + - usefixtures: get_oauth_token + - skip: 前提是仓库存在2个不同的分支,暂时略过 + +case_info: +- + id: gitlink_repo_new_pull_request_001 + title: 创建一个合并请求 + severity: + run: True + url: /api/v1/${project_url}/pulls.json + method: POST + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: json + payload: + title: ${generate_words()} # 合并请求标题 + body: ${generate_paragraph()} # 合并请求内容 + head: # 源分支 + base: master # 目标分支 + is_original: false # 是否为fork仓库发来的合并请求 + fork_project_id: # fork仓库ID + merge_project_identifier: + files_count: 1 + commits_count: 1 + receivers_login: [] # @人员的login + issue_tag_ids: master # 标记ID数组 + assigned_to_id: # 指派人员ID + fixed_version_id: # 里程碑ID + priority_id: # 优先级ID + files: + assert_response: + status_code: 200 + assertStatus: + message: 断言接口返回status=0 + expect_value: 0 + assert_type: == + type_jsonpath: $.status + assertMessage: + message: 断言接口返回message + expect_value: 响应成功 + assert_type: == + type_jsonpath: $.message + assert_sql: + extract: diff --git a/interface/gitlink/projects/pull_request/test_pr_merge.yaml b/interface/gitlink/projects/pull_request/test_pr_merge.yaml new file mode 100644 index 0000000..4dd0960 --- /dev/null +++ b/interface/gitlink/projects/pull_request/test_pr_merge.yaml @@ -0,0 +1,45 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 合并请求 + case_markers: + - gitlink + - pr + - gitea + - usefixtures: get_oauth_token + - skip: 前提是有一个开启状态的PR,暂时略过 + +case_info: +- + id: gitlink_repo_pr_merge_001 + title: 合并一个合并请求 + severity: + run: True + url: /api/v1/${project_url}/edit/${pr_id}/pr_merge.json + method: POST + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: json + payload: + project_id: ${repo_identifier} # 项目标识 + id: ${pr_id} # 合并请求id + do: merge + title: ${generate_words()} + body: ${generate_words()} + files: + assert_response: + status_code: 200 + assertStatus: + message: 断言接口返回status=0 + expect_value: 0 + assert_type: == + type_jsonpath: $.status + assertMessage: + message: 断言接口返回message + expect_value: 合并成功 + assert_type: == + type_jsonpath: $.message + assert_sql: + extract: diff --git a/interface/gitlink/projects/pull_request/test_pull_request.yaml b/interface/gitlink/projects/pull_request/test_pull_request.yaml new file mode 100644 index 0000000..2848ec2 --- /dev/null +++ b/interface/gitlink/projects/pull_request/test_pull_request.yaml @@ -0,0 +1,42 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 合并请求 + case_markers: + - gitlink + - pr + - gitea + - usefixtures: get_oauth_token + +case_info: +- + id: gitlink_repo__pull_request_001 + title: 获取合并请求列表 + severity: + run: True + url: /api/v1/${project_url}/pulls.json + method: GET + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: params + payload: + assign_user_id: # 指派人员ID + issue_tag_id: # 标记ID + keyword: # 搜索关键词 + priority_id: # 优先级ID + reviewer_id: # 审查人员ID + sort_by: # 排序字段,updated_at 更新时间 created_at 创建时间 + sort_direction: # 排序类型。desc 倒序 asc 正序 + status: # 合并请求类型,0 开启的 1 合并的 2 关闭,不传为全部 + version_id: # 里程碑ID + files: + assert_response: + status_code: 200 + assertField: + message: 断言接口存在字段total_count + expect_value: total_count + assert_type: contains + assert_sql: + extract: diff --git a/interface/gitlink/projects/pull_request/test_refuse_merge.yaml b/interface/gitlink/projects/pull_request/test_refuse_merge.yaml new file mode 100644 index 0000000..aa01c72 --- /dev/null +++ b/interface/gitlink/projects/pull_request/test_refuse_merge.yaml @@ -0,0 +1,40 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 合并请求 + case_markers: + - gitlink + - pr + - gitea + - usefixtures: get_oauth_token + - skip: 前提是有一个开启状态的PR,暂时略过 + +case_info: +- + id: gitlink_repo_refuse_merge_001 + title: 拒绝一个合并请求 + severity: + run: True + url: /api/v1/${project_url}/edit/${pr_id}/refuse_merge.json + method: POST + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: json + payload: + files: + assert_response: + status_code: 200 + assertStatus: + message: 断言接口返回status=0 + expect_value: 0 + assert_type: == + type_jsonpath: $.status + assertMessage: + message: 断言接口返回message + expect_value: 已拒绝 + assert_type: == + type_jsonpath: $.message + assert_sql: + extract: diff --git a/interface/gitlink/projects/releases/test_new_releases.yaml b/interface/gitlink/projects/releases/test_new_releases.yaml new file mode 100644 index 0000000..f9eb297 --- /dev/null +++ b/interface/gitlink/projects/releases/test_new_releases.yaml @@ -0,0 +1,46 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 发行版 + case_markers: + - gitlink + - release + - gitea + - usefixtures: get_oauth_token + +case_info: +- + id: gitlink_repo_new_release_001 + title: 创建发行版 + severity: + run: True + url: /api/${project_url}/releases.json + method: POST + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: json + payload: + tag_name: ${generate_identifier()} # 标签 + name: ${generate_words()} # 发行版标题 + body: ${generate_words()} # 发行版描述 + target_commitish: master # 分支 + draft: false # 是否为草稿 + prerelease: false # 是否为预发布版 + attachment_ids: # 附件ID数组 + files: + assert_response: + status_code: 200 + assertStatus: + message: 断言接口返回status=0 + expect_value: 0 + assert_type: == + type_jsonpath: $.status + assertMessage: + message: 断言接口返回message + expect_value: 发布成功 + assert_type: == + type_jsonpath: $.message + assert_sql: + extract: diff --git a/interface/gitlink/projects/repository/test_create_files.yaml b/interface/gitlink/projects/repository/test_create_files.yaml new file mode 100644 index 0000000..4b94659 --- /dev/null +++ b/interface/gitlink/projects/repository/test_create_files.yaml @@ -0,0 +1,71 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 代码库 + case_markers: + - gitlink + - create_files + - gitea + - usefixtures: get_oauth_token + - skip: 如何传递文件内容还未处理好,暂时略过 + +case_info: +- + id: gitlink_repo_create_files_001 + title: 代码库新建/上传文件,提交的分支是默认分支master + severity: + run: True + url: /api/${project_url}/create_file.json + method: POST + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: json + payload: + filepath: # 文件路径 + base64_filepath: + branch: master # 提交的分支, 输入不存在的分支会自动新建一个 + content: # 文件内容 + message: # commit信息 + files: + assert_response: + status_code: 200 + assertAutor: + message: 断言提交者是当前登录用户 + assert_type: == + expect_value: ${login} + type_jsonpath: $.commit.author.name + assert_sql: + extract: + + +- + id: gitlink_repo_create_files_002 + title: 代码库新建/上传文件,提交的分支是新的分支 + severity: + run: True + url: /api/${project_url}/create_file.json + method: POST + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: json + payload: + filepath: # 文件路径 + base64_filepath: + branch: master # 提交的分支, 输入不存在的分支会自动新建一个 + content: # 文件内容 + message: # commit信息 + new_branch: # 新的分支名称 + files: + assert_response: + status_code: 200 + assertAutor: + message: 断言提交者是当前登录用户 + assert_type: == + expect_value: ${login} + type_jsonpath: $.commit.author.name + assert_sql: + extract: diff --git a/interface/gitlink/projects/repository/test_project_detail_full.yaml b/interface/gitlink/projects/repository/test_project_detail_full.yaml new file mode 100644 index 0000000..11aedfe --- /dev/null +++ b/interface/gitlink/projects/repository/test_project_detail_full.yaml @@ -0,0 +1,34 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 代码库 + case_markers: + - gitlink + - project_detail + - gitea + - usefixtures: get_oauth_token + +case_info: +- + id: gitlink_repo_detail_001 + title: 项目详情 + severity: + run: True + url: /api/${project_url}/detail.json + method: GET + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: params + payload: + files: + assert_response: + status_code: 200 + assertProjectId: + message: 断言projectid + assert_type: == + expect_value: ${project_id} + type_jsonpath: $.project_id + assert_sql: + extract: diff --git a/interface/gitlink/projects/repository/test_project_detail_simple.yaml b/interface/gitlink/projects/repository/test_project_detail_simple.yaml new file mode 100644 index 0000000..b0ef5a4 --- /dev/null +++ b/interface/gitlink/projects/repository/test_project_detail_simple.yaml @@ -0,0 +1,34 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 代码库 + case_markers: + - gitlink + - project_simple + - gitea + - usefixtures: get_oauth_token + +case_info: +- + id: gitlink_repo_simple_001 + title: 项目详情(简版) + severity: + run: True + url: /api/${project_url}/simple.json + method: GET + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: params + payload: + files: + assert_response: + status_code: 200 + assertProjectId: + message: 断言projectid + assert_type: == + expect_value: ${project_id} + type_jsonpath: $.id + assert_sql: + extract: diff --git a/interface/gitlink/projects/repository/test_repo_contributors.yaml b/interface/gitlink/projects/repository/test_repo_contributors.yaml new file mode 100644 index 0000000..83b5ee3 --- /dev/null +++ b/interface/gitlink/projects/repository/test_repo_contributors.yaml @@ -0,0 +1,33 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 代码库 + case_markers: + - gitlink + - repo_contributors + - gitea + - usefixtures: get_oauth_token + +case_info: +- + id: gitlink_repo_contributors_001 + title: 获取项目贡献者列表 + severity: + run: True + url: /api/${project_url}/contributors.json + method: GET + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: params + payload: + files: + assert_response: + status_code: 200 + assertAutor: + message: 断言接口返回存在total_count字段 + assert_type: contains + expect_value: total_count + assert_sql: + extract: diff --git a/interface/gitlink/projects/repository/test_repo_entries.yaml b/interface/gitlink/projects/repository/test_repo_entries.yaml new file mode 100644 index 0000000..7f369b4 --- /dev/null +++ b/interface/gitlink/projects/repository/test_repo_entries.yaml @@ -0,0 +1,34 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 代码库 + case_markers: + - gitlink + - repo_entries + - gitea + - usefixtures: get_oauth_token + +case_info: +- + id: gitlink_repo_entries_001 + title: 获取项目代码目录 + severity: + run: True + url: /api/${project_url}/entries.json + method: GET + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: params + payload: + ref: master + files: + assert_response: + status_code: 200 + assertAutor: + message: 断言接口返回存在entries字段 + assert_type: contains + expect_value: entries + assert_sql: + extract: diff --git a/interface/gitlink/projects/repository/test_repo_sub_entries.yaml b/interface/gitlink/projects/repository/test_repo_sub_entries.yaml new file mode 100644 index 0000000..790bafd --- /dev/null +++ b/interface/gitlink/projects/repository/test_repo_sub_entries.yaml @@ -0,0 +1,37 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 代码库 + case_markers: + - gitlink + - repo_sub_entries + - gitea + - usefixtures: get_oauth_token + - skip: 这个暂时略过,后续完善 + +case_info: +- + id: gitlink_repo_sub_entries_001 + title: 获取项目代码子目录或者文件 + severity: + run: True + url: /api/${project_url}/sub_entries.json + method: GET + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: params + payload: + ref: master + filepath: + type: # 可选file或者dir + files: + assert_response: + status_code: 200 + assertAutor: + message: 断言接口返回存在entries字段 + assert_type: contains + expect_value: entries + assert_sql: + extract: diff --git a/interface/gitlink/projects/repository/test_update_files.yaml b/interface/gitlink/projects/repository/test_update_files.yaml new file mode 100644 index 0000000..78ab75f --- /dev/null +++ b/interface/gitlink/projects/repository/test_update_files.yaml @@ -0,0 +1,72 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 代码库 + case_markers: + - gitlink + - update_files + - gitea + - usefixtures: get_oauth_token + - skip: 如何传递文件内容还未处理好,暂时略过 + +case_info: +- + id: gitlink_repo_update_files_001 + title: 代码库更新文件 + severity: + run: True + url: /api/${project_url}/update_file.json + method: POST + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: json + payload: + filepath: # 文件路径 + base64_filepath: + branch: master # 提交的分支, 输入不存在的分支会自动新建一个 + content: # 文件内容 + message: # commit信息 + sha: # 要更新的文件的sha值 + files: + assert_response: + status_code: 200 + assertAutor: + message: 断言提交者是当前登录用户 + assert_type: == + expect_value: ${login} + type_jsonpath: $.commit.author.name + assert_sql: + extract: + + +- + id: gitlink_repo_create_files_002 + title: 代码库新建/上传文件,提交的分支是新的分支 + severity: + run: True + url: /api/${project_url}/create_file.json + method: POST + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: json + payload: + filepath: # 文件路径 + base64_filepath: + branch: master # 提交的分支, 输入不存在的分支会自动新建一个 + content: # 文件内容 + message: # commit信息 + new_branch: # 新的分支名称 + files: + assert_response: + status_code: 200 + assertAutor: + message: 断言提交者是当前登录用户 + assert_type: == + expect_value: ${login} + type_jsonpath: $.commit.author.name + assert_sql: + extract: diff --git a/interface/gitlink/projects/test_follow_project.yaml b/interface/gitlink/projects/test_follow_project.yaml new file mode 100644 index 0000000..5e8d29a --- /dev/null +++ b/interface/gitlink/projects/test_follow_project.yaml @@ -0,0 +1,48 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 项目 + case_markers: + - gitlink + - projects + - gitea + - follow_project + - usefixtures: get_oauth_token + - skip: 前提是有一个未关注的项目,暂时略过 + +case_info: +- + id: gitlink_projects_follow_project_01 + title: 关注项目 + severity: critical + run: True + url: /api/watchers/follow.json + method: POST + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: params + payload: + target_type: project + id: ${project_id} + files: + assert_response: + status_code: 200 + assertStatus: + message: 断言接口返回status=0 + expect_value: 0 + assert_type: == + type_jsonpath: $.status + assertMessage: + message: 断言接口返回message + expect_value: success + assert_type: == + type_jsonpath: $.message + assertPraised: + message: 断言接口返回watched=true + expect_value: true + assert_type: == + type_jsonpath: $.watched + assert_sql: + extract: \ No newline at end of file diff --git a/interface/gitlink/projects/test_fork_project.yaml b/interface/gitlink/projects/test_fork_project.yaml new file mode 100644 index 0000000..3b32f09 --- /dev/null +++ b/interface/gitlink/projects/test_fork_project.yaml @@ -0,0 +1,44 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 项目 + case_markers: + - gitlink + - projects + - gitea + - fork_project + - usefixtures: get_oauth_token + - skip: 前提是有一个未fork的项目,暂时略过 + +case_info: +- + id: gitlink_projects_fork_project_01 + title: fork项目 + severity: critical + run: True + url: /api/${project_url}/forks.json + method: POST + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: json + payload: + files: + assert_response: + status_code: 200 + assertStatus: + message: 断言接口返回status=0 + expect_value: 0 + assert_type: == + type_jsonpath: $.status + assertMessage: + message: 断言接口返回message + expect_value: fork项目成功 + assert_type: == + type_jsonpath: $.message + assert_sql: + extract: + type_jsonpath: + repo_id: $.id + repo_identifier: $.identifier \ No newline at end of file diff --git a/interface/gitlink/projects/test_like_project.yaml b/interface/gitlink/projects/test_like_project.yaml new file mode 100644 index 0000000..12da7ba --- /dev/null +++ b/interface/gitlink/projects/test_like_project.yaml @@ -0,0 +1,46 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 项目 + case_markers: + - gitlink + - projects + - gitea + - like_project + - usefixtures: get_oauth_token + - skip: 前提是有一个未点赞的项目,暂时略过 + +case_info: +- + id: gitlink_projects_like_project_01 + title: 点赞项目 + severity: critical + run: True + url: /api/projects/${project_id}/praise_tread/like.json + method: POST + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: json + payload: + files: + assert_response: + status_code: 200 + assertStatus: + message: 断言接口返回status=0 + expect_value: 0 + assert_type: == + type_jsonpath: $.status + assertMessage: + message: 断言接口返回message + expect_value: success + assert_type: == + type_jsonpath: $.message + assertPraised: + message: 断言接口返回praised=true + expect_value: true + assert_type: == + type_jsonpath: $.praised + assert_sql: + extract: diff --git a/interface/gitlink/projects/test_new_project.yaml b/interface/gitlink/projects/test_new_project.yaml index decb01a..260edf3 100644 --- a/interface/gitlink/projects/test_new_project.yaml +++ b/interface/gitlink/projects/test_new_project.yaml @@ -1,8 +1,7 @@ -# 公共参数 case_common: - allure_epic: GitLink接口 # 敏捷里面的概念,定义史诗,相当于module级的标签, 往下是 feature - allure_feature: 开源项目模块 # 功能点的描述,相当于class级的标签, 理解成模块往下是 story - allure_story: 项目 # 故事,可以理解为场景,相当于method级的标签, 往下是 title + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 项目 case_markers: - gitlink - projects @@ -11,7 +10,6 @@ case_common: - usefixtures: get_oauth_token - usefixtures: delete_project -# 用例数据 case_info: - id: gitlink_projects_new_project_01 @@ -28,7 +26,7 @@ case_info: payload: user_id: ${user_id} name: ${generate_name(lan='zh')}_${generate_identifier()} - repository_name: ${generate_identifier()} + repository_name: ${generate_identifier()}_test files: assert_response: status_code: 200 @@ -58,7 +56,7 @@ case_info: payload: user_id: ${user_id} name: ${generate_name(lan='zh')}_${generate_identifier()} - repository_name: ${generate_identifier()} + repository_name: ${generate_identifier()}_test description: private: true ignoreFlag: true @@ -107,7 +105,7 @@ case_info: payload: user_id: ${user_id} name: ${generate_name(lan='zh')}_${generate_identifier()} - repository_name: ${generate_identifier()} + repository_name: ${generate_identifier()}_test files: assert_response: status_code: 200 diff --git a/interface/gitlink/projects/test_unfollow_project.yaml b/interface/gitlink/projects/test_unfollow_project.yaml new file mode 100644 index 0000000..3cbb7a6 --- /dev/null +++ b/interface/gitlink/projects/test_unfollow_project.yaml @@ -0,0 +1,48 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 项目 + case_markers: + - gitlink + - projects + - gitea + - unfollow_project + - usefixtures: get_oauth_token + - skip: 需要有一个已关注项目,暂时掠过,后续完善 + +case_info: +- + id: gitlink_projects_unfollow_project_01 + title: 取消关注项目 + severity: critical + run: True + url: /api/watchers/unfollow.json + method: POST + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: params + payload: + target_type: project + id: ${project_id} + files: + assert_response: + status_code: 200 + assertStatus: + message: 断言接口返回status=0 + expect_value: 0 + assert_type: == + type_jsonpath: $.status + assertMessage: + message: 断言接口返回message + expect_value: success + assert_type: == + type_jsonpath: $.message + assertPraised: + message: 断言接口返回watched=false + expect_value: false + assert_type: == + type_jsonpath: $.watched + assert_sql: + extract: \ No newline at end of file diff --git a/interface/gitlink/projects/test_unlike_project.yaml b/interface/gitlink/projects/test_unlike_project.yaml new file mode 100644 index 0000000..abe90e1 --- /dev/null +++ b/interface/gitlink/projects/test_unlike_project.yaml @@ -0,0 +1,46 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 开源项目模块 + allure_story: 项目 + case_markers: + - gitlink + - projects + - gitea + - unlike_project + - usefixtures: get_oauth_token + - skip: 需要有一个已点赞项目,暂时掠过,后续完善 + +case_info: +- + id: gitlink_projects_like_project_02 + title: 取消点赞项目 + severity: critical + run: true + url: /api/projects/${project_id}/praise_tread/unlike.json + method: POST + headers: + Content-Type: application/json; charset=utf-8; + Authorization: ${token_type} ${access_token} + cookies: + request_type: json + payload: + files: + assert_response: + status_code: 200 + assertStatus: + message: 断言接口返回status=0 + expect_value: 0 + assert_type: == + type_jsonpath: $.status + assertMessage: + message: 断言接口返回message + expect_value: success + assert_type: == + type_jsonpath: $.message + assertPraised: + message: 断言接口返回praised=false + expect_value: false + assert_type: == + type_jsonpath: $.praised + assert_sql: + extract: \ No newline at end of file diff --git a/interface/gitlink/projects/test_upload_files.yaml b/interface/gitlink/projects/test_upload_files.yaml index 36d367b..cfae12f 100644 --- a/interface/gitlink/projects/test_upload_files.yaml +++ b/interface/gitlink/projects/test_upload_files.yaml @@ -1,7 +1,7 @@ # 公共参数 case_common: allure_epic: GitLink接口 - allure_feature: 上传文件模块 + allure_feature: 开源项目模块 allure_story: 上传文件 case_markers: - gitlink @@ -11,8 +11,8 @@ case_common: # 用例数据 case_info: - - id: case_upload_file_01 - title: 测试单文件上传 + id: gitlink_upload_file_01 + title: 测试文件上传 severity: run: True url: /api/attachments.json diff --git a/interface/gitlink/users/test_user_change_email.yaml b/interface/gitlink/users/test_user_change_email.yaml index 4adcbb8..d3e5d85 100644 --- a/interface/gitlink/users/test_user_change_email.yaml +++ b/interface/gitlink/users/test_user_change_email.yaml @@ -1,7 +1,7 @@ # 公共参数 case_common: allure_epic: GitLink接口 - allure_feature: 用户 + allure_feature: 用户模块 allure_story: 账号管理 case_markers: - gitlink @@ -17,7 +17,7 @@ case_info: title: 用户修改邮箱 run: True severity: normal - url: api/v1/${login}/update_email.json + url: /api/v1/${login}/update_email.json method: PATCH headers: Content-Type: application/json; charset=utf-8; diff --git a/interface/gitlink/users/test_user_change_password.yaml b/interface/gitlink/users/test_user_change_password.yaml index a77ebe2..93d39b9 100644 --- a/interface/gitlink/users/test_user_change_password.yaml +++ b/interface/gitlink/users/test_user_change_password.yaml @@ -1,7 +1,7 @@ # 公共参数 case_common: allure_epic: GitLink接口 - allure_feature: 用户 + allure_feature: 用户模块 allure_story: 账号管理 case_markers: - gitlink diff --git a/interface/gitlink/users/test_user_change_phone.yaml b/interface/gitlink/users/test_user_change_phone.yaml index de465f5..ba4356b 100644 --- a/interface/gitlink/users/test_user_change_phone.yaml +++ b/interface/gitlink/users/test_user_change_phone.yaml @@ -1,7 +1,7 @@ # 公共参数 case_common: allure_epic: GitLink接口 - allure_feature: 用户 + allure_feature: 用户模块 allure_story: 账号管理 case_markers: - gitlink @@ -16,7 +16,7 @@ case_info: title: 用户修改手机号码 run: True severity: normal - url: api/v1/${login}/update_phone.json + url: /api/v1/${login}/update_phone.json method: PATCH headers: Content-Type: application/json; charset=utf-8; diff --git a/interface/gitlink/users/test_user_register.yaml b/interface/gitlink/users/test_user_register.yaml new file mode 100644 index 0000000..2e3afdb --- /dev/null +++ b/interface/gitlink/users/test_user_register.yaml @@ -0,0 +1,55 @@ +case_common: + allure_epic: GitLink接口 + allure_feature: 用户模块 + allure_story: 登录注册 + case_markers: + - gitlink + - gitea + - register + +case_info: +- + id: gitlink_user_register_01 + title: 用户注册(邮箱注册) + run: True + severity: normal + url: /api/accounts/register.json + method: POST + headers: + Content-Type: application/json; charset=utf-8; + cookies: + request_type: json + payload: + namespace: ${generate_identifier} + login: ${generate_email()} + password: ${password} + password_confirmation: ${password} + code: ${green_code} + files: + assert_response: + status_code: 200 + assert_sql: + extract: + +- + id: gitlink_user_register_02 + title: 用户注册(手机号注册) + run: True + severity: normal + url: /api/accounts/register.json + method: POST + headers: + Content-Type: application/json; charset=utf-8; + cookies: + request_type: json + payload: + namespace: ${generate_identifier} + login: ${generate_phone(lan='zh')} + password: ${password} + password_confirmation: ${password} + code: ${green_code} + files: + assert_response: + status_code: 200 + assert_sql: + extract: \ No newline at end of file