Boa Constrictor is the .NET Screenplay Pattern. It helps you make higher interactions for higher check automation!

I initially created Boa Constrictor beginning in 2018 because the cornerstone of PrecisionLender‘s end-to-end check automation venture. In October 2020, my staff and I launched it as an open supply venture hosted on GitHub. Since then, the Boa Constrictor NuGet bundle has been downloaded over 44K occasions, and my staff and I’ve shared the venture by way of a number of convention talks and webinars. It’s superior to see the venture actually take off!

Unfortunately, Boa Constrictor has had little or no improvement over the previous 12 months. The newest launch was model 2.0.0 in November 2021. What occurred? Well, first, I left Q2 (the corporate that acquired PrecisionLender) to hitch Applitools, so I personally was not engaged on Boa Constrictor as a part of my day job. Second, Boa Constrictor didn’t want a lot improvement. The core Screenplay Pattern was well-established, and the interactions for Selenium WebDriver and RestSharp had been battle-hardened. Even although we made no new releases for a 12 months, the venture remained alive and nicely. The staff at Q2 nonetheless makes use of Boa Constrictor as a part of hundreds of check iterations per day!

The time has now come for brand new improvement. Today, I’m excited to announce our plans for the subsequent part of Boa Constrictor! In this text, I’ll share the imaginative and prescient that the core contributors and I’ve for the venture – tentatively casting it as “model 3.” We can even share a tough timeline for improvement.

Separate interplay packages

Currently, the Boa.Constrictor NuGet bundle has three most important components:

  1. The Screenplay Pattern’s core interfaces and courses
  2. Interactions for Selenium WebDriver
  3. Interactions for RestSharp

This construction is handy for a check automation venture that makes use of Selenium and RestSharp, however it forces initiatives that don’t use them to tackle their dependencies. What if a venture makes use of Playwright as an alternative of Selenium, or RelaxationAssured.NET as an alternative of RestSharp? What if a venture desires to make totally different sorts of interactions, like cell interactions with Appium?

At its coronary heart, the Screenplay Pattern is a generic sample for any sort of interactions. In idea, the core sample shouldn’t favor any specific software or bundle. Anyone ought to be capable of implement interplay libraries utilizing the core sample.

With that in thoughts, we intend to separate the present Boa.Constrictor bundle into three separate packages, one for every of the prevailing components. That method, a venture can declare dependencies solely on the components of Boa Constrictor that it wants. It additionally permits us (and others) to develop new packages for various sorts of interactions.

Playwright help

One of the brand new interplay packages we intend to create is a library for Playwright interactions. Playwright is a unbelievable new net testing framework from Microsoft. It supplies a number of benefits over Selenium WebDriver, equivalent to quicker execution, automated ready, and hint logging.

We need to give folks the flexibility to decide on between Selenium WebDriver or Playwright for his or her net UI interactions. Since a check automation venture would use just one, and since there could possibly be overlap within the names and forms of interactions, separating interplay packages as detailed within the earlier part can be a prerequisite for creating Playwright help.

We can also attempt to develop an adapter for Playwright interactions that makes use of the identical interfaces as Selenium interactions so that people may swap from Selenium to Playwright with out rewriting their interactions.

Applitools help

Another new interplay bundle we intend to create is a library for Applitools interactions. Applitools is the premier visible testing platform. Visual testing catches UI bugs which can be troublesome to catch with conventional assertions, equivalent to lacking parts, damaged styling, and overlapping textual content. A Boa Constrictor bundle for Applitools interactions would make it simpler to seize visible snapshots along with Selenium WebDriver interactions. It would even be an “optionally available” characteristic since it might be its personal bundle.

Shadow DOM help

Shadow DOM is a method for encapsulating components of an internet web page. It permits a hidden DOM tree to be hooked up to a component within the “common” DOM tree in order that totally different components between the 2 DOMs don’t conflict. Shadow DOM utilization has turn out to be fairly prevalent in net apps as of late.

We intend so as to add help for Selenium interactions to pierce the shadow DOM. Selenium WebDriver requires additional calls to pierce the shadow DOM. Unfortunately, Boa Constrictor’s Selenium interactions presently don’t help shadow DOM interactivity. Most seemingly, we’ll add new builder strategies for Selenium-based Tasks and Questions that absorb a locator for the shadow root factor after which replace the motion strategies to deal with the shadow DOM if needed.

.NET 7 targets

The most important Boa Constrictor venture, the unit exams venture, and the instance venture all goal .NET 5. Unfortunately, NET 5 is now not supported by Microsoft. The newest launch is .NET 7.

We intend so as to add .NET 7 targets. We will make the library packages goal .NET 7, .NET 5 (for backwards compatibility), and .NET Standard 2.0 (once more, for backwards compatibility). We will change the unit check and instance initiatives to focus on .NET 7 solely. In reality, we now have already made this transformation in model 2.0.2!

Dependency updates

Many of Boa Constrictor’s dependencies have launched new variations over the previous 12 months. GitHub’s Dependabot has additionally flagged some safety vulnerabilities. It’s time to replace dependency variations. This is commonplace periodic upkeep for any venture. Already, we now have up to date our Selenium WebDriver dependencies to model 4.6.

Documentation enhancements

Boa Constrictor has a doc website hosted utilizing GitHub Pages. As we make the adjustments described above, we should additionally replace the documentation for the venture. Most notably, we might want to replace our tutorial and instance venture, because the packages can be totally different, and we can have help for extra sorts of interactions.

What’s the timeline?

The core contributors and I plan to implement these enhancements inside the subsequent three months:

  • Today, we simply launched two new variations with incremental adjustments: 2.0.1 and a couple of.0.2.
  • This week, we hope to separate the prevailing bundle into three, which we intend to launch as model 3.0.
  • In December, we’ll refresh the GitHub Issues for the venture.
  • In January, the core contributors and I’ll host an in-person hackathon (a “Constrictathon”) in Cary, NC.

There is tons of labor forward, and we’d love so that you can be part of us. Check out the GitHub repository, learn our contributing information, and be part of our Discord server!

Source link