From a0d67d0b41cf98030576a4bd674a3d19953f9d38 Mon Sep 17 00:00:00 2001 From: floraachy <1622042529@qq.com> Date: Tue, 12 Aug 2025 11:34:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=94=A8=E4=BE=8B=E6=96=87?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E5=B0=81=E8=A3=85=E7=9A=84=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9Edockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gitlink/gitlink_login_oauth_token.yaml | 70 -------- interface/gitlink/test_gitlink_login.yaml | 151 ------------------ 2 files changed, 221 deletions(-) delete mode 100644 interface/gitlink/gitlink_login_oauth_token.yaml delete mode 100644 interface/gitlink/test_gitlink_login.yaml diff --git a/interface/gitlink/gitlink_login_oauth_token.yaml b/interface/gitlink/gitlink_login_oauth_token.yaml deleted file mode 100644 index 1df1fe2..0000000 --- a/interface/gitlink/gitlink_login_oauth_token.yaml +++ /dev/null @@ -1,70 +0,0 @@ -# 公共参数 -case_common: - allure_epic: GitLink接口 - allure_feature: 用户模块 - allure_story: 登录接口 - case_markers: - - gitlink - - login: 登录接口 - -# 用例数据 -case_info: -- - id: gitlink_login_oauth_token_01 - title: 用户登录(密码模式) - run: True - severity: normal - url: /oauth/token - method: POST - headers: - Content-Type: application/json; charset=utf-8; - cookies: - request_type: json - payload: - grant_type: password - username: ${env_login} - password: ${env_password} - client_id: ${client_id} - client_secret: ${client_secret} - files: - assert_response: - status_code: 200 - access_token_in_response: - message: 断言接口返回中存在access_token字段 - expect_value: access_token - assert_type: contains - assert_sql: - extract: - type_jsonpath: - access_token: $.access_token - token_type: $.token_type - token_expires_in: $.expires_in - -- - id: gitlink_login_oauth_token_02 - title: 用户登录(客户端模式) # 这种登录方式,适用于一个application,没有账号密码的情况 - run: True - severity: normal - url: /oauth/token - method: POST - headers: - Content-Type: application/json; charset=utf-8; - cookies: - request_type: json - payload: - grant_type: client_credentials - client_id: ${client_id} - client_secret: ${client_secret} - files: - assert_response: - status_code: 200 - access_token_in_response: - message: 断言接口返回中存在access_token字段 - expect_value: access_token - assert_type: contains - assert_sql: - extract: - type_jsonpath: - access_token: $.access_token - token_type: $.token_type - token_expires_in: $.expires_in \ No newline at end of file diff --git a/interface/gitlink/test_gitlink_login.yaml b/interface/gitlink/test_gitlink_login.yaml deleted file mode 100644 index 84fcce5..0000000 --- a/interface/gitlink/test_gitlink_login.yaml +++ /dev/null @@ -1,151 +0,0 @@ -# 公共参数 -case_common: - allure_epic: GitLink接口 # 敏捷里面的概念,定义史诗,相当于module级的标签, 往下是 feature - allure_feature: 用户模块 # 功能点的描述,相当于class级的标签, 理解成模块往下是 story - allure_story: 登录接口 # 故事,可以理解为场景,相当于method级的标签, 往下是 title - case_markers: # pytest框架的标记 pytest.mark. - - gitlink - - smoke - - login: 登录接口 - -# 用例数据 -case_info: -- - id: gitlink_login_01 - title: 用户名密码正确,登录成功(不校验数据库) - run: True - severity: normal - url: /api/accounts/login.json - method: POST - headers: - Content-Type: application/json; charset=utf-8; - cookies: - request_type: json - payload: - login: ${env_login} - password: ${aes_encrypt_data('${env_password}','${ace_key}')} - autologin: 1 - files: - assert_response: - status_code: 200 - assertLogin: - message: 断言接口返回的login - expect_value: ${env_login} - assert_type: == - type_jsonpath: $.login - assert_sql: - extract: - type_re: - nickname: \"username":"(.*?)" - login: \"login":"(.*?)" - user_id: \"user_id":(.*?), - type_response: - cookies: response.cookies - -- - id: gitlink_login_02 - title: 用户名密码正确,登录成功(校验数据库) - run: false - severity: minor - url: /api/accounts/login.json - method: POST - headers: - Content-Type: application/json; charset=utf-8; - cookies: - request_type: json - payload: - login: ${env_login} - password: ${aes_encrypt_data('${env_password}','${ace_key}')} - autologin: 1 - files: - assert_response: - status_code: 200 - user_id: - expect_value: ${user_id} - assert_type: == - type_jsonpath: $.user_id - login: - message: 断言接口返回的login - expect_value: ${env_login} - assert_type: == - type_jsonpath: $.login - assert_sql: - contains_user: - message: 断言数据库:查询tokens表,表中存在该登录用户记录;预期查询结果的长度为1 - sql: select * from tokens where user_id=${user_id}; - expect_value: 1 - assert_type: len_eq - contains_user2: - message: 断言数据库:查询tokens表,表中存在该登录用户记录;预期 ${user_id} in 查询结果(jsonpath式匹配后的结果) - sql: select * from tokens where user_id=${user_id}; - type_jsonpath: $..user_id - expect_value: ${env_user_id} - assert_type: == - contains_user3: - message: 断言数据库:查询tokens表,表中存在该登录用户记录;预期 ${user_id} in 查询结果(正则表达式匹配后的结果) - sql: select * from tokens; - type_re: "'user_id': (.*?)," - expect_value: ${user_id} - assert_type: contains - extract: - type_jsonpath: - nickname: $.username - login: $.login - user_id: $.user_id - -- - id: gitlink_login_03 - title: 用户名正确,密码错误,登录失败 - severity: critical - run: true - url: /api/accounts/login.json - method: POST - headers: - Content-Type: application/json; charset=utf-8; - cookies: - request_type: json - payload: - login: ${env_login} - password: 12345678900 - autologin: 1 - files: - assert_response: - status_code: 200 - user_id: - message: 断言接口返回的status - expect_value: -1 - assert_type: == - type_jsonpath: $.status - assert_sql: - extract: - -- - id: gitlink_super_login_04 - title: 用户名密码正确,登录成功(管理员登录) - run: False - severity: normal - url: /api/accounts/login.json - method: POST - headers: - Content-Type: application/json; charset=utf-8; - cookies: - request_type: json - payload: - login: ${env_super_login} - password: ${aes_encrypt_data('${env_super_password}','${ace_key}')} - autologin: 1 - files: - assert_response: - status_code: 200 - assertLogin: - message: 断言接口返回的login - expect_value: ${env_super_login} - assert_type: == - type_jsonpath: $.login - assert_sql: - extract: - response: - type_response: - admin_cookies: response.cookies - type_jsonpath: - user_id: $.user_id