Table of Contents
Your crew has been doing the job on your new undertaking for months (with Laravel of program) and you are prepared to start the nice item you’ve got constructed. As you are starting up to style and design your advertising web-site, you are inescapable confronted with the dreaded undertaking of planning & having screenshots to showcase all the terrific capabilities & UX you’ve got built.
Screenshots are the excellent way to converse your product’s capabilities to people (let’s experience it, no one is reading through lengthy marketing and advertising copy any more). But they can be remarkably complicated and time consuming to prepare:
- You have to appear up with thoroughly crafted & wonderful on the lookout sample written content
- From time to time it really is important to get rid of particular features, update models & hide content to make matters clearer
- You could possibly require to resize your browser to a specified dimensions to match your site structure
- And then you have to choose the screenshots, rename documents, retail outlet them in your repo etcetera.
And then you will find updates. Modifying the layout of the app’s nav bar? Applying a coloration refresh? Including a important feature that impacts lots of areas of the application? You have to re-do all the screenshots, or take that your website bit by bit gets out of sync (and clients lacking all the new stuff you have been operating on).
For the web-site of our examination management tool Testmo we were on the lookout for a improved way to get ready, just take & preserve our advertising screenshots. We have numerous dozens of complex screenshots on our web page, and manually having & updating the screenshots was not an possibility for us. So automation to the rescue!
Screenshot Automation with Laravel Dusk
We are by now working with Laravel Dusk thoroughly for Testmo as portion of our exam automation suites to verify & test operation through browser automation. So why not also use Dusk to routinely get ready and take our advertising screenshots? As we started experimenting with this thought, the positive aspects turned apparent very swiftly:
- Creating excellent sample content is significantly less complicated from code: Specifically if you have a advanced UI with charts, dashboards and so on., it can be pretty difficult to manually set up your screenshots. From our Laravel Dusk code we can quickly use the inside versions of the app to put together and include good hunting sample info.
- Wonderful-tuning the UI by means of stylesheets & DOM changes: Typically occasions you have to have to clear away particular things or resize some information to make your screenshots clearer. As a substitute of obtaining to use Photoshop immediately after taking a screenshot to make improvements to items, you can now use stylesheets or make little adjustments to the DOM. This is a great deal easier and far more adaptable.
- Incorporating placeholders & text bars: You want to hold screenshots uncomplicated to understand for your site people. Which is why a lot of advertising web-sites insert placeholders and grey bar overlays to screenshots to cover way too in depth textual content components. This is again a lot much easier to do from code and saves tons of time in article-processing.
- Consistent browser & screenshot sizes: If you on a regular basis have to update screenshots, it can be really bothersome to try out to match the exact same screenshot dimensions all over again. Placing the browser dimension from Laravel Dusk is trivial, so you can have regular screenshot sizes outlined in your code.
- Cropping to things with dynamic resizing: Alternatively, if you want to choose screenshots of specific features of your UI only, you can also effortlessly crop your screenshots to certain DOM components (centered on their coordinates & sizing calculated by Dusk). Now if you update your UI in the long run (and the size or place of things modify), your screenshots will often flawlessly match your new design.
Far more Examples & Laravel Screenshot Ideas
Quite considerably any screenshot on our internet site has been automated with Laravel Dusk now, so we can just update our screenshots when we want with a number of keystrokes. For far more examples, acquire a search at our test case administration and exploratory screening tour webpages, which cover & highlight significant characteristics of our solution.
We have also posted a much more detailed post with further code samples & recommendations on what we have learned from automating our screenshots:
This guest posting was created by Dennis Gurock, just one of the founders of Testmo. Testmo is constructed employing Laravel and will help groups deal with all their software program assessments in one modern platform. If you are not familiar with QA tools, Testmo not long ago posted various resource guides to get begun: