@@ -18,17 +18,28 @@ const catchError = (err) => {
1818} ;
1919
2020try {
21+
22+ var usage = `
23+ Usage: $0 [tests] [options]
24+
25+ The integration test aims to comprehensively test the Vizzu library by executing animations represented as a promise chain of animate function calls.
26+ Each test case follows predefined animation steps and calculates a hash based on the generated canvas image data for each step.
27+ The test validation compares the calculated hash values with the expected values stored for each test case.
28+
29+ The test offers the ability to generate and save images for every canvas image data, as well as create reference and difference images.
30+ This allows for detailed analysis and comparison of the test output.
31+
32+ During testing, two types of warnings may occur.
33+ Firstly, if a test case lacks a stored reference hash, a warning is issued.
34+ Secondly, if a test case produces a different hash compared to the stored reference, but the reference Vizzu library also generates the same hash,
35+ it indicates that the difference is likely caused by environmental factors such as the operating system or the browser.
36+
37+ Please note that the test require Chrome, ChromeDriver and Selenium Webdriver to be properly configured and available.
38+ ` ;
39+
2140 var argv = yargs
2241
23- . usage (
24- "Usage: $0 [tests] [options]" +
25- "\n\nThe objective of the integration test is to E2E test the Vizzu library." +
26- "\nThe test cases are animations, each animation consists of an animate function call promise chain." +
27- "\nThe test animations run in Chrome using ChromeDriver and Selenium Webdriver." +
28- "\nA test case seeks through each animate function calls with a predefined animation step." +
29- "\nA hash is calculated on every created canvas image data for each animation step." +
30- "\nA test validates a hash calculated from the created hash list during each test case."
31- )
42+ . usage ( usage )
3243
3344 . help ( "h" )
3445 . alias ( "h" , "help" )
4354 . nargs ( "c" , 1 )
4455 . describe (
4556 "c" ,
46- "Change the list of config file's path of the test cases" +
47- "\n(relative or absolute path where the repo folder is the root)" +
48- "\n"
57+ "Change the list of configuration files' path of the test cases" +
58+ "\n(relative or absolute path where the repo folder is the root)"
4959 )
5060 . default ( "c" , [
5161 "/test/integration/test_cases/test_cases.json" ,
5565 . choices ( "Werror" , [ "noref" , "sameref" ] )
5666 . describe (
5767 "Werror" ,
58- "Select warnings to be treated as errors" +
68+ "Select warnings to be treated as errors during the test execution " +
5969 '\n- "noref": Test cases without reference hashes' +
6070 '\n- "sameref": Test cases that produce the same hashes with the reference Vizzu'
6171 )
6979 . choices ( "images" , [ "ALL" , "FAILED" , "DISABLED" ] )
7080 . describe (
7181 "images" ,
72- "Change report images saving behavior" +
82+ "Change the saving behavior of images, which are captured from every test steps " +
7383 '\n- "ALL": Create images for every test' +
7484 '\n- "FAILED": Create images for failed/warning tests only' +
7585 '\n- "DISABLED": Do not create images'
7989 . choices ( "hashes" , [ "ALL" , "FAILED" , "DISABLED" ] )
8090 . describe (
8191 "hashes" ,
82- "Change report hashes saving behavior" +
92+ "Change the saving behavior of hashes, which are unique identifiers calculated for each test case " +
8393 '\n- "ALL": Write hashes into the report file for every test' +
8494 '\n- "FAILED": Write hashes into the report file for failed/warning tests only' +
8595 '\n- "DISABLED": Do not create report file'
8999 . boolean ( "nologs" )
90100 . describe (
91101 "nologs" ,
92- "\n Do not save browser and console log into file" + "\n "
102+ "Disable the saving of browser and console logs into a log file "
93103 )
94104 . default ( "nologs" , false )
95105
@@ -99,16 +109,15 @@ try {
99109 "vizzu" ,
100110 "Change Vizzu url" +
101111 "\n(can be forced to use vizzu.js or vizzu.min.js if its given)" +
102- '\n\n- "head": select the last stable Vizzu from the main branch' +
112+ '\n\n- "head": specify "head" to select the last stable version of Vizzu from the main branch' +
103113 "\n(default: vizzu.min.js)" +
104114 "\n\n- [sha]: select Vizzu with a short commit number" +
105115 "\n(default: vizzu.min.js)" +
106116 "\n\n- [version]: select Vizzu with a version number" +
107117 "\n(vizzu.min.js only)" +
108118 "\n\n- path: select Vizzu from the local file system" +
109119 "\n(relative or absolute path where the repo folder is the root)" +
110- "\n(default: vizzu.js)" +
111- "\n"
120+ "\n(default: vizzu.js)"
112121 )
113122 . default ( "vizzu" , "/example/lib/vizzu.js" )
114123
@@ -118,32 +127,31 @@ try {
118127 "vizzu-ref" ,
119128 "Change reference Vizzu url" +
120129 "\n(can be forced to use vizzu.js or vizzu.min.js if its given)" +
121- '\n\n- "head": select the last stable Vizzu from the main branch' +
130+ '\n\n- "head": specify "head" to select the last stable version of Vizzu from the main branch' +
122131 "\n(default: vizzu.min.js)" +
123132 "\n\n- [sha]: select Vizzu with a short commit number" +
124133 "\n(default: vizzu.min.js)" +
125134 "\n\n- [version]: select Vizzu with a version number" +
126135 "\n(vizzu.min.js only)" +
127136 "\n\n- path: select Vizzu from the local file system" +
128137 "\n(relative or absolute path where the repo folder is the root)" +
129- "\n(default: vizzu.js)" +
130- "\n"
138+ "\n(default: vizzu.js)"
131139 )
132140 . default ( "vizzu-ref" , "head" )
133141
134142 . boolean ( "g" )
135143 . alias ( "g" , "gui" )
136- . describe ( "g" , "Use browser with graphical user interface" + "\n" )
144+ . describe ( "g" , "Use browser with graphical user interface" )
137145 . default ( "g" , false )
138146
139147 . number ( "b" )
140148 . alias ( "b" , "browsers" )
141- . describe ( "b" , "Change number of parallel browser windows" + "\n" )
149+ . describe ( "b" , "Change number of parallel browser windows" )
142150 . default ( "b" , 6 )
143151
144152 . boolean ( "d" )
145153 . alias ( "d" , "delete" )
146- . describe ( "d" , "Delete test report folder" + "\n" )
154+ . describe ( "d" , "Delete test report folder" )
147155 . default ( "d" , false )
148156
149157 . example ( [
@@ -166,17 +174,17 @@ try {
166174 "Select test cases with glob pattern" ,
167175 ] ,
168176 ] )
169- . example (
170- "$0 -g" ,
171- "Run all tests and use browser with graphical user interface"
172- )
173177 . example ( [
174178 [
175- "$0 -vizzu head" ,
179+ "$0 -- vizzu head" ,
176180 "Run all tests with the latest stable Vizzu from the main branch" ,
177181 ] ,
178182 [
179- "$0 -vizzu [sha]/vizzu.js" ,
183+ "$0 --vizzu [x.y.z]" ,
184+ "Run all tests and select Vizzu with a version number" ,
185+ ] ,
186+ [
187+ "$0 --vizzu [sha]/vizzu.js" ,
180188 "Run all tests and select Vizzu with a short commit number" +
181189 "\nand use vizzu.js instead of the default vizzu.min.js" ,
182190 ] ,
0 commit comments