Skip to main content

Description

框架简介: Gastepo ~ 基于Schema DSL语法规约的接口自动化测试框架

测试类型: 接口自动化测试


Feature

  • 开发语言:Python 3.7
  • 开发环境:PyCharm
  • 开发工具:
    • 测试框架:Pytest
    • 测试报告:Allure
    • 数据处理:Pandas
    • 请求工具:Requests
    • 响应获取:JsonPath
    • 断言工具:Hamcrest
    • 单元测试:Unittest、Coverage
    • 代码扫描:SonarQube
    • Web服务:Flask、FastApi
    • 部署方式:Docker、Jenkins

Framework

Framework.png

Schema

  • Dependency Schema
[
    {
        "GET /v3_0/userInfo/searchContactUsers": {
            "to_path": {},
            "to_header": {},
            "to_param": {},
            "to_data": {
                "$['idCardNo']": {
                  	"GET /v3_0/getCardId": {
                      	"response": {
                          	"data": "$.data.cardId"
                        }
                    }
                }
            }
        }
    }
]
  • Assertion Schema
[
    {
        "actual": "$.data[:].cardId",
        "expect": [
          {
            "${fetchCardId(user)}": {
              "user": {
                "GET /v3_0/getUserName": {
                  	"response": {
                      	"data": "$.userName"
                    }
                }
              }
            }
          }
        ],
        "matcher": "has_item",
        "alert": "未发现指定用户标签ID",
        "multi": false
    }
]

Test Runner

[pytest]
addopts = -s -q --alluredir=./Common/Static/Result/Allure --disable-warnings
testpaths = ./Executor/Mente
python_files = *Runner.py
python_classes = Test*
python_functions = test*
  • Automation Runtime
    • Step_1:自动分析指定扫描文件夹中所有Postman接口集合并聚合生成表格用例文件。
    • Step_2:自动化测试用例支持用例筛选及BDD方式执行,单条用例支持激活或禁用。
    • Step_3:自动化测试用例使用Dependency Schema规约结构的接口请求数据依赖。
    • Step_4:自动化测试用例使用Assertion Schema规约结构的接口信息高级断言。
    • Step_5:自动化测试运行支持前置清空历史测试数据,包括测试结果、用例结果等。
    • Step_6:自动化测试运行的所有接口通过dispatch路由分发,可自动识别请求信息并注入依赖数据。
    • Step_7:自动化测试报告使用Allure,并支持表格用例自动更新、接口信息实时录制、报告实时截图。
    • Step_8:自动化测试推送通知方式支持传统邮件推送和钉钉机器人消息提醒。
    • Step_9:自动化测试部署方式支持Jenkins流水线及Docker容器托管运行方式。

Test Reporter

allure generate {json测试结果目录} -o {html测试报告目录} --clean
  • Allure Test Report

Gastepo


Test Deployment

  • Docker Container
docker run -itd --name gastepo -p 端口号 -v {配置文件映射卷} -v {数据文件映射卷} automation/gastepo
  • Jenkins Pipeline
pipeline {
    agent any
    options {
        可选项配置
    }
    stages {
         stage("Pull From GitLab") {
        		拉取指定Git分支源码
        }
        stage("Set PATH") {
            设置Python3依赖信息
        }
        stage("Run Test") {
            执行自动化测试
        }
        stage("Generate Report") {
            报告生成及结果推送
    }
    post {
        success {
            println "[Done]: Gastepo Test Done"
        }
    }
}

Wiki:

Get me on GitHub


Measure

警报SQALE评级覆盖率

Metadata

Release files for gastepo 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gastepo 0.0.2
File Size Uploaded Provenance Actions
Gastepo-0.0.2.tar.gz 383.7 kB Without provenance Details for Gastepo-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gastepo 0.0.2
File Interpreter ABI Platform Actions
Gastepo-0.0.2-py3-none-any.whl Python 3 none any Details for Gastepo-0.0.2-py3-none-any.whl

Total release size: 678.1 kB

Release files / Gastepo-0.0.2.tar.gz

Download URL Gastepo-0.0.2.tar.gz
Size 383.7 kB
Tags Source
SHA-256 checksum
How to use checksums
debaac77fa6b378e6e81c8d6a5dc186e06f1eb9ca3acf702368ec4cd83357d08
BLAKE2b-256 checksum
How to use checksums
7cdaeca7e08f36fa4f1e166966a75725041dc989129f5f91820f526503baef2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.7.4 Darwin/18.6.0

Release files / Gastepo-0.0.2-py3-none-any.whl

Download URL Gastepo-0.0.2-py3-none-any.whl
Size 294.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23f6f1a5774273b07c6ce5e0472377266b5e59111c98783fcabdf9aea85f6894
BLAKE2b-256 checksum
How to use checksums
4bccecbbd97c37e4939516ef655ade7be433eddf95d9a71c5ab75a42c14957ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.7.4 Darwin/18.6.0

Security for gastepo 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page