| 
									
										
										
										
											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" | 
					
						
							| 
									
										
										
										
											2018-09-27 16:35:05 +03:00
										 |  |  |   readonly minPwaScore="$1" | 
					
						
							| 
									
										
										
										
											2018-02-28 01:24:07 +02:00
										 |  |  |   readonly urls=( | 
					
						
							|  |  |  |     "https://angular.io/" | 
					
						
							| 
									
										
										
										
											2018-04-15 23:55:21 +03:00
										 |  |  |     "https://next.angular.io/" | 
					
						
							| 
									
										
										
										
											2018-02-28 01:24:07 +02:00
										 |  |  |   ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   cd "$aioDir" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   # Install dependencies. | 
					
						
							|  |  |  |   echo -e "\nInstalling dependencies in '$aioDir'...\n-----" | 
					
						
							|  |  |  |   yarn install --frozen-lockfile | 
					
						
							|  |  |  |   yarn update-webdriver | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   # Run checks for all URLs. | 
					
						
							|  |  |  |   for url in "${urls[@]}"; do | 
					
						
							|  |  |  |     echo -e "\nChecking '$url'...\n-----" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-16 00:02:28 +03:00
										 |  |  |     # Run basic e2e and deployment config tests. | 
					
						
							|  |  |  |     yarn protractor "$protractorConf" --baseUrl "$url" | 
					
						
							| 
									
										
										
										
											2018-02-28 01:24:07 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # Run PWA-score tests. | 
					
						
							|  |  |  |     yarn test-pwa-score "$url" "$minPwaScore" | 
					
						
							|  |  |  |   done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   echo -e "\nAll checks passed!" | 
					
						
							|  |  |  | ) |