From ca09b941ea8e807e062d3b5b65539410a9b99ce2 Mon Sep 17 00:00:00 2001 From: camperbot Date: Fri, 7 Jan 2022 13:19:06 +0530 Subject: [PATCH] This PR was automagically generated by Crowdin. (#44698) --- ...ality-with-.deepequal-and-.notdeepequal.md | 14 ++-- ...sts-on-api-endpoints-using-chai-http-ii.md | 14 ++-- ...-tests-on-api-endpoints-using-chai-http.md | 39 +++++---- ...ional-tests-using-a-headless-browser-ii.md | 42 +++++----- ...nctional-tests-using-a-headless-browser.md | 82 ++++++++++--------- 5 files changed, 99 insertions(+), 92 deletions(-) diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/assert-deep-equality-with-.deepequal-and-.notdeepequal.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/assert-deep-equality-with-.deepequal-and-.notdeepequal.md index df609ee419..e7f67d818b 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/assert-deep-equality-with-.deepequal-and-.notdeepequal.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/assert-deep-equality-with-.deepequal-and-.notdeepequal.md @@ -1,6 +1,6 @@ --- id: 587d824c367417b2b2512c4c -title: Assert Deep Equality with .deepEqual and .notDeepEqual +title: Confirmar la igualdad profunda con .deepEqual y .notDeepEqual challengeType: 2 forumTopicId: 301587 dashedName: assert-deep-equality-with--deepequal-and--notdeepequal @@ -8,17 +8,17 @@ dashedName: assert-deep-equality-with--deepequal-and--notdeepequal # --description-- -As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/). +Como recordatorio, este proyecto está siendo construido con base en el siguiente proyecto inicial [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonado desde [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/). -`deepEqual()` asserts that two objects are deep equal. +`deepEqual()` confirma que dos objetos son iguales en profundidad. # --instructions-- -Within `tests/1_unit-tests.js` under the test labelled `#7` in the `Equality` suite, change each `assert` to either `assert.deepEqual` or `assert.notDeepEqual` to make the test pass (should evaluate to `true`). Do not alter the arguments passed to the asserts. +Dentro de `tests/1_unit-tests.js` bajo la prueba etiquetada `#7` en `Equality` suite, cambia cada `assert` a `assert.deepEqual` o `assert.notDeepEqual` para pasar la prueba (debe evaluarse como `true`). No modifiques los argumentos pasados ​​a los verificadores. # --hints-- -All tests should pass. +Todas las pruebas deben pasar. ```js (getUserInput) => @@ -32,7 +32,7 @@ All tests should pass. ); ``` -You should choose the correct method for the first assertion - `deepEqual` vs. `notDeepEqual`. +Debe elegir el método correcto para la primera aserción - `deepEqual` vs. `notDeepEqual`. ```js (getUserInput) => @@ -50,7 +50,7 @@ You should choose the correct method for the first assertion - `deepEqual` vs. ` ); ``` -You should choose the correct method for the second assertion - `deepEqual` vs. `notDeepEqual`. +Debe elegir el método correcto para la segunda aserción - `deepEqual` vs. `notDeepEqual`. ```js (getUserInput) => diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http-ii.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http-ii.md index 53d2c7459e..772e74ffcd 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http-ii.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http-ii.md @@ -1,6 +1,6 @@ --- id: 587d824f367417b2b2512c59 -title: Run Functional Tests on API Endpoints using Chai-HTTP II +title: Ejecutar pruebas funcionales en API Endpoints usando Chai-HTTP II challengeType: 2 forumTopicId: 301592 dashedName: run-functional-tests-on-api-endpoints-using-chai-http-ii @@ -8,17 +8,17 @@ dashedName: run-functional-tests-on-api-endpoints-using-chai-http-ii # --description-- -As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/). +Como recordatorio, este proyecto está siendo construido con base en el siguiente proyecto inicial [Repl.it](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonado desde [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/). # --instructions-- -Within `tests/2_functional-tests.js`, alter the `'Test GET /hello with your name'` test (`// #2`) to assert the `status` and the `text` response to make the test pass. +Dentro de `tests/2_functional-tests.js`, modifica la prueba `'Test GET /hello with your name'` (`// #2`) para afirmar él `status` y el `text` de la respuesta para hacer que la prueba pase. -Send your name in the query, appending `?name=` to the route. The endpoint responds with `'hello '`. +Envía tu nombre como consulta de URL agregando `?name=` a la ruta. El endpoint responde con `'hello '`. # --hints-- -All tests should pass +Todas las pruebas deben pasar ```js (getUserInput) => @@ -32,7 +32,7 @@ All tests should pass ); ``` -You should test for 'res.status' == 200 +Debe comprobar que `res.status` sea 200 ```js (getUserInput) => @@ -48,7 +48,7 @@ You should test for 'res.status' == 200 ); ``` -You should test for 'res.text' == 'hello Guest' +Debes probar que `res.text` == `'hello '` ```js (getUserInput) => diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http.md index dc99b2d46a..d30b6787e3 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http.md @@ -1,6 +1,6 @@ --- id: 587d824e367417b2b2512c58 -title: Run Functional Tests on API Endpoints using Chai-HTTP +title: Ejecutar pruebas funcionales en API Endpoints usando Chai-HTTP II challengeType: 2 forumTopicId: 301593 dashedName: run-functional-tests-on-api-endpoints-using-chai-http @@ -8,43 +8,42 @@ dashedName: run-functional-tests-on-api-endpoints-using-chai-http # --description-- -As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/). +Como recordatorio, este proyecto está siendo construido con base en el siguiente proyecto inicial [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonado desde [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/). -Mocha allows testing asyncronous operations. There is a small (BIG) difference. Can you spot it? +Mocha te permite comprobar operaciones asíncronas como llamadas a los endpoints de la API con un complemento llamado `chai-http`. -We can test our API endpoints using a plugin, called `chai-http`. Let's see how it works. And remember, API calls are asynchronous. - -The following is an example of a test using `chai-http` for the `'GET /hello?name=[name] => "hello [name]"'` suite. The test sends a name string in a url query string (`?name=John`) using a `GET`request to the `server`. In the `end` method's callback function, the response object (`res`) is received and contains the `status` property. The first `assert.equal` checks if the status is equal to `200`. The second `assert.equal` checks that the response string (`res.text`) is equal to `"hello John"`. +El siguiente es un ejemplo de una prueba usando `chai-http` para una suite llamada `'GET /hello?name=[name] => "hello [name]"'`: ```js suite('GET /hello?name=[name] => "hello [name]"', function () { - test("?name=John", function (done) { + test('?name=John', function (done) { chai .request(server) - .get("/hello?name=John") + .get('/hello?name=John') .end(function (err, res) { - assert.equal(res.status, 200, "response status should be 200"); - assert.equal( - res.text, - "hello John", - 'response should be "hello John"' - ); + assert.equal(res.status, 200, 'Response status should be 200'); + assert.equal(res.text, 'hello John', 'Response should be "hello John"'); done(); }); }); +}); ``` -Notice the `done` parameter in the test's callback function. Calling it at the end without an argument is necessary to signal successful asynchronous completion. +La prueba envía una solicitud `GET` al servidor con un nombre como una cadena de consulta de URL (`?name=John`). En la función callback del método `end`, el objeto de respuesta (`res`) es recibido y contiene la propiedad `status`. + +La primera `assert.equal` comprueba si el estado es igual a `200`. El segundo `assert.equal` comprueba que la cadena de respuesta (`res.text`) sea igual a `"hello John"`. + +También, ten en cuenta el parámetro `done` en la función callback de la prueba. Llamarlo sin un argumento al final de una prueba es necesario para indicar que la operación asíncrona está completa. # --instructions-- -Within `tests/2_functional-tests.js`, alter the `'Test GET /hello with no name'` test (`// #1`) to assert the `status` and the `text` response to make the test pass. Do not alter the arguments passed to the asserts. +Dentro de `tests/2_functional-tests.js`, modifica la prueba `'Test GET /hello with no name'` (`// #1`) para afirmar él `status` y el `text` de la respuesta para hacer que la prueba pase. No modifiques los argumentos pasados ​​a los verificadores. -There should be no name in the query; the endpoint responds with `hello Guest`. +No debe haber ninguna consulta de URL. Sin una consulta de nombre URL, el endpoint responde con `hello Guest`. # --hints-- -All tests should pass +Todas las pruebas deben pasar ```js (getUserInput) => @@ -58,7 +57,7 @@ All tests should pass ); ``` -You should test for 'res.status' == 200 +Debe comprobar si `res.status` == 200 ```js (getUserInput) => @@ -74,7 +73,7 @@ You should test for 'res.status' == 200 ); ``` -You should test for 'res.text' == 'hello Guest' +Debes probar que `res.text` == `'hello Guest'` ```js (getUserInput) => diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser-ii.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser-ii.md index d34360de18..5e550be1c0 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser-ii.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser-ii.md @@ -1,6 +1,6 @@ --- id: 5f8884f4c46685731aabfc41 -title: Run Functional Tests Using a Headless Browser II +title: Ejecuta pruebas funcionales usando un navegador sin interfaz gráfica II challengeType: 2 forumTopicId: 301594 dashedName: run-functional-tests-using-a-headless-browser-ii @@ -8,31 +8,31 @@ dashedName: run-functional-tests-using-a-headless-browser-ii # --description-- -As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/). +Como recordatorio, este proyecto está siendo construido con base en el siguiente proyecto inicial [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonado desde [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/). # --instructions-- -Within `tests/2_functional-tests.js`, in the `'submit "surname" : "Vespucci" - write your e2e test...'` test (`// #6`), automate filling-in and submitting the form from scratch: +Dentro `tests/2_functional-tests.js`, en `'Submit the surname "Vespucci" in the HTML form'` prueba (`// #5`), automatiza lo siguiente: -1. Fill in the form with the `surname` of `Vespucci` -2. Submit it pressing `'submit'` button +1. Rellena el formulario con el apellido `Vespucci` +2. Presiona el botón enviar -Within the callback: +Y dentro del callback de `pressButton`: -1. assert that status is `200` -2. assert that the text inside the element `span#name` is `'Amerigo'` -3. assert that the text inside the element `span#surname` is `'Vespucci'` -4. assert that the element(s) `span#dates` exist and their count is `1` +1. Comprueba que el status es OK `200` +2. Comprueba que el texto dentro del elemento `span#name` es `'Amerigo'` +3. Comprueba que el texto dentro del elemento `span#surname` es `'Vespucci'` +4. Comprueba que existen elemento(s) `span#dates` y su contador es `1` -Do not forget to to remove the `assert.fail()` call. +No olvides eliminar la llamada `assert.fail()`. # --hints-- -All tests should pass. +Todas las pruebas deben pasar. ```js (getUserInput) => - $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then( + $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=6').then( (data) => { assert.equal(data.state, 'passed'); }, @@ -42,11 +42,11 @@ All tests should pass. ); ``` -You should assert that the headless browser request succeeded. +Debes asegurarte que la petición del navegador sin interfaz gráfica ha sido exitosa. ```js (getUserInput) => - $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then( + $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=6').then( (data) => { assert.equal(data.assertions[0].method, 'browser.success'); }, @@ -56,11 +56,11 @@ You should assert that the headless browser request succeeded. ); ``` -You should assert that the text inside the element 'span#name' is 'Amerigo'. +Debes comprobar que el texto dentro del elemento `span#name` es `'Amerigo'`. ```js (getUserInput) => - $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then( + $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=6').then( (data) => { assert.equal(data.assertions[1].method, 'browser.text'); assert.match(data.assertions[1].args[0], /('|")span#name\1/); @@ -72,11 +72,11 @@ You should assert that the text inside the element 'span#name' is 'Amerigo'. ); ``` -You should assert that the text inside the element 'span#surname' is 'Vespucci'. +Debes comprobar que el texto dentro del elemento `span#surname` es `'Vespucci'`. ```js (getUserInput) => - $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then( + $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=6').then( (data) => { assert.equal(data.assertions[2].method, 'browser.text'); assert.match(data.assertions[2].args[0], /('|")span#surname\1/); @@ -88,11 +88,11 @@ You should assert that the text inside the element 'span#surname' is 'Vespucci'. ); ``` -You should assert that the element 'span#dates' exist and its count is 1. +Debes comprobar que el elemento `span#dates` existe y su contador es 1. ```js (getUserInput) => - $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then( + $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=6').then( (data) => { assert.equal(data.assertions[3].method, 'browser.elements'); assert.match(data.assertions[3].args[0], /('|")span#dates\1/); diff --git a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser.md b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser.md index 3da3211b67..e780332fbf 100644 --- a/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser.md +++ b/curriculum/challenges/espanol/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser.md @@ -1,6 +1,6 @@ --- id: 587d8250367417b2b2512c5d -title: Run Functional Tests using a Headless Browser +title: Ejecuta pruebas funcionales usando un navegador sin interfaz gráfica challengeType: 2 forumTopicId: 301595 dashedName: run-functional-tests-using-a-headless-browser @@ -8,56 +8,64 @@ dashedName: run-functional-tests-using-a-headless-browser # --description-- -As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/). +Como recordatorio, este proyecto está siendo construido con base en el siguiente proyecto inicial [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonado desde [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/). -In the HTML main view we provided a input form. It sends data to the `PUT /travellers` endpoint that we used above with an Ajax request. When the request successfully completes, the client code appends a `
` containing the info returned by the call to the DOM. Here is an example of how to interact with this form: +En la página hay un formulario de entrada. Envía datos al endpoint `PUT /travellers` como una solicitud AJAX. + +Cuando la solicitud se completa con éxito, el código del cliente añade un `
` que contiene la información en la respuesta al DOM. + +Aquí hay un ejemplo de cómo usar Zombie.js para interactuar con el formulario: ```js -test('#test - submit the input "surname" : "Polo"', function (done) { - browser.fill('surname', 'Polo').pressButton('submit', function () { - browser.assert.success(); - browser.assert.text('span#name', 'Marco'); - browser.assert.text('span#surname', 'Polo'); - browser.assert.elements('span#dates', 1); - done(); +test('Submit the surname "Polo" in the HTML form', function (done) { + browser.fill('surname', 'Polo').then(() => { + browser.pressButton('submit', () => { + browser.assert.success(); + browser.assert.text('span#name', 'Marco'); + browser.assert.text('span#surname', 'Polo'); + browser.assert.elements('span#dates', 1); + done(); + }); }); -} +}); ``` -First, the `fill` method of the `browser` object fills the `surname` field of the form with the value `'Polo'`. Immediately after, the `pressButton` method invokes the `submit` event listener of the form. The `pressButton` method is asynchronous. +Primero, el método `fill` del objeto `browser` rellena el campo `surname` del formulario con el valor `'Polo'`. `fill` devuelve una promesa, así que `then` está encadenado a ella. -Then, once a response is received from the AJAX request, a few assertions are made confirming: +Dentro del callback `then` el método `pressButton` del objeto `browser` se utiliza para invocar el `submit` del event listener. El método `pressButton` es asíncrono. -1. The status of the response is `200` -2. The text within the `` element matches `'Marco'` -3. The text within the `` element matches `'Polo'` -4. There is `1` `` element. +Luego, una vez que se recibe una respuesta de la solicitud AJAX, se hacen algunas afirmaciones comprobando que: -Finally, the `done` callback is invoked, which is needed due to the asynchronous test. +1. El estado de la respuesta es `200` +2. El texto dentro del elemento `` coincide con `'Marco'` +3. El texto dentro del elemento `` coincide con `'Polo'` +4. Hay `1` `` elemento. + +Finalmente, se invoca el callback `done`, que es necesario debido a la prueba asincrónica. # --instructions-- -Within `tests/2_functional-tests.js`, in the `'submit "surname" : "Colombo" - write your e2e test...'` test (`// #5`), automate filling-in and submitting the form: +Dentro de `tests/2_functional-tests.js`, en `'Submit the surname "Colombo" in the HTML form'` (`// #5`), automatiza lo siguiente: -1. Fill in the form -2. Submit it pressing `'submit'` button. +1. Rellena el formulario con el apellido `Colombo` +2. Presione el botón Enviar -Within the callback: +Y dentro del callback de `pressButton`: -1. assert that status is OK `200` -2. assert that the text inside the element `span#name` is `'Cristoforo'` -3. assert that the text inside the element `span#surname` is `'Colombo'` -4. assert that the element(s) `span#dates` exist and their count is `1` +1. Compruebe que el estado es OK `200` +2. Compruebe que el texto dentro del elemento `span#name` es `'Cristoforo'` +3. Compruebe que el texto dentro del elemento `span#surname` es `'Colombo'` +4. Compruebe que existen elemento(s) `span#dates` y su contador es `1` -Do not forget to remove the `assert.fail()` call. +No olvide eliminar la llamada `assert.fail()`. # --hints-- -All tests should pass. +Todas las pruebas deben pasar. ```js (getUserInput) => - $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=4').then( + $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then( (data) => { assert.equal(data.state, 'passed'); }, @@ -67,11 +75,11 @@ All tests should pass. ); ``` -You should assert that the headless browser request succeeded. +Debe asegurarse que la petición del navegador sin interfaz gráfica ha sido exitosa. ```js (getUserInput) => - $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=4').then( + $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then( (data) => { assert.equal(data.assertions[0].method, 'browser.success'); }, @@ -81,11 +89,11 @@ You should assert that the headless browser request succeeded. ); ``` -You should assert that the text inside the element 'span#name' is 'Cristoforo'. +Debe comprobar que el texto dentro del elemento `span#name` es `'Cristoforo'`. ```js (getUserInput) => - $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=4').then( + $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then( (data) => { assert.equal(data.assertions[1].method, 'browser.text'); assert.match(data.assertions[1].args[0], /('|")span#name\1/); @@ -97,11 +105,11 @@ You should assert that the text inside the element 'span#name' is 'Cristoforo'. ); ``` -You should assert that the text inside the element 'span#surname' is 'Colombo'. +Debes comprobar que el texto dentro del elemento `span#surname` es `'Colombo'`. ```js (getUserInput) => - $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=4').then( + $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then( (data) => { assert.equal(data.assertions[2].method, 'browser.text'); assert.match(data.assertions[2].args[0], /('|")span#surname\1/); @@ -113,11 +121,11 @@ You should assert that the text inside the element 'span#surname' is 'Colombo'. ); ``` -You should assert that the element 'span#dates' exist and its count is 1. +Debe comprobar que el elemento `span#dates` existe y su contador es 1. ```js (getUserInput) => - $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=4').then( + $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then( (data) => { assert.equal(data.assertions[3].method, 'browser.elements'); assert.match(data.assertions[3].args[0], /('|")span#dates\1/);