1
00:00:00,180 --> 00:00:05,070
In this video, we're going to talk about the real time Foleo example, so in our last video, we saw

2
00:00:05,070 --> 00:00:13,590
how we can make use of the Foleo and how we can create our own extended fixture to get the part of the

3
00:00:13,590 --> 00:00:14,870
browsers that we have.

4
00:00:15,360 --> 00:00:19,240
But in this video, we are going to see how we can use it in real time.

5
00:00:19,290 --> 00:00:21,650
I mean, while we work with the playwright itself.

6
00:00:21,870 --> 00:00:27,210
So, for example, if we need to extend the browser options with probably showing the browser every

7
00:00:27,210 --> 00:00:28,150
time we run the test.

8
00:00:28,170 --> 00:00:31,660
So as you know now a little video is what we tried to execute our test.

9
00:00:31,680 --> 00:00:37,290
We saw that the browser was in in Headless State and we wanted it to be in an headful state.

10
00:00:37,470 --> 00:00:39,840
So we need to specify that on the parameter.

11
00:00:39,990 --> 00:00:41,090
So which was not correct.

12
00:00:41,100 --> 00:00:41,310
Right.

13
00:00:41,340 --> 00:00:45,060
I mean, we don't every time specify everything on the parameter side.

14
00:00:45,120 --> 00:00:53,520
Sometimes we also should have the ability to control that test from the test runner in the fixture site

15
00:00:53,520 --> 00:00:57,380
to specify that this is always an headful state test.

16
00:00:57,390 --> 00:01:02,760
So we have to specify that in our earlier videos, we also discussed something like while we tried to

17
00:01:02,880 --> 00:01:11,000
create the playwright with a browser settings, we said the Headful State or Hadleigh state as follows.

18
00:01:11,190 --> 00:01:15,710
So that actually work because of something called as a browser option.

19
00:01:15,720 --> 00:01:18,090
Context was there and that's why it was working fine.

20
00:01:18,090 --> 00:01:25,590
But a problem like how we can extend the same thing using the Foleo to achieve the same operation of

21
00:01:25,590 --> 00:01:26,830
the Hatful state.

22
00:01:27,150 --> 00:01:30,150
So in order to do that, we can write code something like this.

23
00:01:30,180 --> 00:01:36,390
As you can see here, what I'm doing is I have extended the folio pretty much like how we did on video.

24
00:01:36,390 --> 00:01:44,190
So we just call the Foleo dot extend and then I just call this Foleo, that browser options and I'm

25
00:01:44,220 --> 00:01:46,900
all writing the browser options in such a way.

26
00:01:46,950 --> 00:01:49,250
This is pretty much exactly the same code.

27
00:01:49,260 --> 00:01:52,430
We don't even require the adoption because we have not been used anywhere.

28
00:01:52,830 --> 00:01:59,150
So we can just put the I of this empty phrases and then you can just call this as run or run test,

29
00:01:59,160 --> 00:02:02,880
whatever it is, and then specify a weight off run.

30
00:02:03,210 --> 00:02:06,650
And then I'm specifying as headless as true.

31
00:02:06,660 --> 00:02:10,050
So this headless is basically for the browser options.

32
00:02:10,050 --> 00:02:19,260
So you know that this browser option is a type which actually has these constants or variables like

33
00:02:19,260 --> 00:02:22,650
headless or many different things like dev tools or something like that.

34
00:02:22,860 --> 00:02:26,380
So everything's can be extended using the browser option.

35
00:02:26,410 --> 00:02:27,560
So this is pretty cool.

36
00:02:27,570 --> 00:02:34,650
So you can override the existing behavior of the playwright to set the hurdles as false.

37
00:02:35,100 --> 00:02:42,990
And you can ask me like, can I also do something like set a device as like iPhone and maybe extend

38
00:02:42,990 --> 00:02:46,360
even further then you can do that as well.

39
00:02:46,500 --> 00:02:48,970
Very simply using this particular code.

40
00:02:49,230 --> 00:02:51,090
So this like two.

41
00:02:51,090 --> 00:02:51,680
All right.

42
00:02:51,710 --> 00:02:53,430
You are doing basically when is for the browser.

43
00:02:53,430 --> 00:02:58,960
Option one is for the context option where you are going to specify that I need to run my test on and

44
00:02:58,960 --> 00:03:02,250
on screen with the devices, iPhone 11 or something like that.

45
00:03:02,460 --> 00:03:07,560
So you're extending to things with the same fixture and then you are setting that particular value.

46
00:03:07,560 --> 00:03:12,840
And then once you call the speaker fixture, pretty much like no video will be there actually creating

47
00:03:12,840 --> 00:03:13,680
our own fixture.

48
00:03:14,160 --> 00:03:15,840
Same concept, same idea.

49
00:03:16,050 --> 00:03:17,970
And we could be able to run that aspect.

50
00:03:17,990 --> 00:03:25,260
So this is the holistic picture of how you can extend or write your own code or extend your existing

51
00:03:26,370 --> 00:03:31,920
playwrite code in a much, much easier fashion using the Foleo options.

52
00:03:33,400 --> 00:03:37,480
So let's quickly see everything in action that whatever we have discussed in this particular lecture

53
00:03:37,630 --> 00:03:39,910
in a much greater detail in our next video.
