Boozang: Canvas testing

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
now I want to talk about canvas testing or more precisely test automation on top of the HTML canvas element this kind of testing is incredibly challenging because there's no way to look inside the canvas element so how can you do test automation on top of it this could be for instance JRA or Canan boards or things like this could be using a canvas element and having drag and drop of cards and things inside of it so always very challenging to do test automation on top of this what you usually do using the most test automation tools is you you would use an XY coordinate to create a drag drop event to another XY coordinate but these tests are of course known to be really really flaky and as soon as the windows change or the dimensions change these tests will break so I'm going to show you an alternative way to do this with if you go to the lab we have something called the canvas game and you can look here there's no cheating what you can see here is of course it's a canvas element and the game is we want to automate dragging this ball into the box and we get success okay the problem is what we want to emulate is that we can reset the position of this ball so of course we cannot use oh just go from the this x coordinate to this y coordinate now let me show how this will be done in busang with the new canvas testing feature I hit record I hit the reset button and I try to dve the ball into the box as you can see it creates a drag drop event ball to box where it reads in the canvas the name ball and box and now let's see as you can see it manages to drag the ball to the box and you can also do the validations the same way so basically by using the text of the elements inside the canvas you now have very stable selectors and let me illustrate I'm going to hit this reset many times now the ball is in a very difficult position and see that it does it every time so here with this way you can now do test automation on top of your canvas without the flakiness
Info
Channel: Boozang
Views: 35
Rating: undefined out of 5
Keywords:
Id: JhZ6QrVL3BU
Channel Id: undefined
Length: 2min 33sec (153 seconds)
Published: Tue Jun 18 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.