Last active
November 30, 2022 03:38
-
-
Save adsguilherme/913ed8c05964602ac388b69ba8192f5a to your computer and use it in GitHub Desktop.
CY Snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Snippetes | |
Uma forma fácil e produtiva de acionar comandos. | |
## Caminho do arquivo conforme o SO (Sistema Operacional) | |
Windows: | |
C:\Users\seuNomedeUsuario\AppData\Roaming\Code\User\snippets\ | |
Linux: | |
.config/Code/User/snippets | |
## Seguir os passos: | |
1 - Acessor o diretório conforme o sistema operacional e identificar o arquivo javascript.json. | |
2 - Caso o arquivo não exista criar. | |
3 - Caso exista basta abrir e editar. | |
4 - Colocar as seguintes informações dentro do arquivo: | |
{ | |
"References Cypress": { | |
"prefix": "cyref", | |
"body": [ | |
"/// <reference types=\"cypress\" />" | |
], | |
"description": "Adiciona autocomplete comandos Cypress" | |
}, | |
"References Cy Api": { | |
"prefix": "cyapi", | |
"body": [ | |
"/// <reference types=\"@bahmutov/cy-api\" />" | |
], | |
"description": "Adiciona autocomplete comandos Cypress" | |
}, | |
"References Cy Route": { | |
"prefix": "@cyrt", | |
"body": [ | |
"cy.server()", | |
"cy.route({", | |
"\tmethod: '',", | |
"\turl: '/',", | |
"\tresponse: [", | |
"\t\t{ id: '', nome: '', visivel: true, usuario_id: '' }", | |
"\t]", | |
"})" | |
], | |
"description": "Adiciona autocomplete comandos Cypress" | |
}, | |
"References Cy Intercept": { | |
"prefix": "@cyint", | |
"body": [ | |
"cy.intercept({", | |
"\tmethod: '',", | |
"\turl: '/',", | |
"\tresponse: [", | |
"\t\t{ }", | |
"\t]", | |
"})" | |
], | |
"description": "Adiciona autocomplete comandos Cypress" | |
}, | |
"References Custom Commands": { | |
"prefix": "@cycc", | |
"body": [ | |
"Cypress.Commands.add('', () => {", | |
"})", | |
], | |
"description": "Adiciona autocomplete comandos Cypress" | |
}, | |
"References .then": { | |
"prefix": "@cythen", | |
"body": [ | |
".then(({}) => {", | |
"\texpect().to.eq()", | |
"})" | |
], | |
"description": "Adiciona autocomplete comandos Cypress" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment