Starting this lecture, we are going to talk about creating a mechanism in place.
We already talked about a lot about locators and how to work with different controls and how playwrite
Seelie actually identifies the control.
And those informations are almost enough for us to work with an EUA component, which is pretty cool.
I mean, those mechanisms that we discuss right now is already handy for us to work with and uncontrolled,
which is pretty awesome for us to get started with the basics of playwrite and also most of the advanced
concepts of playwrite while working with some of the advanced UI controls.
But there are also some of the important situations where we need to wait for a control operation to
be completed.
But so far, within our record, you might have seen that we have not performed any weighting mechanism
in our playwrite.
All those things are automatically somehow handled within our code.
Right.
Have you ever seen that I have written any sleep operation or evade operation in playwrite?
We have noted that because playwrite has automatic weighting in place, which checks most of the boxes
for you to explicitly wait for an event to happen.
Which is pretty cool because Playwrite calls this as an actionability check, which is nothing.
But Playwrite does a range of action to check on the element before performing certain actions.
So these checks ensure that the action behaves as expected.
For example, Playwrite does not click on a disabled button.
So these are some of the things which playwrite does for us automatically already out of the box.
And we don't really have to perform a weight operation or waiting for an element to be enabled or something
like that.
So those things are going to be taken care for you by playwrite, which is pretty cool.
And there are a range of rate mechanism available on the playwright.
And as it said, if you talk about the playwright's actionability check, it's going to look something
like this.
As you can see over here, Playwrite performs a list of check before it performs a check operation.
So if you see there is a check operation, it is going to perform a check, something like visibility's
stable, enabled receiving events and a test.
And similarly, for performing a click operation, it's going to do all these operations.
And similarly for a Double-Click operation is going to perform all these operations.
And for tap and uncheck, this is going to be all the operation which is going to perform.
So these operations are going to be performed for you every time it's going to perform an action, something
like this, certainly for the holer action is going to perform these operations or these checks before
it's going to perform that particular action.
Similarly for the these actions have been taken care of and stuff.
So these are some of the cool things which is already there for you within playwrite as an actionability
check.
And these are very, very handy while working with the other controls.
And there are many other weighting mechanism which is also available.
If you don't really have those right to find, you can also define that, for example, the pairs navigate
weight actually has something called as wait until where you can tell that whether you are navigating
with a different page, just wait for the DOM content to be loaded or the load operation is complete
or the ideal is fully complete or something like that.
So these are the other weighting mechanism which is there on the page level, like page navigation level
mechanism.
And for the page level rating, there is also different events available, something like wait for the
event, wait for function, wait for load states, wait for navigation, wait for request, wait for
response, wait for select hour, wait for time or something like that.
So even these different wait mechanisms are already there within puppeteer playwrite, which helps you
to actually perform a operation.
I mean, these are very, very handy while working with a control, even though actionability after
playwrite is going to take care of everything for us.
There are some situations where we are going to be where we may need to wait for the response from the
are to be resolved.
Then we can wait for a response to be fully resolved and then perform the next operation, something
like that.
So this will speed up our automation a bit more than just waiting or laying on the actionability.
That is also in no way after property in all the operation like click type or fill operation.
This will help you to tell that.
Just don't wait for this operation like this at three thousand milliseconds and something like that.
I mean, there are some exceptional cases where you can do that.
But yes, there is another property which you can use to override the waiting mechanism.
So these are the different weighting mechanisms available within playwrite.
And we will see a few of them in our next lecture.