A true automation framework for the enterprise? How the senior 8-year test was designed and implemented...


foreword

What is a framework?

Specifically refers to a support structure with certain constraints designed to solve an open problem. Based on this structure, more components can be expanded and inserted according to specific problems, so as to construct a complete problem-solving solution more quickly and conveniently.

A framework is a reusable design of an entire or part of a system, represented as a set of abstract components and methods of interaction between component instances. That is to say, the framework itself does not solve specific problems, it solves problems by extending various components or tools, and it can easily add or modify the functions of some components.

What is an automated testing framework?

What is an automated testing framework? If we look at it separately, there are actually three aspects, automation, testing, and framework. What is a framework is mentioned above, and it can execute tests, and it is still automated. Therefore, each component of the framework The main function is around how to automate how to execute the test.

Here we can call each function of the framework a module. Let’s take a look at those modules that are needed. We need a basic module, mainly how to implement scripting and management modules. The main behaviors are continuous integration, timing execution, case management, and statistics. The module is mainly to send test reports and statistical analysis.

The definition of an automated testing framework is to pack some functions or tools used in the automated testing process into individual modules, including how to write automated scripts and the basic modules of layered functions.

A management module for continuous integration and timed tasks, a statistical module for sending test reports, and statistical analysis of test results, etc. These modules form a set of reusable skeletons.

Design principles for automated testing frameworks

Versatility: Can be used on a variety of systems and platforms

Ease of maintenance: we can independently maintain our data, use cases, and framework implementations, and can quickly define the point of maintenance during the process of achieving perfection without affecting other functions of the framework

Timing processing: It can be executed at a specified time
Continuous integration: It can be automatically executed when the program under test and the test code are updated
Debugging: Debugging can be performed
Test results: Test reports, statistical analysis of test data

Framework Design Ideas

The main body of the automated testing framework can be divided into two parts, one is the internal framework and the other is the external framework. The internal framework is the test framework code implemented by ourselves, and the external framework is the core code that we have implemented. To achieve the design principle of the automated testing framework Some third-party tools used for some content.

External framework:
mainly refers to webdriver as the core, supplemented by external third-party frameworks and tools. It is used to realize functional frameworks such as continuous integration, automatic deployment, script execution, remote invocation, report optimization, mail sending guide, etc., and realize some peripheral components of the automation framework design principles.

Internal framework:
that is, a layered framework, the purpose is to better optimize and manage test cases, more conveniently maintain data, elements, and scripts, and create new scripts more quickly.

Automated testing framework design ideas

Common external framework implementation logic:
maven or tox-automatically compile, execute TestNG or junit, integrate email sending, etc.;

TestNG or Junit, pytest, call webdriver or send request methods, execute automated test cases, and standardize automated test scripts;

selenium script or interface use case script;
reportNG or allure report optimization template;
main automatically sends emails with html email notification or Jenkins;

internal frame

Layer frame framework - that is, code structure optimization, can be roughly divided into the following layers according to specific business and needs, sometimes you don't need all the layers below, just choose the one that suits your business test.

TestCase layer, the executed use case script

Task layer, public service subpackage, is not needed by other projects, and only related to the current project, such as public login, search and other services

Utils layer: methods that have nothing to do with business, such as data-driven - that is, data file reading and writing, browser operations, element positioning methods, etc. are encapsulated

page layer or po layer: page layer, the page layer mainly maintains all the elements of a certain page, the operation of the page, the operation of the elements and the interaction with other pages, the business is actually one element to another element or one page to another A page, which is a bit repetitive with the task layer. Generally, there is only one page.

element layer: maintenance of public elements or components, or custom component packaging;
data layer: data storage;
properties layer: configuration files, global variables;

Commonly used automated testing frameworks

Interface automation testing direction: Python+requests+pytest+yaml+alluer+Jenkins;
web automation testing direction: Python+selenium4+pytest+POM+allure+Jenkins;
app automation testing direction: Python+appium+POM+pytest+allure+Jenkins ;

The following is the most complete software test engineer learning knowledge architecture system diagram in 2023 that I compiled

1. From entry to mastery of Python programming

Please add a picture description

2. Interface automation project actual combat

Please add a picture description

3. Actual Combat of Web Automation Project

Please add a picture description

4. Actual Combat of App Automation Project

Please add a picture description

5. Resume of first-tier manufacturers

Please add a picture description

6. Test and develop DevOps system

Please add a picture description

7. Commonly used automated testing tools

Please add a picture description

Eight, JMeter performance test

Please add a picture description

9. Summary (little surprise at the end)

Struggle is a burning flame, always driving forward. Facing challenges bravely and persisting in the pursuit of excellence can we surpass ourselves and create infinite possibilities. Believe in your potential, work hard, and you will eventually embark on your own glorious road!

Go forward bravely, without fear of adversity, struggle is the power to write brilliance. Dreams are like stars, and only hard work can touch them. Persevere in the pursuit and be unyielding, and you will finally open the prelude to the glory of life!

Dreams are like raging fire, and struggle is the power to burn. Responsibility and mission create the heart of a brave man, hard work and persistence shape the road to victory. Only by letting go of the wings of your soul and breaking through the shackles can you bloom the glory of life and write your own immortal legend!

Guess you like

Origin blog.csdn.net/csdnchengxi/article/details/132084644