Testing images with Cypress

  Рет қаралды 11,221

Ryan Toronto

Ryan Toronto

Күн бұрын

Today we'll write a test that asserts an image was correctly uploaded and displayed using Cypress.
isFixtureImage command: gist.github.co...

Пікірлер: 20
@rongreen3648
@rongreen3648 2 жыл бұрын
Well done. Nice clear progression from defining the problem to presenting and refining the solution. Thank you!
@danielmondragon2476
@danielmondragon2476 Жыл бұрын
Thank you so much for this. Nice way to explain it. I think that the assertion "be.visible" is still necessary because the image could have an opacity: 0 bug.
@RafalPe
@RafalPe 2 жыл бұрын
Nice & clear path to writing this test!
@fKH6599
@fKH6599 Жыл бұрын
Imagine we have a pdf file and we want to verify the logos, checkboxes, text inside this pdf. What should we do. I know how to verify text but dont know how compare or verify img and checkbox inside the pdg.
@prashanthipurnimasriram4183
@prashanthipurnimasriram4183 Жыл бұрын
Hi sir, Can you please suggest to me any snapshotting tool for both cypress e2e and component testing? Thanks🙏
@jyothiprasad5473
@jyothiprasad5473 2 жыл бұрын
Thanks for you video, I am getting error "cy.then() timed out after waiting 10000ms. Your callback function returned a promise that never resolved." I am trying to fix this but still can't get solution, can you help on this please
@githinjibonface8486
@githinjibonface8486 10 ай бұрын
Nice tutorial for testing images in ecommerce
@RyanToronto
@RyanToronto 10 ай бұрын
Thanks!
@KevinOld
@KevinOld 2 жыл бұрын
Great video, Ryan!
@randomgrinn
@randomgrinn 11 ай бұрын
You are lucky to live in the fantasy world where all your HTML has been re-written to use "data-*' tags. Back here in the real world of existing 10 year old code, I have spent 2 hours just trying to emulate your first cy.get("data-test=image") statement and am more than a bit frustrated.
@RyanToronto
@RyanToronto 11 ай бұрын
Sorry about that! Check out this page from Cypress about using test selectors that begin with data-*: docs.cypress.io/guides/references/best-practices#Selecting-Elements
@sindran126
@sindran126 2 жыл бұрын
If my expected screenshot is dynamic in actual manner (e.g):date and time how I could compare
@techfth710
@techfth710 2 жыл бұрын
super cypress knowedge i appreciate it
@dasabaja
@dasabaja 2 жыл бұрын
Hi. You're passing img as an array? .should([img]). In all other examples arguments in .should() or .then() are objects, not arrays. Example .should((img) = >{}) What is the difference? If I don't pass an array your example won't work. Why is that?
@RyanToronto
@RyanToronto 2 жыл бұрын
The syntax `.should(([img]) => ...)` is called argument destructing, it lets you take an array argument and assign its first element to a variable named "img". When you do ([first]) => console.log(first), it the same as doing: (array) => { let first = array[0]; console.log(first); } Destructing is an awesome feature of JavaScript, you can learn more about it here: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
@StephenRayner
@StephenRayner Жыл бұрын
Decent more! ❤
@lannguyen7460
@lannguyen7460 Жыл бұрын
😘
@camelion14
@camelion14 2 жыл бұрын
thanks for this greate work , what's your cypress version ? cause the methode that you're using [img] get me an error : Invalid attempt to destructure non-iterable instance
@RyanToronto
@RyanToronto 2 жыл бұрын
Hey there! I believe this video was made with Cypress 9.3.1. What's the value of the argument passed to the function? I'd double check that and make sure it's not null or anything that would prevent destructuring.
@camelion14
@camelion14 2 жыл бұрын
@@RyanToronto I think this is due to cypress version, I'm still in the 6.7.0. Thanks man for your reply
Cypress.io: Visual testing with plugins and Percy.io
20:19
Artem Bondar
Рет қаралды 10 М.
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Playwright: Visual testing
9:18
JoanMedia
Рет қаралды 4,5 М.
How to Build Effective AI Agents (without the hype)
24:27
Dave Ebbelaar
Рет қаралды 110 М.
Cypress database handling - Rainer Hahnekamp
44:12
German Cypress Community Meetup
Рет қаралды 6 М.
React 19: useActionState
36:58
Ryan Toronto
Рет қаралды 1,2 М.
How is this Website so fast!?
13:39
Wes Bos
Рет қаралды 1,3 МЛН
Cypress - Read from PDF files!
10:12
CommitQuality
Рет қаралды 2,1 М.
Visual UI testing with Percy.io + Cypress
16:36
Execute Automation
Рет қаралды 15 М.
File Upload in Cypress using Cypress-File-Upload package - Part -15
28:13
Naveen AutomationLabs
Рет қаралды 13 М.
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.