Careers   |   Events   |   Contact   |   402.238.1399   |   contactus@deliveron.com

Deliveron
Connect with us on FacebookConnect with us on LinkedInFollow Us on Twitter
Image Not Found.

Category List


Tag List

Nuget (1)
coded ui tests (6)
xunit (1)
Power BI (3)
ssas (2)
selinium (1)
mvvm (2)
alm (9)
Decisions (2)
Azure Functions (1)
sharepoint 2013 (6)
team foundation 2012 (2)
web performance tests (2)
visual studio code (1)
M Query (1)
Keith Holt (1)
IntelliSense (1)
dbpro (2)
requirements (2)
web (1)
Data Analytics (1)
site collections (2)
my work (2)
tfs (11)
sql server (2)
opensource (1)
rest assured (1)
onenote (4)
data warehousing (2)
tfs 2012 (4)
Meetings (1)
tls 1.2 (1)
REST (1)
faq (2)
angular 2 (3)
tfs 2013 (2)
agile (12)
asp.net-mvc (6)
necc (2)
test automation (1)
database publishing wizard (2)
team web access (2)
whitesource (1)
ssrs (4)
Visual Studio Online (6)
vsts (22)
API Tests (1)
lync (2)
CI (3)
AAD (2)
release management (7)
automatedui (1)
deliveron alm delivery guidance (2)
xaml (2)
team foundation server (6)
bi (2)
Azure (14)
certificates (2)
single page applicaiton (1)
razor (4)
installation (2)
github (1)
load tests (2)
tags (2)
webpack (1)
react (1)
continuous inegration (2)
TestArchitect (5)
nunit (1)
jquery (4)
microsoft alm rangers (2)
mstestv2 (1)
pdf (2)
Functions (2)
deliveron agile delivery process (2)
cascading-dropdown (2)
team deploy (2)
gherkin (2)
visual studio 2012 (10)
service-fabric (1)
c# (13)
exchange (2)
msi (2)
Big Data (2)
tfs odata (2)
netstandard (2)
DevOps (14)
ssl (1)
reporting (2)
zap (1)
sharepoint 2007 (2)
azure mobile services (2)
test cases (2)
test agent (2)
team foundation server 11 beta (2)
insiders (1)
burndown (2)
performancepoint services (2)
feedback (2)
Web API (1)
lunch and learn (2)
tfs 2017 (1)
association (1)
2013 (2)
artifacts (1)
webs (2)
Cosmos DB (1)
storyboarding (2)
preview (1)
business insight (2)
sharepoint 2010 (10)
sp1 (2)
fields (2)
microsoft test manager (2)
ARM Template (1)
asp.net-mvc-4 (2)
microsoft case study (2)
sql saturday (2)
database projects (4)
table-valued-parameters (4)
licensing (2)
web deploy (1)
pipelines (1)
example (2)
Business (2)
testing (5)
connect() (1)
adfs (3)
MSBuild (1)
DevSecOps (2)
pipeline (1)
visual studio 11 beta (2)
wit (2)
Collaboration (2)
MVP (2)
bdd (2)
continuous integration (2)
entity-framework (6)
fluentvalidation (2)
code-first (4)
asp.net-mvc-3 (4)
Java (1)
power tools (2)
OAuth2 (1)
TFS 2015 (6)
vsdbcmd (2)
Visual Studio 2017 (4)
Mike Douglas (4)
visual studio 2010 (18)
alm rangers (1)
dns (2)
PBI (1)
event-handling (2)
azure resource manager (1)
json (2)
HOLs (1)
visual studio (8)
alerts (2)
dependency-injection (2)
AzureAD (1)
subsites (2)
sql server 2008 (2)
wiki (1)
ninject (2)
spc14 (4)
outlook (2)
user profiles (4)
bundling (2)
gulp (2)
team foundation server 2012 (4)
sharepoint (5)
visual studio team services (1)
performance (3)
Quality (2)
application insights (2)
security (1)
deployment (2)
video (2)
Analytics (2)
Build (6)
MFA (1)
asp.net-mvc-routing (2)
Automated Testing (10)
home projects (1)
webcast (4)
nebraska code camp (2)
nintex (4)
Office 365 (1)
team build (2)
javascript (3)
selenium (4)
angular (1)
Document (1)
planning poker (4)
windows azure (2)
action-filters (2)
web application firewall (1)
scrum (8)
serverless (3)
whitelist (1)
Infrastructure (1)
tfs 2010 (2)
tips (2)
windows 8 store app (2)
silverlight (2)
business intelligence (2)
test controller (2)
workflow (2)
work item (2)
Powershell (1)
top 5 (1)
Template (1)
load testing (2)
lab management 2010 (2)
Multi-Factor Authentication (1)
webparts (2)
AzureAD Admins (1)
Node.js (1)
tokenization (1)
kanban (1)
lab environments (1)
powershell 2.0 (8)
owasp (3)
swagger (1)

Archive

Running REST Assured API Tests in VSTS Release Management

Mar 16, 2018

What is REST Assured?

REST Assured is a popular Java based open source tool for testing and validating REST services.  REST Assured uses Gherkin/Behavior Driven Development (BDD) language of given, when, then to create human readable executable specifications.  REST Assured has built in support for performing REST based actions and validating the results.  I have found it easy to use and read the tests.

Getting started with REST Assured

Maven is a tool used to create a standard way to build Java projects.  I have used Maven off and on over the years with Java development.  If you are new to Maven, I found this good tutorial for getting started with Maven. By following this tutorial, you will have a project you can begin using to create your REST Assured project.

Maven in 5 Minutes 

Once you have the project created, adding the REST Assured dependencies is straightforward and there are a number of tutorials that walk through this.  Here is the dependencies list.  You can also look at my github repo at https://github.com/Deliveron/sample-rest-assured-api-tests

maven-rest-assured-dependencies.jpg

Authoring and Running in VSCode

When opening the folder in VSCode, VSCode will recognize the Maven project using Java and JUnit and recommend several extensions to install.  I recommend doing accepting the recommendations.  This enabled VSCode to handle compiling, maven dependencies, intellisense, and even the test runner to run the REST Assured tests

vscode-extensions.jpg

The REST Assured tests are easy to author and using the given, when, then format provide human readable tests.  As you can see in the image below, with using a couple extensions VSCode can execute and track test results.

vscode-test-runner.jpg

Running Tests in Visual Studio Team Services (VSTS)

One advantage of running API tests over UI tests is that they are much faster.  This allows you run the tests as part of your software delivery pipeline to help ensure quality is maintained.  In VSTS, the API tests are typically run in Release Management after the application has been deployed.

vsts-release-tasks.jpg

To run the REST Assured tests, use the Maven task above.  Point the task to your POM.xml file.  This will compile the test code and execute the tests.

VSTS Hosted Build Agents

Microsoft offers Windows, Linux, and MacOS Hosted Build Agents platforms depending on your needs.  Some builds such as IOS require MacOS while others may need to run on Windows or Linux.  For running REST Assured API tests, Maven and Java are installed on all 3 of the Hosted Agents.  Regardless of the platform you need for your pipeline, you can run the REST Assured tests on any of the Hosted Agents.

The results of the REST Assured API tests are tracked with each release and you can use all of the built in features for managing the results including linking bugs and associating the tests back to requirements for traceability.  As you can see below you can measure quality by requirement.

vsts-test-results.jpg

If you are looking for a RESTful services friendly framework and can use Java, REST Assured is good tool for doing this.  REST Assured tests can easily be integrated into your VSTS Release for continuous delivery.

If you have any questions or comments, contact me on twitter at https://twitter.com/mikedouglasdev

 



Category: DevOps

Mike Douglas

user_avatar

He is a solution consultant focused on helping organization build high quality application effectively utilizing DevOps practices. He is a Microsoft DevOps / ALM Ranger and you can reach him on Twitter at @mikedouglasdev


We believe in helping our customers create software solutions in a better way.
We do this by having a project delivery process and technology expertise that ensures we are solving the right problem in the right way and driving the most business value.