This is the 28th day of my participation in the November Gwen Challenge. Check out the event details: The last Gwen Challenge 2021

Hello ~ I’m Milo! I am building an open source interface testing platform from 0 to 1, and I am also writing a complete tutorial corresponding to it. I hope you can support it. Welcome to pay attention to my public number test development pit goods, get the latest article tutorial!

review

In the last video, we did the mail notification, which is kind of the watershed. So far, our missions have had a relatively smooth ending, from additions to builds to notifications.

A new journey

With the prospect of becoming a dad next year, there won’t be a lot of free time to roll.

So before we do that, we’re going to build some features and implement them over the next few months as we like.

  • Case operation log function ⭐⭐⭐⭐

    Records changes related to use cases, including additions, updates, and deletions.

  • Modify the post-configuration conditions ⭐⭐⭐⭐⭐

    We haven’t done the post-condition yet, so this is an important problem.

  • Refactoring use case add/write page ⭐⭐⭐

  • Through httprunner ⭐ ⭐ ⭐ ⭐

    Httprunner yamL data can be imported, the export is temporary

  • Python scripts can be written as prerequisites ⭐⭐⭐⭐⭐

  • Complete the data factory function ⭐⭐⭐⭐

  • The statistics page ⭐ ⭐ ⭐ ⭐

    This is important, use case data, execution data, automation rate, etc.

  • The workbench ⭐ ⭐ ⭐

    You can get a lot done quickly with a good workbench.

  • Call yAPI ⭐⭐⭐⭐⭐

    As an interface automation test platform, nothing can be done without the interface. Most companies use YAPI, if not rap2 or Swagger files need to be supported.

  • Use case evaluation system ⭐⭐⭐⭐

    This system is needed to improve the authoring quality of use cases.

  • Oss system ⭐ ⭐ ⭐ ⭐

    Need to support the mainstream Ali cloud SDK, qiuniuyun SDK, Tencent cloud SDK. The purpose is to be able to support file upload type cases.

  • Other communication protocol interfaces such as GRPC and Dubbo ⭐⭐⭐⭐

    This is also important, because if you only support HTTP, it’s relatively useless.

  • User management function ⭐⭐⭐⭐

    In fact, compared chicken ribs, you can do a simple point, you can disable users so it is ok. Because the company is generally Intranet system, if the person left the login can not come in.

  • Through the CI

    Since the distribution system composition of each company is different, we can provide OpenAPI for them to execute our case according to app_id or Git address if they have such requirements.

  • Run the test plan online ⭐⭐⭐⭐ service

  • Online debugging example ⭐⭐⭐⭐ service

  • User profile Settings ⭐⭐


This is only part of the content, and it will take some time to perfect it. But the good news is there’s still a long time to go, so let’s work on it.

Execute test plan

Let’s take a look at the original test plan execution functionality:

You can see that the core method is already there; we just need to write the interface for it.

@router.get("/plan/execute")
async def run_test_plan(id: int, user_info=Depends(Permission(Config.MEMBER))) :
    try:
        await Executor.run_test_plan(id, user_info['id'])
        return PityResponse.success()
    except Exception as e:
        return PityResponse.failed(str(e))
Copy the code

In the app/routers/testcase testplan. Py, combined with the above method, pay attention to the permissions here we make a little some replacement:

GUEST is replaced by MEMBER, which is more semantically appropriate.

Modify the front

We will add an execute button in the middle, and after the execution, a dialog box will pop up asking the other party whether they want to jump to the report link.

  • SRC/pages/ApiTest TestPlan. JSX new onExecute method

After the test report is executed, check whether the report page is displayed.

  • The Table operation field is addedrunbutton

  • SRC /models/testplan.js Added the executeTestPlan method

  • SRC /services/testplan.js Added the executeTestPlan method

See the effect

Execute, then wait to jump to the report link.

You can see that the executor in the email has also been changed.

Modify the report page

The report page is not currently marked with a test plan, so we need to give it a hint.

The page is not enough, let’s modify the Table component.

Since it has the mode attribute, we can use this to determine the type. In fact, this has a disadvantage, although the test plan, but does not show the name of the test plan.

I’ll leave that to the next section

In the next section, we write ali Cloud OSS client to complete CRUD function.