Hello. Hello. Hello, welcome, welcome, welcome, welcome. My name is Kevin and welcome to teach yourself test
Oh, to me, Sean, right? We are teaching ourselves well, I'm teaching myself um Cypress
It's been my day, my day, my working day has been quite hectic
right? So um apologies, but I'm trying to learn. I'm I'm learning sometimes I don't make the videos
but I will be making the videos, right? I mean, I I learned from it in
in in the background without making videos, but I will be putting the videos and I'm gonna complete learning Cypress and capturing everything I need
to capture, right? But the process is a bit slow. Forgive me for that
Welcome. Today, I've come across code completion, right? Intelligent code completion. So when you're doing your Cypress script
right? When you, when you, when you're accessing the Cyprus E P I by typing C Y dot Right
when you type C Y dot that intelligent code completion, right? Which gives you a drop down of all the commands
the functions, right? I've come across that you have to actually do two types of
there's two types of ways you can actually uh So the default I will show you uh if we go to our virtual virtual
studio code, visual studio code. So right now this um scripts in the last script we did
right? Like right now this script doesn't have any intelligent code completion
And in in Cyprus or I think in visual studio code, we call it intelligent
So in intelligence code completion, right? So once you once, once you access this um Cyprus um API S by typing C Y dot
Right. So here you you would have all these suggestions for the methods and the functions and all the variables
right? Well, yeah, but because the default doesn't come with that intelligence code completion or intelligence code completion
um you have to do that yourself, right? So there are two ways to do it. That's what we plan to do on this video
right? There are two ways to do it. One is hard coding on every single um test case you write
right? You can hard code it at the top, the very top, this one only works from the very top
So there is um there is a command line, there's a command line you can use
which is this one. If you use this command line on every test case that you write
this has to go right to the top, right. So you just have to put it in there
right? And then you receive that. And hopefully this time when we try to access the uh the saved
Yes, probably una right. When we try to access the um Cyprus api we have the method
the methods suggested, right? So if we go dot right, you see all the methods and variables and functions or whatever you wanna call
them, right? So Cyprus dot get, you can select that and once you select Cyrus dot get
you can hover over the gate and it will tell you what get is all about
right? So it goes access the documentation, right? And it gives it a get one or more dome elements by nude name
input right by node name, right? So that's our get er you could say do visit
right? Visit, right? So now we actually, so this one is a visit
a giving URL, right? So yeah, so now we have an access. So the API is not fully loaded with all the methods
right? But if we take, if we um if we comment that way
right? It's commented away. Now we go back and say let's access our methods via the API S
we don't get that right? We don't get it anymore, right? So that could uh uh intelligent
good completion or that intelligence could completion is gone, right? There's the next way of doing it
right? So if we take this, take this bit out, the next way of doing it is actually adding one of the J M J
M file at the bottom or at the bottom of your your uh your your file structure
right? So no, not within, not within the Cypress. It has to be out with
out with the the other folders, right? So just click somewhere here
not right, click but just click somewhere here and say file, right
So another file, new file and you want to call this G S fake dot json
right? Because it's the Jason file, right? And just come out to that, right
And what you want to place in here, right? Is this code
this piece of code, you can find this, you can find this piece of code on these cypress er the Cyprus um official
website, right? And you play that there again, just go and see
right, safe and that's it, right? That's the second way. So the first
the first way is through hard coding, right? You're hard coded but this is not hard coded
right? Because of this file that you've created here, the dot the G conflict dot J M file
which has your core complement coding within, within it, any test case you right now
So if you go into and then we go to uh exam in integration example
let's say we write out another, we want to do another test case
right? So to new test cases, right? Once we access this, I will just say
oh, let's get let's straight. Do we start accessing the uh Cyrus API S just see dot C
Y C Y dot Well, my computer is not, let's see that and
let's come out of this, come out of this. Do not see that come up with this
I'm gonna put that. Not say that either. And that was not
I didn't see, I did not leave it as AJ S file, right
So that's why so always keep an eye out. Right? So that should be AJ S AJ S file right now
We are good to go, right. We are good to go. So we go C Y dot No
let's see it again. Sometimes you really need to come out of come out of the whole uh visual studio code and
go back in quickly, go back in, right? And hopefully it works this time or we can actually go to our old test case
Sometimes you have to do it through a new test case and then access an old test case
And if you work on an old test case, right? It just, you have to be able to see
just save it and see what happens, right? So C Y dot It's taking its time
It's not fully loaded yet. Let's wait for it to load, right
I think it's fully loaded now. C Y dot Starting. Nope, let's try it in
in an old test case. Oh no, it goes there, right? So we go here. So we access our API C I dot It's not
it's not happening. It's not happening. So it doesn't, it doesn't, it doesn't recognize
it still doesn't recognize our J M file. So let's get up to that
Keep up with that did not see that. It takes some, it takes some feeling right
So it, it says it doesn't want to save. Right? So what's wrong with his father
his father? There's nothing to save. There is something to save there now
So let's come up with that. Go into our new test case which you see if we want to access the API straight away dot
So that was it, right. C Y C Y dot Come on
go in, go to this one. Go to the old test case sp file at C Y dot No
no idea why that is not. I think there was a way you could Miss Sam has delayed that test case
remove that test case. So that looks ok, right. That looks so cute
So all that says it says from that base file honey, within the Cyprus in any of the separate folders
or Richard Jason folder include the um intelligence, right? See
that let's create a new farm. Oh What happened there? Ok. All right
Let's create a new fast. You. Oh dot G S right. And in here we go C
Y dot There we go. Get right. So it took a while
right? It took a while to load. That's what it probably takes some time to load
right? And I was impatient. I was impatient. Right? So there you go, you get and then you can actually access again
It tells you what get is all about, right? That, that method is actually all about
right? And it can go dot The set Brexit, right? O dot
I. Right. So that's the intelligent uh code completion. I wanted to show you guys
right? Sorry about all the, all the stop and start, but you have to be patient
right? It has to load and I wasn't patient, right? So it does work for your new files and your old files
So if you go back into the old file, probably if we go in here, we should
So just access this um the IC P I S again dot get
So it does work, right? It does work. It's just a matter of patience
right? Patience. So my name is Kevin. Hopefully that um gives you a bit of insight into um intelligent code completion within
Cyprus, right? Or, or in in intelligence uh code completion within Cyprus
right? And uh it gives you a, a quick access to your methods and your
your, your, your functions and your commands and your development, right? So my name is Kevin
if you found this um useful at all, um I'll be doing more of these uh Cyprus um uh videos as I learn
right? I share and uh try to get others well, that hopefully this helps others to create the awareness to create the
the, the, the wanting to learn. Um, and it helps you out to actually
er, do the same as I'm trying to do. Right. Um So, so support the channel
Thumbs up, subscribe. Thank you. How
Hm