In the past, Quality Assurance (QA) teams have relied on manual checks to look for visual issues, while testing on large and dynamic websites. However, with so many sites and features being added to the websites, this approach has proven time and resource intensive while also allowing critical visual bugs to slip into live websites causing brand damage and a poor digital experience for visitors.
Join this exciting webinar to learn:
How Cypress Evangelist, Christine Pinto, used custom commands she’d created and discovered to hack her Cypress test suite with Applitools’ AI to make it more stable & reliable.
How to deal with lazy-loading images to create reliable visual baselines in Cypress.
The DOM is detached, where did it go and how can we deal with it in Cypress.
2. 01
DOM is Detached
Where did it go and
how can we deal
with it
Parallel CI Builds
How to combine
them into one test
manager batch
Lazy-Loading
How to win the
battle with lazy-
loading images for a
visual test
02 03
8. cy.document().then((doc) => {
const height =
doc.body.scrollHeight;
for (let i = 0; i <= height; i += 100) {
cy.scrollTo(0, i);
cy.wait(100);
}
});
Answer: slow scrolling
9. Another method for slow
scrolling
cy.get("#editor-viewport").then($view => {
for (let i = 10; i <= 100; i += 10) {
let start = i - 10 + "%";
let l = i + "%";
cy.get("#editor-viewport").scrollTo(start, l);
cy.wait(100);
}
});
21. Indicate to Applitools when all of the
parallel builds have been completed
curl -d '' -X POST
https://eyesapi.applitools.com/api/externals/github/servers/githu
b.com/commit/$APPLITOOLS_BATCH_ID/complete?apiKey=$APP
LITOOLS_API_KEY
Source: https://applitools.com/blog/google-cloud-
build/
22. “First do it, then do it
right, then do it
better.”
By Addy Osmani
23. CREDITS: This presentation template was
created by Slidesgo, including icons by Flaticon,
and infographics & images by Freepik.
THANKS!
Do you have any questions?
pinto.christine@outlook.com
Twitter: @ChrisPint_
https://github.com/ChrisPint
Race condition
The red flag in this case is that clicking manually after the test has failed works. If the application fails to respond correctly to the “click” event during the Cypress test, but handles the click correctly after, the problem is likely that the application was slow to respond, while Cypress was fast to act. In this case, when the framework shows the calendar modal, it starts attaching the event listeners to the DOM elements. However before the event listeners are attached, Cypress manages to find the DOM element with the required date and click on it. The “click” goes nowhere, since we know:
If a tree falls in the forest and no one has attached a “fall” event listener, did it really fall?
In our case, there was probably an event listener already attached and ready to process the actual click on a date element (that’s why the date is changing, even if the modal stays open), but no event listener has been attached yet to close the modal. Our test runner is getting ahead of the web application in this particular case.