Test method, device and equipment of target program and storage medium
Patent Information
- Application Number
- CN202111424326.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2041-11-26
AI Technical Summary
[0004]上述测试方法需要在真实的终端上进行,不仅操作步骤比较繁琐,而且依赖于终端上的朗读功能,测试效率较低
[0031] By adding an accessibility mode to the simulator, design information related to accessibility is displayed visually on the simulator's user interface. This allows for direct, visual accessibility testing on the simulator, eliminating the need to run the target program on a real user terminal. This saves a significant number of testing steps and improves testing efficiency.
Smart Images

Figure CN116185808B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software testing, and in particular to a method, apparatus, device, and storage medium for testing a target program. Background Technology
[0002] In internet products, accessibility design primarily refers to the accessibility of those products. Accessibility design ensures that the content of an internet product can be directly or indirectly recognized, understood, and interacted with by users. For example, enabling blind people to use touch-based applications normally.
[0003] Taking the development of a mini-program as an example, developers can use the preview function of the developer tools to preview the mini-program on a real client. Then, after enabling the accessibility mode on the client, they can actually test the accessibility features of each component element in the mini-program. For example, on Apple's iOS operating system, developers can enable screen reader mode by going to Settings -> General -> Accessibility -> Voiceover. When a component is focused on, the information carried in the Accessible Rich Internet Applications (ARIA) tag will be read aloud.
[0004] The above testing method needs to be performed on a real terminal, which is not only cumbersome in terms of operation steps, but also relies on the reading function of the terminal, resulting in low testing efficiency. Summary of the Invention
[0005] This application provides a method, apparatus, device, and storage medium for testing a target program. The technical solution is as follows:
[0006] According to one aspect of this application, a method for testing a target program is provided, the method comprising:
[0007] The user interface of the simulator is displayed, the simulator is loaded with the target program, and the user interface displays the program page of the target program;
[0008] In response to the activation operation of the accessibility mode, the accessibility mode is enabled in the simulator;
[0009] In the accessibility mode, accessibility design information is displayed on page elements in the program page of the target program.
[0010] According to one aspect of this application, a testing apparatus for an object program is provided, the apparatus comprising:
[0011] The display module is used to display the user interface of the simulator, the simulator is loaded with the target program, and the user interface displays the program page of the target program;
[0012] A human-computer interaction module is used to enable the accessibility mode in the simulator in response to the activation operation of the accessibility mode;
[0013] An accessibility testing module is used to display accessibility design information on page elements in the program page of the target program in the accessibility access mode.
[0014] In one possible design, the accessibility range information includes: accessibility reading information; the display module is used to display a function bar of the accessibility mode on the user interface of the simulator, the function bar including a first trigger control; the accessibility testing module is used to display the accessibility reading information on page elements in the program page of the target program in response to a trigger operation on the first trigger control.
[0015] In one possible design, the program page includes at least one page element with read-aloud information;
[0016] The accessibility testing module is used to respond to the trigger operation on the first trigger control and display a first annotation box on all or part of the page elements in the program page of the target program, and the first annotation box displays the reading information of the page element.
[0017] In one possible design, the accessibility testing module is configured to, in response to a trigger operation on the first trigger control, read the ARIA tag of each page element in the program page of the target program, wherein the ARIA tag records the reading information of the page element; and display the first annotation box on each page element based on the ARIA tag of each page element.
[0018] In one possible design, the accessibility information for the accessible range includes: information on the operable areas for accessible access;
[0019] The display module is used to display the function bar of the accessibility mode on the user interface of the simulator, the function bar including a second trigger control; the accessibility testing module is used to display the operable area information of the accessibility mode on the page elements in the program page of the target program in response to the trigger operation on the second trigger control.
[0020] In one possible design, the program page includes at least one page element that supports human-computer interaction.
[0021] The accessibility testing module is used to respond to the trigger operation on the second trigger control and display a second annotation box on all or part of the page elements in the program page of the target program. The second annotation box displays the operable area information of the page element.
[0022] In one possible design, the accessibility testing module is configured to, in response to a trigger operation on the second trigger control, read each page element in the program page of the target program that is bound to an operable element, and the operable area information of each page element; and, based on the operable area information of each page element, display the second annotation box on each page element.
[0023] In one possible design, the display module is used to display the accessibility mode function bar on the simulator's user interface, the function bar including a first trigger control and a second trigger control;
[0024] The accessibility testing module is used to respond to the triggering operations on the first trigger control and the second trigger control, and to display a mixed annotation box on the page elements in the program page of the target program. The mixed annotation box displays the operable area information and reading information of the accessibility access.
[0025] In one possible design, the accessibility testing module is configured to inject a script from the simulator plugin into the rendering layer code of the target program in response to the activation of the accessibility mode, wherein the simulator plugin provides the functionality of the accessibility mode; after injecting the script, the program page of the target program is re-rendered.
[0026] In one possible design, the target program includes at least one of a web application and a mini-program, wherein the mini-program is a program that depends on the host application to run.
[0027] According to one aspect of this application, a computer device is provided, the computer device comprising: a processor and a memory, the memory storing a computer program, the computer program being executed by the processor to cause the computer device to implement a test method for the target program as described above.
[0028] According to another aspect of this application, a computer-readable storage medium is provided, the storage medium storing a computer program, the computer program being executed by a processor to implement a test method for the target program as described above.
[0029] According to another aspect of this application, a computer program product is provided, the computer program product storing a computer program, the computer program being executed by a processor to implement the test method of the target program as described above.
[0030] The beneficial effects of the technical solutions provided in this application include at least the following:
[0031] By adding an accessibility mode to the simulator, design information related to accessibility is displayed visually on the simulator's user interface. This allows for direct, visual accessibility testing on the simulator, eliminating the need to run the target program on a real user terminal. This saves a significant number of testing steps and improves testing efficiency. Attached Figure Description
[0032] Figure 1 This application shows a structural block diagram of a computer system provided in an exemplary embodiment;
[0033] Figure 2 This illustration shows a schematic diagram of the structure of the host program and applet provided in an exemplary embodiment of this application;
[0034] Figure 3 A flowchart illustrating a testing method for a target program provided in an exemplary embodiment of this application is shown;
[0035] Figure 4 A schematic diagram of the interface for an accessible access mode provided in an exemplary embodiment of this application is shown.
[0036] Figure 5 A flowchart illustrating a testing method for a target program provided in an exemplary embodiment of this application is shown;
[0037] Figure 6 A schematic diagram of the interface for an accessible access mode provided in an exemplary embodiment of this application is shown.
[0038] Figure 7 A schematic diagram of the interface for an accessible access mode provided in an exemplary embodiment of this application is shown.
[0039] Figure 8 A schematic diagram of the interface for an accessible access mode provided in an exemplary embodiment of this application is shown.
[0040] Figure 9 A schematic diagram of the interface for an accessible access mode provided in an exemplary embodiment of this application is shown.
[0041] Figure 10 A flowchart illustrating a testing method for a target program provided in an exemplary embodiment of this application is shown;
[0042] Figure 11 This illustration shows a script insertion diagram of an accessibility mode plugin provided in an exemplary embodiment of this application;
[0043] Figure 12 A timing diagram illustrating a testing method for a target program provided in an exemplary embodiment of this application is shown.
[0044] Figure 13 A block diagram of a test apparatus for a target program provided in an exemplary embodiment of this application is shown;
[0045] Figure 14 A block diagram of a computer device provided in an exemplary embodiment of this application is shown. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0047] Figure 1 A structural block diagram of a computer system 100 provided in an exemplary embodiment of this application is shown. The computer system 100 includes a terminal 120 and a server cluster 140.
[0048] Terminal 120 can be a mobile phone, tablet computer, e-book reader, MP3 (Moving Picture Experts Group Audio Layer III) player, MP4 (Moving Picture Experts Group Audio Layer IV) player, laptop computer, desktop computer, etc. Terminal 120 is used to develop, compile, and test target programs. Target programs are applications developed based on Hyper Text Markup Language (HTML). Illustratively, target programs include web applications and applets. Web applications are applications that run in a traditional browser, while applets are applications that rely on a runtime environment provided by the host program. The host program provides a web-based runtime environment for the applets, enabling the applets to load and run within that environment. Optionally, a simulator for the target program runs on terminal 120, which simulates the runtime environment for the target program.
[0049] Terminal 120 is connected to server cluster 140 via a wired or wireless network.
[0050] Server cluster 140 can be any of multiple servers, virtual cloud storage, or cloud computing centers. Server cluster 140 provides background services for pre-defined applications, host programs, and applets on terminal 120. Server cluster 140 has data storage capabilities. Optionally, server cluster 140 includes: host program server 142 and applet server 144. Wherein:
[0051] The host program server 142 is used to provide background services for the host program in the terminal 120.
[0052] Mini Program Server 144 is used to provide background services for the mini programs in Terminal 120.
[0053] This embodiment illustrates the case of server cluster 140 comprising two servers. However, server cluster 140 may include more or fewer than two servers. For example, server cluster 140 may be implemented by multiple virtual machines on a single server, or by dozens of servers. This embodiment does not limit this to any particular type.
[0054] In an illustrative example, terminal 120 includes an operating system 161, a host program 162, and applets. (Refer to reference...) Figure 2 Terminal 120 runs operating system 161, and host program 162 runs on operating system 161, providing an environment for the mini-program to run. Terminal 120 can create a mini-program logic layer unit 164b and a corresponding mini-program rendering layer unit 164a to implement the mini-program, based on the mini-program's package. Mini-program logic layer unit 164b can be used to execute page logic code in the package, and mini-program rendering layer unit 164a can be used to execute page structure code and page style code in the package. The page logic code, page structure code, and page style code in the package can be collectively referred to as page code.
[0055] Operating system 161 is a computer program that manages and controls the hardware and software resources in terminal 120. It is the most basic system software that runs directly on the bare metal of terminal 120, and applications need the support of operating system 161 to run. Operating system 161 can be a desktop operating system such as Windows, Linux, or Mac OS, or a mobile operating system such as iOS or Android.
[0056] The host program 162 is the application that hosts the mini-program, providing the environment for its implementation. The host program 162 is a native application. A native application is an application that can run directly on the operating system 161. The host program 162 can be a social application, a dedicated application supporting mini-programs, a file management application, an email application, or a game application, etc. Social applications include instant messaging applications, SNS (Social Network Service) applications, or live streaming applications, etc. The mini-program is an application that can run in the environment provided by the host program. Specifically, a mini-program can be a social application, a file management application, an email application, or a game application, etc.
[0057] The mini-program logic layer unit 164b and the corresponding mini-program rendering layer (also known as the view layer) unit 164a are used to implement a mini-program instance. A mini-program can be implemented by a mini-program logic layer unit 164b and at least one mini-program rendering layer unit 164a. The mini-program rendering layer unit 164a and the mini-program page can have a one-to-one correspondence.
[0058] The mini-program rendering layer unit 164a is used to organize and render the mini-program's view. The mini-program logic layer unit 164b is used to handle the data processing logic of the mini-program and its corresponding pages. Each unit can be a process or a thread; the mini-program rendering layer unit 164a can function as a mini-program rendering layer thread, and the mini-program logic layer unit 164b can function as a mini-program logic layer thread. The mini-program logic layer unit 164b can run in a virtual machine. The mini-program rendering layer unit 164a and the mini-program logic layer unit 164b can communicate via the host program's native unit 162a. The host program's native unit 162a is the interface between the host program 162 and the mini-program, and it can be a thread or process of the host program 162 itself. The page logic code belonging to the program package for each mini-program page can be registered by the mini-program logic layer unit 164b at startup, and the registered page logic code will be executed when data processing is required.
[0059] Alternatively, in a development environment, the host program described above can be replaced by a developer tool, such as a compiler or simulator. This developer tool provides the runtime environment for the target program.
[0060] Figure 3 A flowchart illustrating a testing method for a target program provided in an exemplary embodiment of this application is shown. This method, which can be applied in a terminal, includes:
[0061] Step 302: Display the emulator's user interface. The emulator has the target program loaded, and the user interface displays the program page containing the target program.
[0062] An emulator is a program tool used to simulate the running of a target program. For example, an emulator can be a standalone program, or it can be a feature within a developer tool.
[0063] As an example, the developer tools offer features such as a simulator, editor, debugger, visualization, and cloud development. Developers enable the simulator within the developer tools and use it to load the target application.
[0064] The terminal displays the emulator's user interface. The emulator has the target program loaded, and the user interface displays the target program's page. This is illustrative; the page is rendered based on the target program's rendering layer code.
[0065] Step 304: In response to the accessibility mode enable operation, enable accessibility mode in the simulator;
[0066] The emulator offers an accessibility mode, which simulates the way target programs run after the operating system has enabled accessibility mode. This accessibility mode can also be called: accessibility mode, accessibility debugging mode, etc.
[0067] The simulator's user interface displays trigger points for accessibility mode, which can be found in the menu bar, function buttons, gesture trigger points, etc. (Refer to the reference.) Figure 4 The emulator's user interface provides a menu bar 40. The menu items in the menu bar 40 include mini-program simulation 42, plug-in mode 44, and accessibility mode 46.
[0068] The enabled actions include, but are not limited to: single-click, double-click, swipe, gesture, motion control, pressure-sensitive touch, and eye-tracking.
[0069] As an illustration, the user enables accessibility mode in the simulator after clicking accessibility mode 46.
[0070] Step 306: In accessibility mode, display accessibility design information on page elements in the target program's program page.
[0071] Illustrative design information for accessibility includes: information on accessible and operable areas and accessible reading information.
[0072] Accessible accessibility information indicates the operable area on the program page for each page element that can respond to human-computer interaction in accessibility mode.
[0073] Accessibility reading information indicates that in accessibility mode, page elements will trigger the reading of voice information after receiving human-computer interaction operations.
[0074] In summary, the method provided in this embodiment, by adding an accessibility mode to the simulator, displays relevant accessibility design information as visual information on the simulator's user interface. This allows for direct visualization testing of accessibility on the simulator, eliminating the need to run the target program on a real user terminal, thus saving significant testing steps and improving testing efficiency.
[0075] Figure 5 A flowchart illustrating a testing method for a target program provided in an exemplary embodiment of this application is shown. This method, which can be applied in a terminal, includes:
[0076] Step 402: Display the emulator's user interface. The emulator has the target program loaded, and the user interface displays the program page containing the target program.
[0077] An emulator is a program tool used to simulate the running of a target program. For example, an emulator can be a standalone program, or it can be a feature within a developer tool.
[0078] As an example, the developer tools offer features such as a simulator, editor, debugger, visualization, and cloud development. Developers enable the simulator within the developer tools and use it to load the target application.
[0079] The terminal displays the emulator's user interface. The emulator has the target program loaded, and the user interface displays the target program's page. This is illustrative; the page is rendered based on the target program's rendering layer code.
[0080] Step 404: In response to the accessibility mode enable operation, enable accessibility mode in the simulator;
[0081] The emulator offers an accessibility mode, which simulates the way target programs run after the operating system has enabled accessibility mode. This accessibility mode can also be called: accessibility mode, accessibility debugging mode, etc.
[0082] The simulator's user interface displays trigger points for accessibility mode, which can be found in the menu bar, function buttons, gesture trigger points, etc. (Refer to the reference.) Figure 4 The emulator's user interface provides a menu bar 40. The menu items in the menu bar 40 include mini-program simulation 42, plug-in mode 44, and accessibility mode 46.
[0083] The enabled actions include, but are not limited to: single-click, double-click, swipe, gesture, motion control, pressure-sensitive touch, and eye-tracking.
[0084] As an illustration, the user enables accessibility mode in the simulator after clicking accessibility mode 46.
[0085] Step 406: Display the accessibility mode function bar on the simulator's user interface, the function bar including a first trigger control and / or a second trigger control;
[0086] like Figure 6 As shown, after enabling accessibility mode, a function bar 50 is added to the simulator's user interface to display accessibility mode. The function bar 50 displays a first trigger control 51 and / or a second trigger control 52.
[0087] The first trigger control 51 is used to trigger the display of accessibility reading information. The second trigger control 52 is used to trigger the display of accessibility operable area information.
[0088] The control types of the first trigger control 51 and the second trigger control 52 can be buttons, checkboxes, menu bars, etc. Since the reading information for accessibility is commonly known as screen reading, the first trigger control 51 can be a "walk-through screen reader" 51, and the second trigger control 52 can be a "walk-through hotspot" button 52.
[0089] Step 408: In response to the trigger operation on the first trigger control, display accessibility reading information on the page elements in the program page of the target program;
[0090] The triggering actions include, but are not limited to: single click, double click, swipe, gesture, motion control, pressure touch, and eye gaze.
[0091] The target program's program page includes multiple page elements with read-aloud information (which can be understood as the first page element). When all or some of the page elements are triggered (such as by clicking), they will read out accessible information.
[0092] In the accessibility testing mode, since the accessibility reading information is usually text, this information is displayed as text on page elements. On one hand, this eliminates the need to click on each page element individually, allowing the reading information for multiple page elements to be displayed simultaneously; on the other hand, displaying it as visual text is more intuitive and significantly improves testing efficiency.
[0093] In illustrative terms, in response to a trigger operation on the first trigger control, a first annotation box is displayed on each page element in the target program's program page. The first annotation box displays the reading information of the page element. For each page element with reading information, there is its own corresponding first annotation box; that is, there is a one-to-one correspondence between page elements with reading information and first annotation boxes.
[0094] like Figure 7 As shown, after the "Walk and Read Screen" control 51 is checked, accessibility information 53 for each page element is added to the program page. For example, a first annotation box is added to each page element, displaying the current page element's audio information. For instance, for page element 54, the corresponding audio information is "Image"; for page element "Service Platform" 55, the corresponding audio information is "Service Platform"; and for page element "Search Box" 56, the corresponding audio information is "Search, Text Bar," and so on.
[0095] Optionally, the dimensions of the first annotation box are related to the size of the current page element; for example, the dimensions of the first annotation box are equal to or slightly smaller than the dimensions of the current page element. When the first annotation box is displayed, page elements located below the first annotation box can be obscured, and the first annotation box is opaque or semi-transparent.
[0096] In one example, the first annotation box is semi-transparent by default. When a touch signal, click signal, touch hover signal, or other signal is sensed on the first annotation box, the first annotation box switches to opaque. And / or, the first annotation box defaults to a first width and height format. When a touch signal, click signal, touch hover signal, or other signal is sensed on the first annotation box, the first annotation box switches to a second width and height format, where the second width and height are larger than the first width and height.
[0097] Step 410: In response to the trigger operation on the second trigger control, display accessibility information for operable areas on page elements in the program page of the target program.
[0098] The triggering actions include, but are not limited to: single click, double click, swipe, gesture, motion control, pressure touch, and eye gaze.
[0099] The target program's page includes multiple page elements that support human-computer interaction (which can be understood as secondary page elements). When all or some of these page elements are triggered (e.g., clicked), information about the operable areas for obstacle access will be displayed. It should be noted that on the same program page, the primary and secondary page elements are not necessarily identical; they can differ.
[0100] In the accessibility testing mode, since the information on operable areas in accessibility is usually in text format, this information is displayed as text on the page elements. On one hand, this eliminates the need to click on each page element individually, allowing the display of operable area information for multiple page elements simultaneously; on the other hand, displaying it as visual text is more intuitive and significantly improves testing efficiency.
[0101] In illustrative terms, in response to a trigger operation on the second trigger control, a second annotation box is displayed on each page element in the target program's program page. The second annotation box displays the operable area information of the page element. For each page element with operable area information, there is its own corresponding second annotation box; that is, there is a one-to-one correspondence between page elements with operable area information and second annotation boxes.
[0102] like Figure 8 As shown, after the "Check Hotspots" button 52 is checked, accessibility information 57 is added to the program page, displaying the operable areas of all or part of the page elements. Illustratively, a second label box is added to each page element, displaying the operable area information of the current page element. This operable area information is represented using "length * width".
[0103] Optionally, the dimensions of the second annotation box are related to the size of the current page element; for example, the dimensions of the second annotation box are equal to, slightly less than, or slightly larger than the dimensions of the current page element. When the second annotation box is displayed, page elements located below it can be obscured, and the second annotation box is either opaque or semi-transparent.
[0104] In one example, the second annotation box is semi-transparent by default. When a touch signal, click signal, touch hover signal, or other signal is detected on the second annotation box, the second annotation box switches to opaque. Alternatively, the second annotation box defaults to a first width and height format. When a touch signal, click signal, touch hover signal, or other signal is detected on the second annotation box, the second annotation box switches to a second width and height format, where the second width and height are larger than the first width and height.
[0105] It should be noted that, in some embodiments, in response to triggering operations on the first and second triggering controls, a mixed annotation box is displayed on each page element in the program page of the target program. The mixed annotation box displays the reading information and operable area information of the current page element. The mixed annotation box can be an overlay of the first and second annotation boxes, or it can be a combination of the first and second annotation boxes into a single annotation box.
[0106] like Figure 9As shown, after both the "Walk Through Hotspots" and "Walk Through Screen Reading" buttons on the function bar 50 are checked, accessibility information for all or part of the page elements, as well as screen reading information 58, is added to the program page. Illustratively, a mixed annotation box is added to each page element, displaying the accessibility information and reading information of the current page element.
[0107] In summary, the method provided in this embodiment, by adding an accessibility mode to the simulator, displays relevant accessibility design information as visual information on the simulator's user interface. This allows for direct visualization testing of accessibility on the simulator, eliminating the need to run the target program on a real user terminal, thus saving significant testing steps and improving testing efficiency.
[0108] Figure 10 A flowchart illustrating a testing method for a target program provided in an exemplary embodiment of this application is shown. This method, which can be applied in a terminal, includes:
[0109] Step 502: Display the emulator's user interface. The emulator has the target program loaded, and the user interface displays the program page containing the target program.
[0110] An emulator is a program tool used to simulate the running of a target program. For example, an emulator can be a standalone program, or it can be a feature within a developer tool.
[0111] As an example, the developer tools offer features such as a simulator, editor, debugger, visualization, and cloud development. Developers enable the simulator within the developer tools and use it to load the target application.
[0112] The terminal displays the emulator's user interface. The emulator has the target program loaded, and the user interface displays the target program's page. This is illustrative; the page is rendered based on the target program's rendering layer code.
[0113] Step 504: In response to the enabling of accessibility mode, inject the script in the simulator plugin into the rendering layer code of the target program to run. The simulator plugin is used to provide the functionality of accessibility mode.
[0114] The emulator offers an accessibility mode, which simulates the way target programs run after the operating system has enabled accessibility mode. This accessibility mode can also be called: accessibility mode, accessibility debugging mode, etc.
[0115] The simulator's user interface displays trigger points for accessibility mode, which can be found in the menu bar, function buttons, gesture trigger points, etc. (Refer to the reference.) Figure 4 The emulator's user interface provides a menu bar 50. The menu items in this menu bar 50 include mini-program simulation 42, plug-in mode 44, and accessibility mode 46.
[0116] The enabled actions include, but are not limited to: single-click, double-click, swipe, gesture, motion control, pressure-sensitive touch, and eye-tracking.
[0117] As an illustration, the user enables accessibility mode in the simulator after clicking accessibility mode 46.
[0118] Reference Figure 11 As shown, the accessibility mode is implemented using plugin 62 in developer tool 60. After the user clicks on accessibility mode, developer tool 60 reads and executes the plugin code of plugin 62. This plugin has a built-in script 64, which is inserted into the rendering layer code of the target program running in simulator 66 through the program interface of developer tool, thereby executing the accessibility mode function provided by the plugin.
[0119] Step 506: After injecting the script, re-render the target program's program page;
[0120] This script is also executed during the re-rendering of the target application's page. This script provides the accessibility mode toolbar.
[0121] Step 508: Display the accessibility mode function bar on the simulator's user interface, the function bar including a first trigger control and / or a second trigger control;
[0122] like Figure 6 As shown, after enabling accessibility mode, a function bar 50 is added to the simulator's user interface to display accessibility mode. The function bar 50 displays a first trigger control 51 and / or a second trigger control 52.
[0123] The first trigger control 51 is used to trigger the display of accessibility reading information. The second trigger control 52 is used to trigger the display of accessibility operable area information.
[0124] The control types of the first trigger control 51 and the second trigger control 52 can be buttons, checkboxes, menu bars, etc. Since the reading information for accessibility is commonly known as screen reading, the first trigger control 51 can be a "walk-through screen reader" 51, and the second trigger control 52 can be a "walk-through hotspot" button 52.
[0125] Step 510: In response to the trigger operation on the first trigger control, read the ARIA tag of each page element in the program page of the target program. The ARIA tag records the reading information of the page element.
[0126] The triggering actions include, but are not limited to: single click, double click, swipe, gesture, motion control, pressure touch, and eye gaze.
[0127] The target program's program page includes multiple page elements. When all or some of these page elements are triggered (e.g., clicked), they will read out accessibility information.
[0128] All or some page elements are bound to ARIA tags, which record the reading information of the page elements.
[0129] Step 512: Based on the ARIA tag of each page element, display the first annotation box on each page element;
[0130] For page elements containing the ARIA tag, generate the first annotation box for each page element based on the ARIA tag of each page element.
[0131] In illustrative terms, in response to a trigger operation on the first trigger control, a first annotation box is displayed on each page element in the target program's program page. The first annotation box displays the reading information of the page element. For each page element with reading information, there is its own corresponding first annotation box; that is, there is a one-to-one correspondence between page elements with reading information and first annotation boxes.
[0132] like Figure 7 As shown, after the "Walk and Read Screen" control 51 is checked, accessibility information 53 for each page element is added to the program page. For example, a first annotation box is added to each page element, displaying the current page element's audio information. For instance, for page element 54, the corresponding audio information is "Image"; for page element "Service Platform" 55, the corresponding audio information is "Service Platform"; and for page element "Search Box" 56, the corresponding audio information is "Search, Text Bar," and so on.
[0133] Optionally, the dimensions of the first annotation box are related to the size of the current page element; for example, the dimensions of the first annotation box are equal to or slightly smaller than the dimensions of the current page element. When the first annotation box is displayed, page elements located below the first annotation box can be obscured, and the first annotation box is opaque or semi-transparent.
[0134] In one example, the first annotation box is semi-transparent by default. When a touch signal, click signal, touch hover signal, or other signal is sensed on the first annotation box, the first annotation box switches to opaque. And / or, the first annotation box defaults to a first width and height format. When a touch signal, click signal, touch hover signal, or other signal is sensed on the first annotation box, the first annotation box switches to a second width and height format, where the second width and height are larger than the first width and height.
[0135] Step 514: In response to the trigger operation on the second trigger control, read each page element in the target program's program page that is bound to an operation element, as well as the operable area information of each page element;
[0136] The triggering actions include, but are not limited to: single click, double click, swipe, gesture, motion control, pressure touch, and eye gaze.
[0137] The target program's program page includes multiple page elements. When all or some of these page elements are triggered (e.g., clicked), they will display information about accessible and operable areas.
[0138] Step 516: Based on the operable area information of each page element, display a second annotation box on each page element.
[0139] In the accessibility testing mode, since the information on operable areas in accessibility is usually in text format, this information is displayed as text on the page elements. On one hand, this eliminates the need to click on each page element individually, allowing the display of operable area information for multiple page elements simultaneously; on the other hand, displaying it as visual text is more intuitive and significantly improves testing efficiency.
[0140] In illustrative terms, in response to a trigger operation on the second trigger control, a second annotation box is displayed on each page element in the target program's program page. The second annotation box displays the operable area information of the page element. For each page element with operable area information, there is its own corresponding second annotation box; that is, there is a one-to-one correspondence between page elements with operable area information and second annotation boxes.
[0141] like Figure 8 As shown, after the "Check Hotspots" button 52 is checked, accessibility information 57 is added to the program page, displaying the operable areas of all or part of the page elements. Illustratively, a second label box is added to each page element, displaying the operable area information of the current page element. This operable area information is represented using "length * width".
[0142] Optionally, the dimensions of the second annotation box are related to the size of the current page element; for example, the dimensions of the second annotation box are equal to, slightly less than, or slightly larger than the dimensions of the current page element. When the second annotation box is displayed, page elements located below it can be obscured, and the second annotation box is either opaque or semi-transparent.
[0143] In one example, the second annotation box is semi-transparent by default. When a touch signal, click signal, touch hover signal, or other signal is detected on the second annotation box, the second annotation box switches to opaque. Alternatively, the second annotation box defaults to a first width and height format. When a touch signal, click signal, touch hover signal, or other signal is detected on the second annotation box, the second annotation box switches to a second width and height format, where the second width and height are larger than the first width and height.
[0144] It should be noted that, in some embodiments, in response to the triggering operation on the first trigger control and the second trigger control, a mixed annotation box is displayed on each page element in the program page of the target program. The mixed annotation box displays the reading information and operable area information of the current page element.
[0145] like Figure 9 As shown, after both the "Walk Through Hotspots" and "Walk Through Screen Reading" buttons on the function bar 50 are checked, accessibility information for all or part of the page elements, as well as screen reading information 58, is added to the program page. Illustratively, a mixed annotation box is added to each page element, displaying the accessibility information and reading information of the current page element.
[0146] In summary, the method provided in this embodiment, by adding an accessibility mode to the simulator, displays relevant accessibility design information as visual information on the simulator's user interface. This allows for direct visualization testing of accessibility on the simulator, eliminating the need to run the target program on a real user terminal, thus saving significant testing steps and improving testing efficiency.
[0147] In one example, referring to the reference Figure 121. The user switches to accessibility orientation mode in the developer tools; 2. The developer tools call the accessibility mode plugin and run the plugin code; 3. The simulator in the developer tools inserts the plugin script into the mini-program's rendering layer. The simulator first obtains the page structure of the mini-program's rendering layer and inserts additional script page elements into the rendering layer's page structure. These script page elements display "Walkthrough Hotspot" and "Walkthrough Screen Reader," and then bind the selection event logic for "Walkthrough Hotspot" and "Walkthrough Screen Reader" respectively; 4. The user clicks on "Walkthrough Hotspot"; 5. The script will iterate through... 6. Render all page elements in the rendering layer, identify hotspots, find operable page elements (input boxes, page elements bound to click events, etc.), and obtain the width and height of these page elements; 7. The script generates additional blue boxes to display the hotspot page elements; 8. The user clicks "Walk Through Screen Reading"; 9. The script will also traverse all page elements in the rendering layer and identify accessible reading information; 10. The script will read the attributes of page elements (such as page element component names, etc.) and the additional information carried by ARIA tags, and finally generate additional red boxes to mark the screen reading content.
[0148] Let's take a simple page with only one button as an example, which is bound to a click event, as shown in the code below:
[0149] <button bindtap="clickme"> Click me< / button>
[0150] The script will obtain the actual rendering information of the button, as follows:
[0151] <wx-button exparser:info-class-prefix=""exparser:info-component-id="3"exparser:info-attr-bindtap="clickMe"role="button"aria-disabled="false"wx:nodeid="9"> Click me
[0152] After the user selects "Explore Hotspots," the script iterates through the button structure and finds the attribute "exparser:info-attr-bindtap," meaning the button is bound to an event and is an interactive page element, not just displaying content. Therefore, the script retrieves the page element's style (width, height, and position information), then generates a blue box with the same width and height in the same location to enclose the page element, displaying the page element's width and height in the top left corner.
[0153] After the user selects "Screen Reading," the script iterates through the page element and finds it to be a button tag. The button's text is "Click Me," so the script reads "Click Me, Button." The script records the screen reading content of this page element and obtains its width, height, and position information. Similarly, it generates a red box of the same height as the button in the same position, enclosing the button, and displays the text "Click Me, Button" in the upper left corner of the red box.
[0154] Figure 13 A block diagram of a testing apparatus for an object program provided in an exemplary embodiment of this application is shown. The apparatus includes:
[0155] Display module 1320 is used to display the user interface of the simulator, the simulator is loaded with the target program, and the user interface displays the program page of the target program;
[0156] Enable module 1340 is configured to enable the accessibility access mode in the simulator in response to an enable operation of the accessibility access mode.
[0157] Accessibility testing module 1360 is used to display accessibility design information on page elements in the program page of the target program in the accessibility access mode.
[0158] In one illustrative embodiment, the accessibility range information includes: accessibility reading information; the display module 1320 is used to display the accessibility mode function bar on the simulator's user interface, the function bar including a first trigger control; the accessibility testing module 1360 is used to display the accessibility reading information on page elements in the program page of the target program in response to a trigger operation on the first trigger control.
[0159] In one illustrative embodiment, the program page includes at least one page element with read-aloud information;
[0160] The accessibility testing module 1360 is used to respond to the trigger operation on the first trigger control and display a first annotation box on all or part of the page elements in the program page of the target program, and the first annotation box displays the reading information of the page element.
[0161] In one illustrative embodiment, the accessibility testing module 1360 is configured to, in response to a trigger operation on the first trigger control, read the ARIA tag of each page element in the program page of the target program, wherein the ARIA tag records the reading information of the page element; and display the first annotation box on each page element based on the ARIA tag of each page element.
[0162] In one illustrative embodiment, the accessibility information of the accessibility range includes: information on the operable area for accessibility;
[0163] The display module 1320 is used to display the function bar of the accessibility mode on the user interface of the simulator, the function bar including a second trigger control; the accessibility test module 1360 is used to display the operable area information of the accessibility mode on the page elements in the program page of the target program in response to the trigger operation on the second trigger control.
[0164] In one illustrative embodiment, the program page includes at least one page element that supports human-computer interaction.
[0165] The accessibility testing module 1360 is used to respond to the trigger operation on the second trigger control to display a second annotation box on all or part of the page elements in the program page of the target program, and the second annotation box displays the operable area information of the page element.
[0166] In one illustrative embodiment, the accessibility testing module 1360 is configured to, in response to a trigger operation on the second trigger control, read each page element in the program page of the target program that is bound to an operable element, and the operable area information of each page element; and display the second annotation box on each page element based on the operable area information of each page element.
[0167] In one illustrative embodiment, the display module 1320 is used to display the function bar of the accessibility mode on the user interface of the simulator, the function bar including a first trigger control and a second trigger control;
[0168] The accessibility testing module 1360 is used to respond to the triggering operations on the first trigger control and the second trigger control, and to display a mixed annotation box on the page elements in the program page of the target program. The mixed annotation box displays the operable area information and reading information of the accessibility access.
[0169] In one illustrative embodiment, the accessibility testing module 1360 is configured to inject a script from a simulator plugin into the rendering layer code of the target program in response to an accessibility mode activation operation, wherein the simulator plugin provides the functionality of the accessibility mode; and after injecting the script, re-render the program pages of the target program.
[0170] In one illustrative embodiment, the target program includes at least one of a web application and a mini-program, wherein the mini-program is a program that depends on the host application to run.
[0171] Figure 14 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Typically, the computer device 1400 includes a processor 1420 and a memory 1440.
[0172] Processor 1420 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1420 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1420 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1420 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1420 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0173] Memory 1440 may include one or more computer-readable storage media, which may be non-transitory. Memory 1440 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in memory 1440 is used to store at least one instruction, which is executed by processor 1420 to implement the method provided in the method embodiments of this application.
[0174] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the test method for the target program provided in the above-described method embodiments.
[0175] This application also provides a computer-readable storage medium storing at least one instruction, at least one program, a code set, or an instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the test method for the target program provided in the above method embodiments.
[0176] Optionally, this application also provides a computer program product containing instructions that, when run on a computer device, causes the computer device to execute the target program described in the above aspects using a testing method.
[0177] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0178] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0179] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for testing a target program, characterized in that, The method includes: The user interface of the simulator is displayed, the simulator is loaded with the target program, and the user interface displays the program page of the target program; In response to the activation operation of the accessibility mode, the accessibility mode is enabled in the simulator; In the accessibility mode, accessibility design information is displayed on page elements in the program page of the target program.
2. The method according to claim 1, characterized in that, The accessibility design information includes: accessibility reading information; In the accessibility access mode, displaying accessibility design information on page elements in the program page of the target program includes: The accessibility mode function bar is displayed on the user interface of the simulator, and the function bar includes a first trigger control; In response to the trigger operation on the first trigger control, the accessibility reading information is displayed on a page element in the program page of the target program.
3. The method according to claim 2, characterized in that, The program page includes at least one page element with read-aloud information; The step of responding to a trigger operation on the first trigger control by displaying accessibility-enabled reading information on page elements in the program page of the target program includes: In response to a trigger operation on the first trigger control, a first annotation box is displayed on all or part of the page elements in the program page of the target program, and the first annotation box displays the reading information of the page element.
4. The method according to claim 3, characterized in that, The step of displaying a first annotation box on each page element in the program page of the target program in response to a trigger operation on the first trigger control includes: In response to a trigger operation on the first trigger control, the rich web application ARIA tag of each page element in the program page of the target program is read, and the ARIA tag records the reading information of the page element; Based on the ARIA tag of each page element, the first annotation box is displayed on each page element.
5. The method according to claim 1, characterized in that, The accessibility design information includes: information on the operable areas for accessibility; In the accessibility access mode, displaying accessibility design information on page elements in the program page of the target program includes: The accessibility mode function bar is displayed on the user interface of the simulator, and the function bar includes a second trigger control; In response to a trigger operation on the second trigger control, the accessible operable area information is displayed on a page element in the program page of the target program.
6. The method according to claim 5, characterized in that, The program page includes at least one page element that supports human-computer interaction. The response to the trigger operation on the second trigger control, displaying the accessible and operable area information on page elements in the program page of the target program, includes: In response to a trigger operation on the second trigger control, a second annotation box is displayed on all or part of the page elements in the program page of the target program, and the second annotation box displays the operable area information of the page element.
7. The method according to claim 6, characterized in that, The step of displaying a second annotation box on each page element in the program page of the target program in response to a trigger operation on the second trigger control includes: In response to the trigger operation on the second trigger control, read each page element in the program page of the target program that is bound to an operation element, and the operable area information of each page element; Based on the operable area information of each page element, the second annotation box is displayed on each page element.
8. The method according to claim 1, characterized in that, In the accessibility access mode, displaying accessibility design information on page elements in the program page of the target program includes: The accessibility mode function bar is displayed on the user interface of the simulator, and the function bar includes a first trigger control and a second trigger control; In response to the triggering operations on the first trigger control and the second trigger control, a hybrid annotation box is displayed on the page element in the program page of the target program. The hybrid annotation box displays the accessibility operation area information and the reading information.
9. The method according to any one of claims 1 to 8, characterized in that, The activation of the accessibility mode in the simulator in response to the accessibility mode activation operation includes: In response to the activation of the accessibility mode, a script from the simulator plugin is injected into the rendering layer code of the target program and executed, wherein the simulator plugin is used to provide the functionality of the accessibility mode; After the script is injected, the program page of the target program is re-rendered.
10. The method according to any one of claims 1 to 8, characterized in that, The target program includes at least one of a web application and a mini-program, wherein the mini-program is a program that depends on the host application to run.
11. A testing apparatus for a target program, characterized in that, The device includes: The display module is used to display the user interface of the simulator, the simulator is loaded with the target program, and the user interface displays the program page of the target program; An enable module is used to enable the accessibility access mode in the simulator in response to an enable operation of the accessibility access mode; An accessibility testing module is used to display accessibility design information on page elements in the program page of the target program in the accessibility access mode.
12. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program that is executed by the processor to enable the computer device to implement a test method for the target program as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is executed by a processor to enable a device having the processor to implement a test method for the target program as described in any one of claims 1 to 10.
14. A computer program product, characterized in that, The computer program product stores a computer program that is executed by a processor to enable a device having the processor to implement the test method for the target program as described in any one of claims 1 to 10.