| 
									
										
										
										
											2018-02-28 01:24:07 +02:00
										 |  |  | #!/usr/bin/env bash
 | 
					
						
							|  |  |  | set +x -eu -o pipefail | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ( | 
					
						
							|  |  |  |   readonly thisDir="$(cd $(dirname ${BASH_SOURCE[0]}); pwd)" | 
					
						
							|  |  |  |   readonly aioDir="$(realpath $thisDir/..)" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-16 00:02:28 +03:00
										 |  |  |   readonly protractorConf="$aioDir/tests/deployment/e2e/protractor.conf.js" | 
					
						
							| 
									
										
										
										
											2019-04-25 13:54:10 +03:00
										 |  |  |   readonly targetUrl="$1" | 
					
						
							|  |  |  |   readonly minPwaScore="$2" | 
					
						
							| 
									
										
										
										
											2018-02-28 01:24:07 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |   cd "$aioDir" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   # Install dependencies. | 
					
						
							|  |  |  |   echo -e "\nInstalling dependencies in '$aioDir'...\n-----" | 
					
						
							| 
									
										
										
										
											2020-01-29 13:59:52 +02:00
										 |  |  |   yarn install --frozen-lockfile --non-interactive | 
					
						
							| 
									
										
										
										
											2018-02-28 01:24:07 +02:00
										 |  |  |   yarn update-webdriver | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-25 13:54:10 +03:00
										 |  |  |   # Run checks for target URL. | 
					
						
							|  |  |  |   echo -e "\nChecking '$targetUrl'...\n-----" | 
					
						
							| 
									
										
										
										
											2018-02-28 01:24:07 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-25 13:54:10 +03:00
										 |  |  |   # Run basic e2e and deployment config tests. | 
					
						
							|  |  |  |   yarn protractor "$protractorConf" --baseUrl "$targetUrl" | 
					
						
							| 
									
										
										
										
											2018-02-28 01:24:07 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-25 13:54:10 +03:00
										 |  |  |   # Run PWA-score tests. | 
					
						
							|  |  |  |   yarn test-pwa-score "$targetUrl" "$minPwaScore" | 
					
						
							| 
									
										
										
										
											2018-02-28 01:24:07 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-04 02:34:32 +03:00
										 |  |  |   # Run a11y tests. | 
					
						
							|  |  |  |   yarn test-a11y-score "$targetUrl" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-28 01:24:07 +02:00
										 |  |  |   echo -e "\nAll checks passed!" | 
					
						
							|  |  |  | ) |