In this next hour, we're going to discuss how we can integrate playwrite with GitHub actions.
So Goodlove Actions is one of the popular continuous integration and continuous deployment platform.
It is kind of free if you're going to be using your repository as a public wrapper.
But if you're going to have a private wrapper that you're going to use it for your organizations, you
should have a license for that.
But for our demonstration, because I'm just using the public wrapper and also it's not for the commercial
purpose which I'm doing it.
So it's going to be free for me while I'm going to show you the demo.
I mean, you can do it yourself if you have a GitHub report as well.
So all you're going to do for having this demonstration to work for you, you need to have a good rapport
and you're going to be checking in the code like how I'm actually going to be doing and things.
So it's going to be very, very straightforward.
I can probably show you what GitHub is all about.
So if I going to show you this GitHub repo, so if I just go to the GitHub and if you can see over here,
GitHub, dot com slash extradimensional, this is our repository that we have been talking about and
have shown you some of the examples from this GitHub repo, like selenium with cucumber for the Java
project.
And that's exactly what we'll be doing over here, that we are going to check in our core, the playwright
code on this GitHub repo, and then we'll be using GitHub actions.
So if I just search for GitHub actions, this guy this is the another continuous integration workflow
that we are going to be using to run our test.
And then we'll see how the test results are going to be running and how it's going to generate videos
and things of that nature.
So that's what we'll be doing in this particular couple of discussions that we'll be doing as a part
of GitHub actions, integration.
So if you search for GitHub actions, playwrite, something like that, actually playwrite GitHub action
is already available for us, which is a pretty cool and great news.
I mean, Microsoft team is already creating a way to run the play right.
On GitHub action.
So this is very, very cool because you can see that they already have a startup called as playwrite
GitHub, actions like that.
So this is going to download all the player dependencies and the browser dependencies and stuff for
you.
And then you can do the usual NPM install, NPM Test or NPCs Foleo for running the test via the testers
and then you can execute the test for us, which is pretty cool.
This is very straightforward and simple, and this way we can see how we can actually run the test using
GitHub actions.
This is very, very straightforward.
We can also upload the artifacts if we want to, using this particular steps.
I mean, we can talk about all these things while we are going to discuss right now.
So what are we going to do is we are going to make use of this GitHub actions for doing things for us.
And for that we need a repo to be available in our extra dimensions repository because I don't really
have it.
The reason being, I wanted to show you what I'm going to make field code change on our existing code
that we discussed on our test run section.
So I'm just going to go Udemy playwrite test runner and then I'm just going to open the code expiration
date and I can probably run the NPM install because it is going to install the dependencies for me.
And now if I go to the test run or this guy, you can see that we have the test and we have this test
turnaround playwrite or here, and we already saw how we can actually write the code on the test using
the FOLIA examples.
And the tests are like this, right?
So I'm going to make fuel code changes.
And I'm first of all, I'm going to see how this code is going to run on my local machine.
And then I'm going to check in this code on the GitHub rep of mine and then we'll try to use the GitHub
actions to run the test for us on GitHub actions.
Right.
So far doing that.
The first thing is I'm just going to go over here and then not run the test.
We all know that we are just going to do this.
NBCs Foleo.
And if I had to enter, this is going to automatically scan all the test for us and then it's going
to run those test for us.
So you can see that whether it's running the test, there are a few test which is actually already failing.
And the reason we already know because we intentionally made those test to fail for us.
And that's the reason these tests are actually failing.
And you can see that the new insight is just exploding.
And there is a time out coming up over here.
And you can see that for test got past and to for test got skipped, which is which is not quite right.
I mean, these are failing because it.
Actually is failing due to a reason that we intentionally made on our test to fail.
So you can see that this guy is failing on the go, too.
And similarly, there is another failure on the inline test fix to not spectate.
Yes.
So all these things we can actually fix within our code so far doing that.
I'm just going to go all the way over here to the Canadian spectators file.
So this is Google Earth, if you remember, and we just change this in our earlier section.
So I'm just going to change this guy back.
So this test will be passed.
And similarly, uh, I think these are all right.
And I'm going to go all the way to the test over here, fix alerts and interrupt the headless mode over
here.
I'm just going to make this as true because we are going to run these things in the command line and
I will show you what I mean.
And then I'm just going to go all the way to the test over here.
And you can see that this particular test is actually being skipped for us to be executed.
And this guy is going to be working, but it is going to throw us an error if they run the test on the
Web more, because my Mac actually doesn't really run the the Web kit and it's always going to throw
us an error.
So probably I'm just going to skip this guy asked whether that's going to do that.
But because we have too many test over here, what I'm going to do is I'm just going to change some
of the code that we actually have over here to the test run record so that we can see how those tests
are actually going to work.
So this way we can actually compensate some of the tests that we have actually recommended.
So what I'm going to do is I'm just going to come and these codes because this code is not required
and because for the test, we know that we just need this import of the ID and the right test.
So end end user login test, probably this guy is going to be the ID block.
So you can see that we have the ID and we have the page over here and these things are going to be taken
care for us automatically.
Um, and I don't require the viewport.
I was going to save this guy and for the login test over here, I can probably do the exact same thing.
So I'm just going to remove these guys and this is going to be a demo site, Log-in, something like
that, and just kind of say this guy and screenshot of all the browsers.
Not sure how this is going to work, but I'm actually going to leave this guy as it is.
Let it be.
And if I just go here, just kind of clear and if I just do Olympic's Folio this time.
So there are 12 deaths right now that executing on different browsers are probably I can just specify
hyphen, hyphen, Pyramus browser name as chromium oops.
I from.
Now, it became six test, naturally.
And you can see that this time, actually, all the discard parts, like for days got passed to discard,
skipped and all those things, we can probably see this in action as well if you want to.
So I can just make this as Hatful.
So you can see that we are running all the tests right now on the perimeter and we are seeing that if
they are actually working fine or not using the command line parameters, and this may also help us
to run the test during the operation that we are going to be doing.
So I could see that that is actually running, but it looks like it's very, very less number of test.
So I probably am also going to add one more test that we have written before, like the test dart spectate
J.S., which is going to be our user creation test, if you remember, like how we create the users
and things.
So I'm just going to add that as well.
And if I run them all at full.
Sorry about that, not.
Yes, it's to yes.
So you can see that behind the scene is also running the automation side, so there are two tests actually
running same time.
There you go.
So we have like fighters got past to discard Skip.
So this is the result that we are going to be expecting to have in our GitHub actions as well.
So I'm actually going to create a rapport.
I'm going to check in this code GitHub repo and then run the same tests and GitHub actions and we'll
see how it actually works.