In this video, we're going to discuss about Foleo command line parameters and understanding workers
in playwrite structures.
So the Foleo parameters are one of the another important construct that we can use while working with
the foliar test execution, using the playwright test runners.
It is common to run the test in a different configuration.
For example, running a Web application test against multiple browsers or multiple configurations or
running test on two different API versions is very, very common.
And most of the time we end up doing that within our configuration file is in our test files.
But Foleo supports this where a perimeter's, which means we can now define a parameters and start using
it in a test or in a fixture level.
So we now have a control over the parameters on the Foleo itself so that we can run different versions.
So as you can see this little bit of code, this is pretty much exactly the same kind of code that we
wrote earlier, like how we created a type of browsers with Chrome, Firefox and Edge in the earlier
code.
This is exactly the same thing, but just that this time and parsing a browser and a version there and
trying to initialize or set a default value for the version using the init parameters of the fixtures
that I'm setting, the browser version of Eighty-six and then AM also.
Initializing the browser in such a way that if the version is greater than 80, then just give me a
message saying they're running, you're running the latest version of browsers and I use a new driver
or something like that.
Or if you think that older version, if you're using the parameter to pass the older version, like
80, maybe like 82 or something like that, or maybe like 78 or something like that, then probably
get a different message, something like that.
I'm just this is like a hypothetical codebase, basically, and then it's just going to give you this
message and it's also going to show you the current version that you are passing in something.
But the most important thing that you need to note is the scope as a worker.
So we have not seen the school bus worker so far, but most of the time, well, we execute our test
on the command line.
We always see something like running the test, running three test and three workers.
So what does this worker basically is?
Basically, once you run the test, the tester also invokes a worker which does the operations for you
so you can assign the worker for running a server if you want or if you want to run a Apicella in the
backend or a database overconnectivity on the backend.
So you can use this worker as a place to spawn your execution service, something like that.
And then you can consume these services from your test itself.
So these are some of the coolest thing that you can actually do from Fallujah.
And Foleo does a lot of hard work for you in order for your test to make more simpler, but making it
look more simpler so that the Foleo can actually take all those hard things behind the scene.
And this is exactly what we have done in here, just that once you initialize the browser, it is going
to initialize all these things for you like versions of a in like 80.
Then it's going to run the test based on which versions of the browser that you're looking for.
So this is what it is.
And this is like a very high level that we're going to be discussing in a hypothetical situation.
But you can create your own Foleo a parameter like how it is defined in here.
Well, as that said, while we call this particular test, we are going to call the test in a command
line using a different parameter this time, something like this.
So we're going to say like in Foleo and the work of that spectators is basically the test file.
And you're going to specify hyphen P version is equal to 80, which means if you specify version is
go to 80, which means it is going to execute the browser test on that particular version and then is
going to print the value because it's 80 is lesser than the newer version are pretty equal to that.
That is going to give us a different message that, you know, it's been typed over here.
Right.
And then if you want to run the same test on two different workers, let's say two different test,
that is also possible if we try to run a command, something like this so we can pass Inpex foliar worker
spec.
Yes, hyphen P version is 80 and then hyphen P version is called the Eighty-three.
So now we have two different workers going to be despond to run our same test and we can run the test
on two different workers, which is also super easily possible using this particular Foleo parameters.
So we'll discuss everything in action and understand how things work.
Media in our next video to discuss the practical way.