1
00:00:00,180 --> 00:00:03,530
Starting this lecture, we are going to talk about creating a mechanism in place.

2
00:00:03,820 --> 00:00:10,500
We already talked about a lot about locators and how to work with different controls and how playwrite

3
00:00:10,500 --> 00:00:12,690
Seelie actually identifies the control.

4
00:00:12,690 --> 00:00:19,140
And those informations are almost enough for us to work with an EUA component, which is pretty cool.

5
00:00:19,170 --> 00:00:24,780
I mean, those mechanisms that we discuss right now is already handy for us to work with and uncontrolled,

6
00:00:24,960 --> 00:00:30,600
which is pretty awesome for us to get started with the basics of playwrite and also most of the advanced

7
00:00:30,720 --> 00:00:34,680
concepts of playwrite while working with some of the advanced UI controls.

8
00:00:34,830 --> 00:00:41,370
But there are also some of the important situations where we need to wait for a control operation to

9
00:00:41,370 --> 00:00:42,360
be completed.

10
00:00:42,600 --> 00:00:49,470
But so far, within our record, you might have seen that we have not performed any weighting mechanism

11
00:00:49,470 --> 00:00:50,270
in our playwrite.

12
00:00:50,640 --> 00:00:54,550
All those things are automatically somehow handled within our code.

13
00:00:54,570 --> 00:00:54,930
Right.

14
00:00:55,140 --> 00:01:01,680
Have you ever seen that I have written any sleep operation or evade operation in playwrite?

15
00:01:01,680 --> 00:01:08,430
We have noted that because playwrite has automatic weighting in place, which checks most of the boxes

16
00:01:08,430 --> 00:01:12,330
for you to explicitly wait for an event to happen.

17
00:01:12,330 --> 00:01:18,690
Which is pretty cool because Playwrite calls this as an actionability check, which is nothing.

18
00:01:18,690 --> 00:01:25,180
But Playwrite does a range of action to check on the element before performing certain actions.

19
00:01:25,190 --> 00:01:30,180
So these checks ensure that the action behaves as expected.

20
00:01:30,270 --> 00:01:33,590
For example, Playwrite does not click on a disabled button.

21
00:01:33,600 --> 00:01:38,790
So these are some of the things which playwrite does for us automatically already out of the box.

22
00:01:38,970 --> 00:01:44,310
And we don't really have to perform a weight operation or waiting for an element to be enabled or something

23
00:01:44,310 --> 00:01:44,600
like that.

24
00:01:44,610 --> 00:01:49,290
So those things are going to be taken care for you by playwrite, which is pretty cool.

25
00:01:49,620 --> 00:01:53,250
And there are a range of rate mechanism available on the playwright.

26
00:01:53,400 --> 00:01:58,320
And as it said, if you talk about the playwright's actionability check, it's going to look something

27
00:01:58,320 --> 00:01:59,100
like this.

28
00:01:59,100 --> 00:02:07,100
As you can see over here, Playwrite performs a list of check before it performs a check operation.

29
00:02:07,110 --> 00:02:13,230
So if you see there is a check operation, it is going to perform a check, something like visibility's

30
00:02:13,230 --> 00:02:16,920
stable, enabled receiving events and a test.

31
00:02:17,220 --> 00:02:22,530
And similarly, for performing a click operation, it's going to do all these operations.

32
00:02:22,530 --> 00:02:26,490
And similarly for a Double-Click operation is going to perform all these operations.

33
00:02:26,490 --> 00:02:30,380
And for tap and uncheck, this is going to be all the operation which is going to perform.

34
00:02:30,390 --> 00:02:36,000
So these operations are going to be performed for you every time it's going to perform an action, something

35
00:02:36,000 --> 00:02:44,490
like this, certainly for the holer action is going to perform these operations or these checks before

36
00:02:44,490 --> 00:02:46,350
it's going to perform that particular action.

37
00:02:46,380 --> 00:02:49,550
Similarly for the these actions have been taken care of and stuff.

38
00:02:49,560 --> 00:02:55,740
So these are some of the cool things which is already there for you within playwrite as an actionability

39
00:02:55,740 --> 00:02:56,040
check.

40
00:02:56,250 --> 00:02:59,730
And these are very, very handy while working with the other controls.

41
00:03:00,480 --> 00:03:03,570
And there are many other weighting mechanism which is also available.

42
00:03:03,570 --> 00:03:10,350
If you don't really have those right to find, you can also define that, for example, the pairs navigate

43
00:03:10,350 --> 00:03:17,070
weight actually has something called as wait until where you can tell that whether you are navigating

44
00:03:17,070 --> 00:03:22,830
with a different page, just wait for the DOM content to be loaded or the load operation is complete

45
00:03:23,070 --> 00:03:25,790
or the ideal is fully complete or something like that.

46
00:03:25,800 --> 00:03:32,910
So these are the other weighting mechanism which is there on the page level, like page navigation level

47
00:03:33,090 --> 00:03:33,810
mechanism.

48
00:03:34,200 --> 00:03:41,160
And for the page level rating, there is also different events available, something like wait for the

49
00:03:41,160 --> 00:03:47,490
event, wait for function, wait for load states, wait for navigation, wait for request, wait for

50
00:03:47,490 --> 00:03:51,260
response, wait for select hour, wait for time or something like that.

51
00:03:51,270 --> 00:03:59,190
So even these different wait mechanisms are already there within puppeteer playwrite, which helps you

52
00:03:59,370 --> 00:04:02,610
to actually perform a operation.

53
00:04:02,850 --> 00:04:08,730
I mean, these are very, very handy while working with a control, even though actionability after

54
00:04:08,730 --> 00:04:11,340
playwrite is going to take care of everything for us.

55
00:04:11,640 --> 00:04:18,780
There are some situations where we are going to be where we may need to wait for the response from the

56
00:04:19,200 --> 00:04:20,910
are to be resolved.

57
00:04:20,910 --> 00:04:26,700
Then we can wait for a response to be fully resolved and then perform the next operation, something

58
00:04:26,700 --> 00:04:27,050
like that.

59
00:04:27,150 --> 00:04:31,830
So this will speed up our automation a bit more than just waiting or laying on the actionability.

60
00:04:32,100 --> 00:04:39,990
That is also in no way after property in all the operation like click type or fill operation.

61
00:04:40,110 --> 00:04:41,580
This will help you to tell that.

62
00:04:42,420 --> 00:04:48,090
Just don't wait for this operation like this at three thousand milliseconds and something like that.

63
00:04:48,090 --> 00:04:51,060
I mean, there are some exceptional cases where you can do that.

64
00:04:51,060 --> 00:04:56,010
But yes, there is another property which you can use to override the waiting mechanism.

65
00:04:56,010 --> 00:04:59,910
So these are the different weighting mechanisms available within playwrite.

66
00:05:00,090 --> 00:05:02,520
And we will see a few of them in our next lecture.
