Conheça o LambdaTest. Uma ferramenta baseada em nuvem que permite conectar seus projetos instantaneamente para verificações de compatibilidade.

Running Your First Cypress Test On LambdaTest Platform

To demonstrate Cypress testing on the LambdaTest platform, we will use the Cypress’ Kitchen Sink Example in the demo below.

Step-1: Clone the LambdaTest-Cypress’ Kitchen Sink Example github repo and switch to the cloned directory.

git clone https://github.com/LambdaTest/Cypress-Cloud.git
cd cypress-example-kitchensink

Step-2: Setup the LambdaTest-Cypress CLI and configure the configuration file, as shown in the pre-requisites before. A file named lambdatest-config.json is generated in your project using the below command:

lambdatest-cypress init

Here, we have used the below configuration as default and generated it in the lambdatest-config.json file. You need to set up the authentication by using LambdaTest credentials. You can check here for more details about authentication.

Conteúdo da página

lambdatest-config.json

{
   "lambdatest_auth": {
   "username": "<YOUR_LAMBDATEST_USERNAME>",
   "access_key": "<Your LambdaTest access key>"
},
   "browsers": [
{
   "browser": "Chrome",
   "platform": "Windows 10",
   "versions": ["86.0"]
},
{
   "browser": "Firefox",
   "platform": "Windows 10",
   "versions": ["82.0"]
}
],
   "run_settings": {
   "cypress_config_file": "cypress.json",
   "build_name": "build-name",
   "parallels": 1,
   "specs": "./*.spec.js",
   "ignore_files": "",
   "npm_dependencies": {
   "cypress": "6.1.0"
},
   "feature_file_suppport": false
},
   "tunnel_settings": {
   "tunnel": false,
   "tunnelName": null
}
}

Also in run-settings section you need to specify the path of your spec.js file on which you want to run the test on. Here we will pass the path of a sample to do spec.js file for our demo.

"specs": "./cypress/integration/1-getting-started/todo.spec.js"

Note

In this demo, all occurences of http://localhost:8080 have been replaced with https://example.cypress.io to prevent running the Cypress tests locally. Alternatively, if you want to run your tests locally, refer to the Run locally section below.

Step-3: Execute your tests using the following command in the terminal:

lambdatest-cypress run

Compartilhe

Sobre o autor

James R. Moro

James Moro

Iniciei minha vida profissional como desenvolvedor web em 2008. Tenho um canal no Youtube onde publico vídeos sobre tecnologia.

Faça um comentário