This is a test automation framework based on Playwright, supports key Web workloads automation testing on Chrome browser across multiple platforms, as well as automatically generating test result and sending test report via mail.
- Platforms: Windows, Linux
- Workloads: Speedometer2, WebXPRT3, Unity3D, JetStream2
- Node.js, recommend to use Node.js LTS, current this tool is based on Node.js (12.17.0 LTS).
The automation test mainly takes the following actions:
- Get the system information like CPU, Memory, OS.
- Launch the Chrome browser and read the GPU information and browser version.
- Launch the chrome and run each workload defined in config.json for several times. The test results of all arounds are recorded.
- Choose the middle value among the test arounds and store the device information and all the results of this workload test
to
./results/{platform}/{workload}
directory(If it does not exists, create it). The files are named as{data}_{CPU}_{Browser}.json
. - Before storing the test results to json files, upload this test results to remote server for backup.
- Test report delivery is hosted on remote server, which will do following actions:
- Check if there are avaliable completed report for one round of regular tesitng every 6 hours, if yes, start generating test report.
- Generate excel files to list the scores between CPUs for the same workload at
./excels
directory(If it does not exists, create it) and then upload them to the Web PnP Report site database. - Download the trend charts for each workload and put them on the
./charts
directory(If it does not exists, create it). - Generate html report that contains the comparison tables based on the json files. The trend charts will be inserted into the html.
- Send E-mail to involved teams of the project. If there're any errors occured, send the errors information to dev team.
- Backup test results and generated html report.
-
Go to this folder
-
npm install
-
Config test plan via config.json:
- Set test target in
workloads
fields, pls. don't edit the workload name while you can change the workload's url and running times viaurl
andrun_times
fields respectively. You can also remove some of these workloads to in order to run single workload testing. - To support both Windows and Linux platforms,
win_chrome_path
andlinux_chrome_path
are introduced. chrome_flags
is used for setting specific chrome flag.- This tool allows to run tests automatically in a pre-set scheduler by using node-corn, you can set the test cadence via
test_cadence
field. Please refer to cron syntax to check how to set a test cadence. mail_test_report
field is used for setting stakeholders' mail list who'd like to receive the test report.mail_dev_notice
field is used for setting mail list who'd like to receive the error message when the testing goes into something wrong or receive test report whendev_mode
istrue
.- On Linux platform, please set the
chrome_linux_password
field the Linux sudo password. It's required while upgrading the chrome as install Linux package might need sudo permission. dev_mode
represents develop mode, setting it totrue
will skip generating and uploading excel file, skip test results upload.- If you don't want to run the test at a specific schedule, you can simply set
enable_cron
tofalse
. - Set
password
item inresult_server
field for connecting to result server if you are going to run regular testing. chromium_builder
field is used for running test automation with specific chromium build from build server. Currently only support for Windows platform. The build server will automatically build chromium at the head of commit id passed by user, then upload chromium build to http://powerbuilder.sh.intel.com/project/chromium_builder/, and then this tool get the corresponding chromium build to run testing at target device. Once you setenable_chromium_build
totrue
, you must set thecommit_id
to the specific commit id for building chromium, usually you only need to pass the first 7 characters of a normal chromium commit id. The build server's host and port are set inhost
andport
fields by default. Note: withenable_chromium_build
set totrue
, the tool will automatically udpate thedev_mode
totrue
.
- Set test target in
-
Run the test: restart the PC and go to this folder again and run:
node main.js
-
Add a new workload If you want to a new workload, you need:
- Update the
workloads
array of config.json. - Provide a workload executor module, place it to
src/workloads/
directory. - Update the
executors
object of the functiongenWorkloadsResults
insrc/run.js
.
- This tool uses playwright v1.2.1, which is only guarantee to support Chromium >= 85.0.4182.0.
- Tester should maintain the cpu_list.json file which is a CPU info lists used for finding matched CPU code name and corresponding competitor's test result.
- Before testing, please restart the test device to make a clean up environment.
- We have 'jstc' branch specific for development testing purpose, which does not connect to report server but supports more workloads automation, bisect automation, and ect., for more details, please refer to https://github.com/Honry/webpnp-test-automation/blob/jstc/README.md.
- Update the