Some basic concepts and contents: Unit Tests: Test your code as a module to ensure that the module you wrote is logically correct. As long as the input value does not change, the output value should not change. Front-end automated testing:
The main content of this article focuses on interface regression testing and functional testing. These two parts of testing work are to simulate user page operations and check whether the functions are running normally by checking the changes in page status: its testing process is:
How to do front-end UI automation testing To complete front-end UI automation testing, you need at least a test framework and an assertion library. Tool selection Headless interface:
UI Testing nightwatch (simple syntax to quickly get started with the powerful Selenium WebDriver API to execute commands and assertions on DOM elements)
nightmare.js is a set of high-level APIs (very semantic: click, refresh, goto...) encapsulated for testing based on phatomJS. At the same time, nightmare is also based on electron, so it also provides GUI interface tools. When you use nightmare.js for automated testing, you can see all the simulated user actions.
Testing Framework The function of the test framework is to run the script tool written by the test developer. The test framework will capture the AssertionError thrown by the code and output it in the console or web page. The test framework provides specific test syntax, which is generally divided into two categories: TDD (test-driven development) and BDD (behavior-driven development). The test framework usually provides TDD (test-driven development) or BDD (behavior-driven development) test syntax to write test cases. TDD: means writing the test code first, and then writing the code based on the test. Its steps are generally:
BDD: Don’t test code details, but test behavior The most commonly used testing frameworks are:
Assertion Library The purpose of an assertion is to determine whether the actual execution result of the source code is the same as the expected result. If not, an error is thrown.
chai.js provides three assertion styles: assert, expect, and should. You can choose the assertion style according to your preference. For specific APIs, please refer to the relevant documentation. Using the above tools, you can basically start testing the test scripts. The following article will introduce how to use macaca to test hybrid applications. |
<<: 7 Linux command line tools you may never have heard of but are extremely useful
>>: Using macaca for mobile hybrid automation testing (Part 2)
Appointment arrangements for the Chengdu tea drin...
Cold and windy weather Down jackets have excellen...
[[127178]] Produced by GitHuber.info team Preface...
As a self-media , one of the ways to monetize is ...
[[150631]] With the continuous development of the...
Industry: Tourism industry Business products: Tou...
When the haze season comes every year, air purifi...
Recently, Apple released a series of papers to ex...
How much does it cost to customize a nail art app...
Kaola.com was founded in 2015 and was originally ...
Where is it easy to be struck by lightning? How t...
Opening up a new model for Sino-US Internet coope...
On November 1, Daxiang Media invited Teacher Wu t...
In marketing psychology, herd mentality, greed fo...
Anyone who has seen the movie "Prometheus&qu...