In this video, we're going to talk about the real time Foleo example, so in our last video, we saw
how we can make use of the Foleo and how we can create our own extended fixture to get the part of the
browsers that we have.
But in this video, we are going to see how we can use it in real time.
I mean, while we work with the playwright itself.
So, for example, if we need to extend the browser options with probably showing the browser every
time we run the test.
So as you know now a little video is what we tried to execute our test.
We saw that the browser was in in Headless State and we wanted it to be in an headful state.
So we need to specify that on the parameter.
So which was not correct.
Right.
I mean, we don't every time specify everything on the parameter side.
Sometimes we also should have the ability to control that test from the test runner in the fixture site
to specify that this is always an headful state test.
So we have to specify that in our earlier videos, we also discussed something like while we tried to
create the playwright with a browser settings, we said the Headful State or Hadleigh state as follows.
So that actually work because of something called as a browser option.
Context was there and that's why it was working fine.
But a problem like how we can extend the same thing using the Foleo to achieve the same operation of
the Hatful state.
So in order to do that, we can write code something like this.
As you can see here, what I'm doing is I have extended the folio pretty much like how we did on video.
So we just call the Foleo dot extend and then I just call this Foleo, that browser options and I'm
all writing the browser options in such a way.
This is pretty much exactly the same code.
We don't even require the adoption because we have not been used anywhere.
So we can just put the I of this empty phrases and then you can just call this as run or run test,
whatever it is, and then specify a weight off run.
And then I'm specifying as headless as true.
So this headless is basically for the browser options.
So you know that this browser option is a type which actually has these constants or variables like
headless or many different things like dev tools or something like that.
So everything's can be extended using the browser option.
So this is pretty cool.
So you can override the existing behavior of the playwright to set the hurdles as false.
And you can ask me like, can I also do something like set a device as like iPhone and maybe extend
even further then you can do that as well.
Very simply using this particular code.
So this like two.
All right.
You are doing basically when is for the browser.
Option one is for the context option where you are going to specify that I need to run my test on and
on screen with the devices, iPhone 11 or something like that.
So you're extending to things with the same fixture and then you are setting that particular value.
And then once you call the speaker fixture, pretty much like no video will be there actually creating
our own fixture.
Same concept, same idea.
And we could be able to run that aspect.
So this is the holistic picture of how you can extend or write your own code or extend your existing
playwrite code in a much, much easier fashion using the Foleo options.
So let's quickly see everything in action that whatever we have discussed in this particular lecture
in a much greater detail in our next video.