DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
What's in store for DevOps in 2023? Hear from the experts in our "DZone 2023 Preview: DevOps Edition" on Fri, Jan 27!
Save your seat

Running Tests on Deployment

A member of the mabl team walks us through how to use their platform to make sure your API integrations went off without a hitch.

Anton Hristov user avatar by
Anton Hristov
·
Jan. 02, 19 · Tutorial
Like (2)
Save
Tweet
Share
6.87K Views

Join the DZone community and get the full member experience.

Join For Free

Integrating testing at every step of the DevOps pipeline helps us deliver the high-quality user experience we all strive for. We refer to this practice as DevTestOps, and, in this post, I will share some improvements we've made to mabl to provide you with more control over testing your Journeys on deployment using the Deployment Events API, which we also use as part of our Codeship build process.

Having automated tests that trigger on deployment helps developers to quickly validate that new code didn't cause any regressions as it makes its way across environments such as staging and production. It also gives peace of mind to QA engineers, product managers, and other business stakeholders that any issues are proactively resolved and everything continues to operate as expected. Some issues may only become evident in a production environment, so it's great when our tests can run on every deployment.

Here's what's new to the mabl Deployment Events API, or deployment API for short.

The Power of Labels

Labels are a great way to organize your mabl Journeys and Plans. For example, you can use labels to separate Plans that run smoke tests, feature tests, responsive design tests, etc. The automation power of labels lies in the ability to control which Plans execute in response to a deployment event by passing them as parameters to the deployment API. For example:

{
 "environment_id" : "your-env-id",
 "application_id" : "your-app-id",
 "plan_labels" : [ "smoke", "login" ]
 ...
}

In this example, only Plans containing at least one of the "smoke" and "login" labels will be executed. An easy way to test what will happen on deployment is to use the curl command builder to call the API.

(Note: If you don't see the same thing in your mabl environment as the screenshot above, this is because the above screenshot was taken from our dev environment. The Labels drop-down will make its way to production early next week.)

Here's what the generated curl command looks like with labels:

curl -s 'https://api.mabl.com/events/deployment' \     -u 'key:[YOUR_API_KEY]' \     -H 'Content-Type:application/json' \     -d '{"environment_id":"[YOUR_ENV_ID]","application_id":"[YOUR_APP_ID]","plan_labels":["smoke","login"]}'

In addition to labels, you can also use the deployment API to rebase the visual change models for the application or set a fixed baseline to compare against.

Creating a Fixed Visual Diff Baseline

There are times where you would like to review all visual changes, including dynamic content, that have occurred in the application UI after a given release. In such cases, you can use the deployment API to quickly create a new, fixed baseline for visual change detection by using the "Set as fixed baseline for visual change models" toggle in the curl command builder.

Note that in this case, you shouldn't toggle "Rebaseline visual change models" which will cause mabl to start rebuilding its visual models accounting for dynamic content areas and you will see results after several journey runs.

You can use the resulting curl command to trigger a new journey run for all Plans matching the command. This will capture new UI screenshots that will serve as a fixed baseline for visual comparison of subsequent journey runs. In that case, mabl will use the fixed baseline to highlight all visual diffs, including dynamic content areas, and present them to you for review. Thus, you can make sure that all visual changes are intentional and quickly identify anything that needs fixing.

To learn more about the deployment API, check out the docs and the following on-demand webinar. You can find the accompanying webinar slides on SlideShare. 

Testing

Published at DZone with permission of Anton Hristov, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Educating the Next Generation of Cloud Engineers With Google Cloud
  • Using QuestDB to Collect Infrastructure Metrics
  • Project Hygiene
  • Public Cloud-to-Cloud Repatriation Trend

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: