Puppetry 2.0 released

Automated Testing

Eventually Puppetry 2.0 was released. The development took for a while, yet it contains a lot of changes. In fact the branch 1.x was basically a GUI for Puppeteer/Jest, but the tool grew up into a fully-fledged testing environment.

Puppetry 2

Now Puppetry has a built-in templating engine, which supports environment-dependent variables and expressions, what brings a great potential. Just consider: you have test/stage service, which never resets. The only way to test, let’s say, signup flow is to create a new (no-yet-existing) user account. Now we can refer from our test cases to a variable like TEST_EMAIL defined as joe.test{{ counter() }}@acme.com, what resolves in [email protected], [email protected] and so on, iterating with every test run. Or let’s take another example – in the test case we have to fill out a form. Why not to let Puppetry be creative? A user name? Take it: {{ faker(“name. firstName “, “en “) }} {{ faker(“name. lastName “, “en “) }}. A comment field? {{ faker(“lorem. paragraph”, “en “) }}.

Template expressions also opened a way for such test scenarios as sign up with confirmation by email. A new page method assignVarRemotely polls a specified mail-service API until the confirmation email received, parses out the activation link and assign it to a template variable. So we can simply refer to the variable from page.goto to follow the activation link.

What’s more, we’ve got reusable and configurable test scenarios (snippets). So instead of composing again and again a repeating sequence of test steps (like login flow), we can simply refer to a predefined snippet. What it makes even more exciting, we can provide the reference with executing context. For example, we can call login snippet every time with different user credentials.

As for managing assets (targets, groups, test cases and test steps). We could already move and clone them in 1.x branch, but now it’s possible to copy/paste literally everything. And what’s most exciting, it works also across projects. On copying the system clipboard receives a plain JSON object describing the data to transfer. So we can copy/paste even between different instances of Puppetry app.

What I’m especially happy about - the online documentation. While working on it I came up with an explicit vocabulary and it encouraged consistency across UIs.

And yes, Puppetry obtained a built-in recorder, what makes it easier to turn a generic user flow into a ready suite.

Last but not least, GIT integration. Test projects, similar to any others, are subjects of collaboration. Now we can link a project to a remote repository (e.g. Gitlab, Github, Bitbucket) and work on it in a team, without fear of losing changes.

So 2.0 is out and I wish you a good puppeting!