Now it is time to test the webview in native. For example, I want to test a component for selecting a city: The main idea is to simulate a series of user operations and then see whether the test results are consistent with expectations. First, check the corresponding DOM node through the console, obtain the corresponding DOM element through the API provided by macaca, and then trigger user operations. The following is still done in the REPL environment:
Figure 1: Figure 2:
Figure 3: Figure 4: Figure ⑤: Figure 6:
You can see that the current function is executed as we expected. Now let me test another situation: If you select a province and region but not a city, a pop-up window will appear.
Figure 7: Figure ⑧: At this time, the function is also running as expected. Of course, you also need to add assertion-related content to the test script, which is also relatively easy. I also encountered many problems when writing the webview test script. For example, native restricted the input[type="file"] component that calls native to upload files for security reasons. Some sliding operations were difficult to test, etc. Take your time. |
<<: Using macaca for mobile hybrid automation testing (Part 3)
Previously, Apple was heavily criticized by iPhon...
What new stories can range hoods tell? There is a...
How much does it cost to attract investment for t...
Physical examination is an important channel for ...
Recently, a piece of news about "releasing s...
As a rising star of Toutiao, advertisers certainl...
How much does it cost to join the Shuozhou Men’s ...
In the increasingly competitive thousand-yuan smar...
What are the criteria for a good title ? This is ...
The Secret of Zhongtian Feng Shui PDF, written by...
On September 27, the Circular Array Solar Radio I...
The author uses a real case to explain how to bui...
How many times a night do you do this? When I was...
Capture SSS-level Lingkun at the beginning, 5th t...
At around 11 a.m. on September 4, this year's...