So before we actually finish this particular section or into this section to move to the playwright
drummer, I noticed two things that we need to address.
The first one is my blunder mistake, which was I just named the particular project as the Udemy puppeteer
basic.
For some reason it's actually Udemy playwrite, basically.
It's not your puppeteer, which was my bad actually, because the reason why I was giving this Asuda
Udemy perpetuate itself is because we already had two folders within my directory and instead of giving
us Udemy playwrite because you remember we gave this udemy puppeteer in our earlier section like section
one.
So I just used the same thing while doing the rename the tab.
It just became a security puppeteer.
But I was actually but actually I was trying to call this a pseudo playwright and it became like a puppeteer
for some reason.
Sorry about that.
It was my bad and it is actually Udemy right now, dude.
I mean, puppeteer BASIX or whatever we discussed before is Udemy is basically a playwright called,
so it's not puppeteer.
But right now what I'm going to do is we are actually going to look at the Udemy puppeteer folder itself,
that the project that we earlier discussed sort of confused about it.
I just wanted to show you a new feature which is already there in Puppet.
Just nothing.
But the just puppeteer is nothing but a destroyer which is available in puppeteer.
I just wanted to show you in this section so that you can refrain it while we talk about it in our next
section about the playwright Pastrana.
So puppeteer team, they introduced a test runner and they called us Just Puppeteer, which is like
a test runner.
I just wanted to show you that before we talk about the playwright testing on our next section, because
you will get an idea of what Destrehan is, because all these days we have been running tests only using
this particular atto functions.
And this is not the method that we always try to run a whole test like this, like wrapping up everything
over here.
We'll be writing a more better and perfect way, and that's what we will be doing in this particular
section.
But before that, I also wanted to show you what is just puppeteers and stuff.
So if I go to this particular website, like, just start, I just so this is a test run which is going
to be useful or for many different frameworks like not just like puppeteer, but also the support many
different tools like puppeteer, Mongo DB dynamic that pack like modules, Marte's and stuff like that,
support of almost many things.
And for the puppeteer they do support using what is called just puppeteer.
So this is like another type of rapport which the team is actually supporting as well.
So if you go to this particular just a puppeteer, you can see that they have some sort of features
over here.
They also are looking for some maintainers.
I mean, it looks like this particular rapport is not very actively maintained.
And that's the reason Playwrite Pastrana is amazing, which we're talking about the next election.
But I just wanted to give you a heads up before we actually talk about the playwright itself so you
can see that the setting up is kind of a bit more strange in this particular just puppeteer.
But I just wanted to quickly get into that and I will show you what I really mean.
So if I just go to the Udemy, I mean, for the first time, I will just go correctly to Udemy la puppeteer.
This is what we need to go.
I think it's the puppeteer demo, and then if I just go to the cord exploration dot that's going to
open the project for us over here, you can see that this is the enemy puppeteer demo.
So this is correct folder.
This is the thing that we discussed in Section one.
And over here, we're going to actually do a couple of insolation.
So not only just puppeteer, but also we are going to do a couple more additional installation this
time.
The one is the just puppeteer itself.
So I'm just going to search for just and if I search for a puppeteer, you can see that this is the
puppeteer comes in and it also requires a just environment, nor does something like that.
So let's see if they have one.
Yeah, this one, so I do require this as well, so I'm just going to do this as well over here.
So once I have everything over here, I can just do and npm install.
So this is going to install all the packages for me while this is happening.
If I just go to this particular documentation, you can see that they will ask us to set this particular
preset for that just because that is something we really require on our package to our Jason file.
So I'm just going to do that.
And I also need to probably create the configuration file, which is going to be looking something like
this, the disrupter config, Dargis file.
I mean, you don't have to worry about all these things.
I'm just running it very quickly because while we talk about the player, I guess you would understand
why these are really, really important.
So I'm just going to copy them pasted over here.
And you can see that it just brings up all those things for us, which is quite good.
So I'm just going to stay this thing and now I am going to actually run the actual test itself so far
doing that.
I'm actually going to create a file that's called this as a test dart spec Dargis, do you see that?
I'm just changing the name from the usual Dargis to Dart Specter just this time.
So the spec is basically for the specification.
I mean, especially for the test cases that we used to.
Right.
And just actually uses that as one of the common way of identifying it.
So now, because you have the test, if you try to do just just a command, like just if you try to
run that, you can see that it is trying to determine the test suite to run.
So it is trying to identify it and it is trying to find if there is any test that it could be able to
execute in this particular directory.
And it has this year to start spectrographs file and you can see that it actually executed it and it
wouldn't be able to find anything.
So it says that you are test suite must contain at least one test in that and able to find anything
to stop and just is also going to do some sort of magic.
Because if you see that I'm trying to run a dumped out of truth, I probably can remove this guy and
even this guy because he's trying to run our process and had less modern stuff.
But yeah, you can see that this is what it is trying to do.
So if I just try to run the test once again, you can see that this time it is quite faster because
it's not running all this potent stuff for us.
I mean, you don't have to worry about all these things.
It is because test is doing a lot of things behind the scenes.
You can see that I'm setting the browser chromium over here itself.
I'm setting the browser context here itself, which I don't really have to specify, like how I used
to specify for each and every test in our playwrite test that we use to do most of the time.
Those things we don't even have to do using the just puppeteer, which is pretty cool.
But as I said, I'm asking a random test on the EPA to Specter G.S. and will quickly show you how the
court's going to look like.
You can see that this a described block that it block and that is done before all block.
So before I'll block it, it's going to run this Google dot com.
And over here it is going to, ah, just match the title as Google or something like that.
So very, very simple test.
So if I run this just once again, you can see that it is going to execute the test for us.
There you go.
It got past this time, but it's pretty cool, right?
So this just is actually like a test runner, which is going to do things for us so quickly.
Not only that, it also resolves the page instance automatically based on the browser that we have told
it to open, and it just launches that as well.
So if you because we have just removed the the launch pad from the headless two files, we can probably
say, oh, here, like false, somewhat wrong.
And if I tried Ramdas, you can see that it just opens the chromium browser for us over here in full
mode and is executing it.
So all those things we can control from the config file from here, which is quite nice.
So this is the very important thing about the test itself on that just puppeteer.
Well this is the same exact idea that will be propagating in our playwrite in our next section.