All right, guys.
So in this election, I'm back to my Windows 10 machine from Mac and one.
So I just wanted to show you because we left off the.
Test runner in this particular machine and I have been switching many machines just to showcase that
our code actually works in all the platforms like Mac Operating System Assemblies and Windows operating
system.
And this time I'm going to actually show you how we can actually make use of our.
And in this section, we are actually going to write a small framework kind of code, probably I don't
really want to call it as like a framework kind of code because it is not even a framework code.
But still, as you all know, that the idea of the framework is something many people really like,
at least in the JavaScript world, the framework is not that great.
I mean, in terms of writing it for the test automation, because you don't really require it at the
moment because playwrite already taking care of everything in the JavaScript binding.
But if you really want right, like a kind of scenarios like using Convergys, then that's a different
ballgame altogether.
Again, for that, you don't really require a framework as such, but just that you need to organize
the core like a featureless folder or step forward or something like that.
But you don't really require something like a separate framework as such, because playwrite itself
is a very mature framework and they already know the pain points of the testers and they don't really
want to burden you.
Try one more framework right on the top of it.
So basically you can directly use playwrite without writing any page update model kind of code.
But this but as we all are coming from the background of selenium, sometimes the concept of page opposite
model is really required by the students.
And they wanted me to create a video on the page of that model.
So I just wanted to cover that up in this cause as well.
So this section is all about the page opposite models of the.
Playwright coding, and again, I'm going to mark this as a framework as well a bit, because if you
want to extend it from this particular piece of code, you could extend it.
But I don't really see any need for having a framework altogether because you be able to do it.
But in the upcoming lectures of this, but in the upcoming section of this course, while we talk about
different language bindings like Java and C Sharp, you really see that the framework can be written
much, much easily because the nature of the language like it's a common language.
And you would have already got a lot of ideas of how to create a small organized code like that.
I mean, in those areas, you could able to design a framework as such.
But all here, I don't really see any reason for you to have a framework as such.
So I've already downloaded the.
So I have already downloaded the code from our test on our section, and I'm just going to start working
from here, so I'm going to open the visual studio code.
And this code is going to be exactly the same code that we actually saw in our earlier section.
And I'm actually going to make use of this guy as well.
So I'm just going to do an IBM install and it's going to install all the dependencies and stuff.
So no change on those areas at least.
And we are going to start creating the framework which so-called framework over here.
So I'm going to create a folder and I'm going to name this as probably a framework.
And within this particular framework folder, I'm going to create a new folder and I'm I to call this
as maybe pages.
So because we can write some page optimal kind of code, I'm actually going to create something like
a page and then I'm going to create a login page, dot this file just, you know, down that I'm actually
creating a typescript file this time.
And I also need to create a new folder under framework.
I'm going to call this as a tester data or something like that, where we used to hold our test data,
uh, basically someone to create a new file called Call This, as probably did our dart.
And Jason, remember these things we already did in our earlier section of this course, I'm just going
to bringing in the same ideology over here, but I'm not going to really cover a lot of details because
we have already covered these shooters.
I'm just going to copy paste some of the course from that, and then I'm actually going to create one
more folder under the framework.
And I'm going to call this as probably tests, which is going to have all our tests which are going
to be using.
That's it.
And let's call this test as probably a.
Login to start specked dark days, so if you remember your earlier section, while we're discussing
about astronomer's, we use this spectators concept.
So I'm just going to use the exact same concept over here as well.
And you may be wondering what is going to be the login page start going to look like?
Well, guys, it is going to be very, very simple.
All I'm going to do is I'm just going to do an import.
And because we are using typescript like we used in our test runner over here, I'm just going to use
the playwright, something like this, and then I'm going to create a class I want to call this as login
page.
And within this login page, I'm actually going to create a page, something like this, which is something
I can use within my constructor over here.
So I'm probably going to run this section itself very quickly because this is mostly towards the JavaScript
kind of coding practices, which you can write something like a constructor's and the other classes
and stuff.
I'm already covered about the constructors classes and everything on my typescript.
The basic cause I mean, you can go ahead and watch that on YouTube, it's already there for free.
You can go and watch how the contractors work and type scripts and stuff.
But over here, I'm just going to write a very, very super simple course code, something like this.
So what I'm doing in here is I'm creating constructor for the page and we need to start getting our
start using this particular page.
So basically, this page is nothing but our playwrite page.
And within this page we are going to start write our code.
So you got the idea right, because we have the pages over here and we have the test and this is the
test data.
So we are going to write a code which is going to look more like a page object model code.
And this is what we'll be doing in this section.