Skip to content

Commit 195ce9c

Browse files
authored
Merge pull request #3027 from tylersernett/patch-4
Update part11b.md - Edit grammar for clarity
2 parents e97c17b + ec1165d commit 195ce9c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/content/11/en/part11b.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,11 @@ Once you have fixed all the issues and the Pokedex is bug-free, the workflow run
329329
330330
![tests fixed](../../images/11/8.png)
331331
332-
#### 11.9 Simple end to end -tests
332+
#### 11.9 Simple end to end tests
333333
334334
The current set of tests use [Jest](https://jestjs.io/) to ensure that the React components work as intended. This is exactly the same thing that is done in section [Testing React apps](/en/part5/testing_react_apps) of part 5.
335335
336-
Testing components in isolation is quite useful but that still does not ensure that the system as a whole works as we wish. To have more confidence about this, let us write a couple of really simple end to end -tests with the [Cypress](https://www.cypress.io/) library similarly what we do in section [End to end testing](/en/part5/end_to_end_testing) of part 5.
336+
Testing components in isolation is quite useful but that still does not ensure that the system as a whole works as we wish. To have more confidence about this, let us write a couple of really simple end to end tests with the [Cypress](https://www.cypress.io/) library similarly what we do in section [End to end testing](/en/part5/end_to_end_testing) of part 5.
337337
338338
So, setup Cypress (you'll find [here](/en/part5/end_to_end_testing/) all info you need) and use this test at first:
339339
@@ -351,7 +351,7 @@ Define a npm script <code>test:e2e</code> for running the e2e tests from the com
351351

352352
**Note** do not include the word <i>spec</i> in the Cypress test file name, that would cause also Jest to run it, and it might cause problems.
353353

354-
**Another thing to note** is that despite the page renders the Pokemon names by starting with a capital letter, the names are actually written with lower case letters in the source, so it is <code>ivysaur</code> instead of <code>Ivysaur</code>!
354+
**Another thing to note** is that although the page renders the Pokemon names with an initial capital letter, the names are actually written with lower case letters in the source, so you should test for <code>ivysaur</code> instead of <code>Ivysaur</code>!
355355

356356
Ensure that the test passes locally. Remember that the Cypress tests _assume that the application is up and running_ when you run the test! If you have forgotten the details (that happened to me too!), please see [part 5](/en/part5/end_to_end_testing) how to get up and running with Cypress.
357357

@@ -366,19 +366,19 @@ Once the end to end test works in your machine, include it in the GitHub Action
366366
wait-on: http://localhost:5000
367367
```
368368

369-
Three options are used. [command](https://github.com/cypress-io/github-action#custom-test-command) specifies how to run Cypress tests. [start](https://github.com/cypress-io/github-action#start-server) gives npm script that starts the server and [wait-on](https://github.com/cypress-io/github-action#wait-on) says that before the tests are run, the server should have started in url <http://localhost:5000>.
369+
Three options are used: [command](https://github.com/cypress-io/github-action#custom-test-command) specifies how to run Cypress tests, [start](https://github.com/cypress-io/github-action#start-server) gives npm script that starts the server, and [wait-on](https://github.com/cypress-io/github-action#wait-on) says that before the tests are run, the server should have started on url <http://localhost:5000>.
370370

371371

372-
Once you are sure that the pipeline works, <i>write another test</i> that ensures that one can navigate from the main page to the page of a particular Pokemon, e.g. <i>ivysaur</i>. The test does not need to be a complex one, just check that when you navigate a link, the page has some right content, such as the string <i>chlorophyll</i> in the case of <i>ivysaur</i>.
372+
Once you are sure that the pipeline works, <i>write another test</i> that ensures that one can navigate from the main page to the page of a particular Pokemon, e.g. <i>ivysaur</i>. The test does not need to be a complex one, just check that when you navigate to a link, the page has some proper content, such as the string <i>chlorophyll</i> in the case of <i>ivysaur</i>.
373373

374-
**Note** also the Pokemon abilities are written with lower case letters, the capitalization is done in CSS, so <i>do not</i> search eg. for <i>Chlorophyll</i> but <i>chlorophyll</i>.
374+
**Note** the Pokemon abilities are written with lower case letters in the source code (the capitalization is done in CSS), so <i>do not</i> test for <i>Chlorophyll</i> but rather <i>chlorophyll</i>.
375375

376376
**Note2** that you should not try <i>bulbasaur</i>, for some reason the page of that particular Pokemon does not work properly...
377377

378378
The end result should be something like this
379379

380380
![e2e tests](../../images/11/9.png)
381381

382-
End to end -tests are nice since they give us confidence that software works from the end user's perspective. The price we have to pay is the slower feedback time. Now executing the whole workflow takes quite much longer.
382+
End to end tests are nice since they give us confidence that software works from the end user's perspective. The price we have to pay is the slower feedback time. Now executing the whole workflow takes quite much longer.
383383

384384
</div>

0 commit comments

Comments
 (0)