Start writing guide for selenium on ocp.
This commit is contained in:
		
							
								
								
									
										22
									
								
								2024-03-14-scalable-selenium-pipelines/README.org
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								2024-03-14-scalable-selenium-pipelines/README.org
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,22 @@
 | 
			
		||||
#+TITLE: On-demand Selenium on OpenShift
 | 
			
		||||
#+AUTHOR: James Blair
 | 
			
		||||
#+DATE: <2024-03-14 Tue 09:00>
 | 
			
		||||
 | 
			
		||||
* Introduction
 | 
			
		||||
 | 
			
		||||
This guide outlines how to setup an on-demand [[https://www.selenium.dev/][Selenium]] testing pipeline in [[https://www.redhat.com/en/technologies/cloud-computing/openshift][OpenShift]].
 | 
			
		||||
 | 
			
		||||
Selenium automates browsers. Primarily it is for automating web applications for testing purposes, but is certainly not limited to just that. This guide relies on the "Selenium Grid" component for running tests in a distributed way.
 | 
			
		||||
 | 
			
		||||
We will harness the power of containers and OpenShift to create a scalable and orchestrated cloud native approach to testing with Selenium.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* The situation
 | 
			
		||||
 | 
			
		||||
So let's say we have a container based application deployed on OpenShift, and we now want to perform automated browser based testing for that application on OpenShift.
 | 
			
		||||
 | 
			
		||||
Gone are the days where we treat our testing infrastructure like sacred pets. In this guide each application that wants to perform browser based testing will leverage shared pipelines to spin up on demand Selenium components, carry out the testing, then throw it away once completed.
 | 
			
		||||
 | 
			
		||||
Below is an outline of what this flow looks like, obviously a real world application testing pipeline has many other stages, the diagram below is focused only on the browser testing phase to illustrate the high level steps within:
 | 
			
		||||
 | 
			
		||||
[[./images/graphviz.svg]]
 | 
			
		||||
							
								
								
									
										102
									
								
								2024-03-14-scalable-selenium-pipelines/images/graphviz.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										102
									
								
								2024-03-14-scalable-selenium-pipelines/images/graphviz.svg
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,102 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><!-- Generated by graphviz version 2.40.1 (20161225.0304)
 | 
			
		||||
 --><!-- Title: G Pages: 1 --><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="310pt" height="553pt" viewBox="0.00 0.00 310.00 552.80">
 | 
			
		||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 548.8)">
 | 
			
		||||
<title>G</title>
 | 
			
		||||
<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-548.8 306,-548.8 306,4 -4,4"/>
 | 
			
		||||
<g id="clust1" class="cluster">
 | 
			
		||||
<title>cluster_0</title>
 | 
			
		||||
<polygon fill="#d3d3d3" stroke="#d3d3d3" points="8,-64 8,-500.8 294,-500.8 294,-64 8,-64"/>
 | 
			
		||||
<text text-anchor="middle" x="151" y="-484.2" font-family="Times,serif" font-size="14.00" fill="#000000">Selenium testing stage</text>
 | 
			
		||||
</g>
 | 
			
		||||
<!-- Deploy Selenium Grid -->
 | 
			
		||||
<g id="node1" class="node">
 | 
			
		||||
<title>Deploy Selenium Grid</title>
 | 
			
		||||
<ellipse fill="#c0c0c0" stroke="#c0c0c0" cx="151" cy="-450" rx="98.4371" ry="18"/>
 | 
			
		||||
<text text-anchor="middle" x="151" y="-445.8" font-family="Times,serif" font-size="14.00" fill="#000000">Deploy Selenium Grid</text>
 | 
			
		||||
</g>
 | 
			
		||||
<!-- Deploy Selenium Node Chrome -->
 | 
			
		||||
<g id="node2" class="node">
 | 
			
		||||
<title>Deploy Selenium Node Chrome</title>
 | 
			
		||||
<ellipse fill="#c0c0c0" stroke="#c0c0c0" cx="151" cy="-378" rx="135.421" ry="18"/>
 | 
			
		||||
<text text-anchor="middle" x="151" y="-373.8" font-family="Times,serif" font-size="14.00" fill="#000000">Deploy Selenium Node Chrome</text>
 | 
			
		||||
</g>
 | 
			
		||||
<!-- Deploy Selenium Grid->Deploy Selenium Node Chrome -->
 | 
			
		||||
<g id="edge1" class="edge">
 | 
			
		||||
<title>Deploy Selenium Grid->Deploy Selenium Node Chrome</title>
 | 
			
		||||
<path fill="none" stroke="#000000" d="M151,-431.8314C151,-424.131 151,-414.9743 151,-406.4166"/>
 | 
			
		||||
<polygon fill="#000000" stroke="#000000" points="154.5001,-406.4132 151,-396.4133 147.5001,-406.4133 154.5001,-406.4132"/>
 | 
			
		||||
</g>
 | 
			
		||||
<!-- Execute Tests -->
 | 
			
		||||
<g id="node3" class="node">
 | 
			
		||||
<title>Execute Tests</title>
 | 
			
		||||
<ellipse fill="#c0c0c0" stroke="#c0c0c0" cx="151" cy="-306" rx="64.8639" ry="18"/>
 | 
			
		||||
<text text-anchor="middle" x="151" y="-301.8" font-family="Times,serif" font-size="14.00" fill="#000000">Execute Tests</text>
 | 
			
		||||
</g>
 | 
			
		||||
<!-- Deploy Selenium Node Chrome->Execute Tests -->
 | 
			
		||||
<g id="edge2" class="edge">
 | 
			
		||||
<title>Deploy Selenium Node Chrome->Execute Tests</title>
 | 
			
		||||
<path fill="none" stroke="#000000" d="M151,-359.8314C151,-352.131 151,-342.9743 151,-334.4166"/>
 | 
			
		||||
<polygon fill="#000000" stroke="#000000" points="154.5001,-334.4132 151,-324.4133 147.5001,-334.4133 154.5001,-334.4132"/>
 | 
			
		||||
</g>
 | 
			
		||||
<!-- Delete Selenium Node Chrome -->
 | 
			
		||||
<g id="node4" class="node">
 | 
			
		||||
<title>Delete Selenium Node Chrome</title>
 | 
			
		||||
<ellipse fill="#c0c0c0" stroke="#c0c0c0" cx="151" cy="-234" rx="131.964" ry="18"/>
 | 
			
		||||
<text text-anchor="middle" x="151" y="-229.8" font-family="Times,serif" font-size="14.00" fill="#000000">Delete Selenium Node Chrome</text>
 | 
			
		||||
</g>
 | 
			
		||||
<!-- Execute Tests->Delete Selenium Node Chrome -->
 | 
			
		||||
<g id="edge3" class="edge">
 | 
			
		||||
<title>Execute Tests->Delete Selenium Node Chrome</title>
 | 
			
		||||
<path fill="none" stroke="#000000" d="M151,-287.8314C151,-280.131 151,-270.9743 151,-262.4166"/>
 | 
			
		||||
<polygon fill="#000000" stroke="#000000" points="154.5001,-262.4132 151,-252.4133 147.5001,-262.4133 154.5001,-262.4132"/>
 | 
			
		||||
</g>
 | 
			
		||||
<!-- Delete Selenium Grid -->
 | 
			
		||||
<g id="node5" class="node">
 | 
			
		||||
<title>Delete Selenium Grid</title>
 | 
			
		||||
<ellipse fill="#c0c0c0" stroke="#c0c0c0" cx="151" cy="-162" rx="95.4811" ry="18"/>
 | 
			
		||||
<text text-anchor="middle" x="151" y="-157.8" font-family="Times,serif" font-size="14.00" fill="#000000">Delete Selenium Grid</text>
 | 
			
		||||
</g>
 | 
			
		||||
<!-- Delete Selenium Node Chrome->Delete Selenium Grid -->
 | 
			
		||||
<g id="edge4" class="edge">
 | 
			
		||||
<title>Delete Selenium Node Chrome->Delete Selenium Grid</title>
 | 
			
		||||
<path fill="none" stroke="#000000" d="M151,-215.8314C151,-208.131 151,-198.9743 151,-190.4166"/>
 | 
			
		||||
<polygon fill="#000000" stroke="#000000" points="154.5001,-190.4132 151,-180.4133 147.5001,-190.4133 154.5001,-190.4132"/>
 | 
			
		||||
</g>
 | 
			
		||||
<!-- Publish Report -->
 | 
			
		||||
<g id="node6" class="node">
 | 
			
		||||
<title>Publish Report</title>
 | 
			
		||||
<ellipse fill="#c0c0c0" stroke="#c0c0c0" cx="151" cy="-90" rx="68.9201" ry="18"/>
 | 
			
		||||
<text text-anchor="middle" x="151" y="-85.8" font-family="Times,serif" font-size="14.00" fill="#000000">Publish Report</text>
 | 
			
		||||
</g>
 | 
			
		||||
<!-- Delete Selenium Grid->Publish Report -->
 | 
			
		||||
<g id="edge5" class="edge">
 | 
			
		||||
<title>Delete Selenium Grid->Publish Report</title>
 | 
			
		||||
<path fill="none" stroke="#000000" d="M151,-143.8314C151,-136.131 151,-126.9743 151,-118.4166"/>
 | 
			
		||||
<polygon fill="#000000" stroke="#000000" points="154.5001,-118.4132 151,-108.4133 147.5001,-118.4133 154.5001,-118.4132"/>
 | 
			
		||||
</g>
 | 
			
		||||
<!-- end -->
 | 
			
		||||
<g id="node8" class="node">
 | 
			
		||||
<title>end</title>
 | 
			
		||||
<ellipse fill="#ff0000" stroke="#ff0000" cx="151" cy="-18" rx="133.7088" ry="18"/>
 | 
			
		||||
<text text-anchor="middle" x="151" y="-13.8" font-family="Times,serif" font-size="14.00" fill="#000000">End application testing pipeline</text>
 | 
			
		||||
</g>
 | 
			
		||||
<!-- Publish Report->end -->
 | 
			
		||||
<g id="edge7" class="edge">
 | 
			
		||||
<title>Publish Report->end</title>
 | 
			
		||||
<path fill="none" stroke="#000000" d="M151,-71.8314C151,-64.131 151,-54.9743 151,-46.4166"/>
 | 
			
		||||
<polygon fill="#000000" stroke="#000000" points="154.5001,-46.4132 151,-36.4133 147.5001,-46.4133 154.5001,-46.4132"/>
 | 
			
		||||
</g>
 | 
			
		||||
<!-- start -->
 | 
			
		||||
<g id="node7" class="node">
 | 
			
		||||
<title>start</title>
 | 
			
		||||
<ellipse fill="#00ff00" stroke="#00ff00" cx="151" cy="-526.8" rx="136.0706" ry="18"/>
 | 
			
		||||
<text text-anchor="middle" x="151" y="-522.6" font-family="Times,serif" font-size="14.00" fill="#000000">Start application testing pipeline</text>
 | 
			
		||||
</g>
 | 
			
		||||
<!-- start->Deploy Selenium Grid -->
 | 
			
		||||
<g id="edge6" class="edge">
 | 
			
		||||
<title>start->Deploy Selenium Grid</title>
 | 
			
		||||
<path fill="none" stroke="#000000" d="M151,-508.5995C151,-499.5132 151,-488.3176 151,-478.1549"/>
 | 
			
		||||
<polygon fill="#000000" stroke="#000000" points="154.5001,-478.0698 151,-468.0699 147.5001,-478.0699 154.5001,-478.0698"/>
 | 
			
		||||
</g>
 | 
			
		||||
</g>
 | 
			
		||||
</svg>
 | 
			
		||||
| 
		 After Width: | Height: | Size: 5.8 KiB  | 
		Reference in New Issue
	
	Block a user