Thursday, May 2, 2024
HomeJavaAccelerating App Testing with Automation and Trendy CI Pipelines - Java Code...

Accelerating App Testing with Automation and Trendy CI Pipelines – Java Code Geeks


Normally after we speak about High quality we take into consideration the QA crew in our organisation, however that definition has modified. Now the QA crew can be taking care of the discharge cycle course of and particularly ensuring that Testing is a part of the discharge cycle with the assistance of CI/CD Automation.

CI/CD is about repeatedly testing and integrating completely different groups’ efforts to speed up software program releases with utmost high quality. And the CI/CD pipeline in a nutshell, might be described as a script which defines your launch workflow. However crucial half right here is automating each part on the pipeline, which additionally consists of automating the testing part.

To speed up the testing cycle we have to combine the Automation suite with CI pipeline, let’s attempt to perceive it in additional element within the subsequent part.

CICD Stream

Why do we want CI Pipelines With Automation?

Implementation of Agile processes has elevated the variety of software program builds, which includes committing code modifications to grasp often, however testing these builds each time manually is close to to not possible.

That’s the place we have to mix two worlds: QA and CI Pipeline. First we’ve got to ensure that all our take a look at instances are automated and we’ve got the take a look at suite prepared with us. Now as soon as we’ve got our automated suite prepared, the subsequent activity is to combine these to our CI pipelines, now the query is why ought to we carry out the CI integration?

The principle motive is each time there’s a change by the event crew, the CI pipeline will construct the modifications and on the identical time set off the Automation suite to make sure the code is all the time up-to-date and the modifications haven’t impacted the general options.

Check Automation in CI/CD Pipeline

On this part we are going to combine the Automation Suite with Jenkins job, in order that each time required we will set off our take a look at suites from the pipeline and even schedule the identical.

Prerequisite for operating :
– Automation suite in testNG xml
– Jenkins server entry with legitimate credentials

STEP – 01

Combine testng.xml suite with pom.xml. To try this we’ve got to cross the trail of testng.xml suite contained in the suiteXmlFiles tag. The trail which has been offered right here is the trail of testng xml suite used within the demo venture. You will want to make use of the trail as per the suite situated in your setup.

<suiteXmlFile> tag of pom.xml:

<configuration>

<suiteXmlFiles>

<suiteXmlFile>resourcestestNG_xmlRegressionSuite.xml</suiteXmlFile>

</suiteXmlFiles>

</configuration>

STEP – 02

Go to your Automation venture path and open command immediate, as proven beneath venture identify is “Process” and we’ve got opened cmd @venture location:

STEP – 03

Enter maven objective for the take a look at as: “mvn clear take a look at” within the command immediate and hit ENTER. This may execute all of the take a look at scripts current in our suite and supply the execution standing.

Vital Observe – This step is essential earlier than beginning the combination with Jenkins, as a result of if it fails then we want to ensure to repair all the problems earlier than shifting it to the Jenkins server.

STEP – 04

Go to Jenkins, click on on New Merchandise as proven in beneath screenshot. This new merchandise will assist us create a brand new Jenkins job the place we will combine the automation suite which has all of the take a look at scripts for the regression suite.

STEP – 05

Present the identify for the Job, within the beneath screenshot we’ve got offered the venture identify as “UiAutomationG11” and choose “Maven Mission” click on on OK button. We have to realise that as our automation framework is in Maven so we’re deciding on Maven venture, if you’re utilizing Gradle then you need to choose accordingly.

Observe: All the time present a significant identify to the venture with correct naming conference.

STEP – 06

Go to Construct Choose “Invoke top-level Maven targets”, after which Enter the Targets as “clear take a look at” and put the pom.xml path of your venture within the “POM” part as proven beneath. Now click on on the “Save” button which is within the left backside part.

Keep in mind that as we’re utilizing it for demo so our pom.xml is in our native machine and we’re offering path of the venture within the POM part, however if you’re attempting to implement at venture degree then it’s good to combine your github repo hyperlink in Jenkins so the code can be pulled from repo instantly.

Step – 07

To Run the Suite Click on on Construct Now button as proven beneath, when you click on it should set off the automation suite and take a look at scripts will get executed. After the execution will get accomplished we will see the standing of the job run, and if it fails then the console output can be utilized to get the error logs for additional fixes.

Advantages

Under are a number of the most essential advantages of App Testing with Automation and Trendy CI pipelines.

Quicker Launch Cycle:
Pacing up the construct and testing cycle will enable the crew to get new options into manufacturing quicker, and it additionally helps to scale back the take a look at execution time exponentially by triggering from the pipeline. Pipeline helps the organisation to speed up the discharge charge with utmost high quality.

Maintains Excessive High quality:

All of the software program course of that features steady testing is on its method towards establishing a suggestions loop to go quick and construct efficient software program by making the automated suite a part of the pipeline.

As we run our suite after each change carried out by the event crew, it all the time gives a high quality test of each code pushed by the builders. The pipeline with steady testing builds high quality and reduces danger and waste within the software program growth lifecycle.

Conclusion

At current within the Agile world, QA just isn’t solely answerable for testing but in addition accountable to carry the testing on the identical tempo as launch builds. Automation and CI Pipelines are an integral a part of fashionable testing which must be introduced into each software program launch life cycle. Although creating Automated take a look at suites will take a while & cash however making it a part of the pipeline to run a validation on each deployment quickly pays for themselves.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments