In the previous lecture, we installed a specific version of Cyprus.
So if we click on our package JSON file, you can see currently I'm using the following version of Cyprus
and we executed a specific command via the terminal window and in turn it downloaded the relevant packages
in a folder called node underscore modules.
So now what we're going to do is we are going to open up something called the Cyprus Test Runner.
So what we're going to do now is we're going to click on Terminal New Terminal, and I'm going to ensure
our select Get Bash.
And via the terminal window, we're going to execute a specific command.
So we're going to type thought forward slash, we're going to type mode, underscore modules.
We're going to talk forward slash again.
We're going to type drop in.
Then we're going to type forward slash Cyprus space open.
So whenever you open the test runner for the first time, it can take some time.
So please ensure that you leave this specific command running.
I'm just going to pause this giving lecture.
So as of Cyprus v ten plus we can see two options.
There's a new option called component tested.
However, as part of this course we are going to click on E to a testing because we're going to be creating
end to end tests.
So I'm going to click on the following option.
And it's going to create specific files for us.
So all we need to do now is click continue.
And then what it's going to do is going to create the Cyprus project structure for us.
So what we can do now is we're going to click on Chrome and we're going to click on Start E2e testing
in Chrome.
Okay, because it's the first time we have opened the Cyprus test runner.
You can see two options.
One is create a new empty spec and the second is create scaffold example specs.
So basically specs are tests and Cyprus creates some example tests for us.
So we're going to click on this given option here and then click on.
Okay.
And that's it.
So now if we inspect the following test runner, you can see under the specs section we have various
different tests.
And if we go back to our project and expand the Cypress folder, you can now see various different packages.
So you can see one called E, two A, and inside that given folder you can see example tests.
So as we progress through this course, we're going to be creating our own tests and we're going to
be using a different naming convention.
So instead of sea dogs, we're going to be using something different.
So what we now need to do is we need to click on the following file Cypress dot com fixes.
And inside this file we are going to add a specific line of code.
So what I'm going to do now is type spec, we're going to type pattern and then what we're going to
do is type double dot and we're going to add double quotes.
And then what we're going to do in now is pass in a specific directory.
So what we need to do is start at the base folder.
So we're going to type inside the double quotes, we're going to type Cyprus, I'm going to type forward
slash.
We're going to then select the E to E folder, then we're going to add star, star forward slash star
and then dot.
So whenever you see star star, it's basically a wild card.
So regardless of the name of a given folder, which is inside the E to E folder, it's going to select
that given folder.
And in our case we then go in inside those given folders and we locate in the files contained in those
unique folders.
So what are we going to do now is we need to select a specific type of file.
So what we can do is add curly brackets.
I'm going to type JS for JavaScript files.
We're then going to type GSX.
We won't be using some of these options, but it's good just to add them anyway.
You can type T for TypeScript.
Insert the following and then finally we can type feature because in a later section at the end of this
course we will briefly cover cucumber.
Okay, so now we've added the following line of code to pick up on specific file names because we will
be using a different naming convention for our tests instead of Doc C dogs.
And another key thing to note is given a line of code it needs to be housed inside the following curly
brackets.
So e to a the any setting that we add for our project needs to be inside this given curly bracket.
So what I can do is add a new line.
I'm going to copy the follow in and paste it inside the E to e curly brackets like so.
So again, I'm going to press control s on my keyboard to save the file.
And if we go back to our test runner.
You wouldn't see that error there.
So I'm just going to click on Try Again.
So now it's going to refresh the test runner.
We're going to click on sot e to e testing.
Give it some time to load.
And that's it.
You can now see that the test runner has loaded.
And we're going to be covering covering the test runner in a later lecture.
And if you ever want to close the test run, all you need to do is click on the following X.
And if you want to close the following, you can just click on the exit guide.
And another key thing to know if I open the following package, Jason file, you can see within this
project I'm using an older version of Cyprus, and if I open the Cyprus test runner, it's notify me
that an upgrade is available.
So you can see here it says you can update to the following version, which is a newer version.
However, please don't update your project and ensure you refer to the Cyprus set up section which advises
the correct version of Cyprus to use.
For example, when future updates are available, please ensure you refer to the set up section and
it will advise on the correct version of Cyprus to use as part of this course.
Don't forget to check out the lecture resources and I'll see you in the next lecture.