Skip to content

Commit 1e4fc79

Browse files
committed
cherry pick 37e2191746306729beab6d0ffd3f5d2ff6908c31 from fullstackreact-site
1 parent b99822f commit 1e4fc79

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

day-26/post.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ imagesDir: /assets/images/series/30-days-of-react/day-26
1616
includeFile: ./../_params.yaml
1717
---
1818

19-
We've reached the final part of our introduction to testing. We're going to wrap up our testing section with integration testing. As a reminder of what Integration testing is, it's the process of automating the experience that our actual users experience as they use our application.
19+
We've reached the final part of our introduction to testing. We're going to wrap up our testing section with integration testing. As a reminder of what Integration testing is, it's the process of automating the experience that our actual users experience as they use our application.
2020

2121
<div class="demo" id="demo1"></div>
2222

@@ -26,7 +26,7 @@ As we're integration testing, we'll need to have our app actually running as we'
2626

2727
## Install
2828

29-
The easiest way to install [selenium](http://docs.seleniumhq.org/download/) is to download it through the the selenium website at: [http://docs.seleniumhq.org/download/](http://docs.seleniumhq.org/download/).
29+
The easiest way to install [selenium](http://docs.seleniumhq.org/download/) is to download it through the the selenium website at: [http://docs.seleniumhq.org/download/](http://docs.seleniumhq.org/download/).
3030

3131
> If you're on a mac, you can use [Homebrew](http://brew.sh) with the `brew` command:
3232
>
@@ -106,7 +106,7 @@ mkdir tests
106106
touch tests/auth-flow.js
107107
```
108108

109-
The nightwatch tests can be set as an object of exports, where the key is the description of the test and the value is a function with a reference to the client browser. For instance, we'll set up four tests for our `tests/auth-flow.js` test.
109+
The nightwatch tests can be set as an object of exports, where the key is the description of the test and the value is a function with a reference to the client browser. For instance, we'll set up four tests for our `tests/auth-flow.js` test.
110110

111111
Updating our `tests/auth-flow.js` file with these four test functions look like the following:
112112

@@ -119,7 +119,7 @@ module.exports = {
119119
}
120120
```
121121

122-
Each of the functions in our object exports will receive a `browser` instance which serves as the interface between our test and the selenium webdriver. We have all sorts of available options we can run on this `browser` variable.
122+
Each of the functions in our object exports will receive a `browser` instance which serves as the interface between our test and the selenium webdriver. We have all sorts of available options we can run on this `browser` variable.
123123

124124
Let's write our first test to demonstrate this function. We're going to set up nightwatch so that it launches the page, and clicks on the Login link in the navbar. We'll take the following steps to do this:
125125

@@ -150,7 +150,7 @@ module.exports = {
150150

151151
Thats it. Before we get too far ahead, let's run this test to make sure our test setup works. We'll need to open 3 terminal windows here.
152152

153-
In the first terminal window, let's launch selenium. If you downloaded the `.jar` file, you can start this with the command:
153+
In the first terminal window, let's launch selenium. If you downloaded the `.jar` file, you can start this with the command:
154154

155155
```bash
156156
java -jar selenium-server-standalone-{VERSION}.jar
@@ -182,7 +182,7 @@ nightwatch
182182

183183
When we run the `nightwatch` command, we'll see a chrome window open up, visit the site, and click on the login link automatically... (pretty cool, right?).
184184

185-
All of our tests pass at this point. Let's actually tell the browser to log a user in.
185+
All of our tests pass at this point. Let's actually tell the browser to log a user in.
186186

187187
Since the first step will run, the browser will already be on the login page. In the second key of our tests, we'll want to take the following steps:
188188

@@ -303,6 +303,8 @@ nightwatch
303303

304304
<img class="wide" src="/assets/images/series/30-days-of-react/day-26/nightwatch-3.jpg" />
305305

306+
One final note, if you're interested in a deeper set of selenium tutorials, check out the free tutorials from guru99.com at [https://www.guru99.com/selenium-tutorial.html](https://www.guru99.com/selenium-tutorial.html). They are pretty in-depth and well done (in our opinion).
307+
306308
That's it! We've made it and have covered 3 types of testing entirely, from low-level up through faking a real browser instance. Now we have the tools to ensure our applications are ready for full deployment.
307309

308310
But wait, we don't actually have deployment figured out yet, do we? Stay tuned for tomorrow when we start getting our application deployed into the cloud.

0 commit comments

Comments
 (0)