Cypress Testing Snippets by iJS
Thanks for giving this a go. Hope this helps and makes your coding more efficient and fun.
Hello.
Animations coming soon.
Pull requests for animations or any other contributions are most welcome!
Installation
- Launch the Command Pallete (Ctrl + Shift + P or ⌘Cmd + Shift + P) and type "Install Extensions" (or navigate from the sidebar to Extensions tab).
- In search box type in "iJS" and choose the Cypress Snippets by iJS
- Install the extension (you may need to relaunch VS Code)
- Get a coffee, a cookie and celebrate by writing some cool Cypress.io tests more efficiently than ever! :)
Below is a list of all available snippets and the triggers of each one. The ⇥ means the TAB
key.
Must have React Snippets
PRs are welcome to expand descriptions.
Trigger |
Content |
cyintel→ |
Cypress intellisense |
cybef→ |
beforeEach |
cyctx→ |
context |
it→ |
it |
cyv→ |
visit |
cyget→ |
get |
cyf→ |
find |
cy1→ |
first |
cyt→ |
type |
cycont→ |
contains |
cyc→ |
click |
cyserv→ |
server |
cyrt→ |
route |
cyw→ |
wait |
cyvp→ |
viewport |
cyreq→ |
request |
cyadd→ |
command |
- More snippets to come, stay tuned or request a snippet in the issues!
Expanded Snippets
cyintel
- Cypress intellisense
/// <reference types="cypress" />
cybef
- beforeEach
beforeEach(() => {
\$1;
});
\$0;
cyctx
- context
context("$1", () => {
$0;
});
it
- it
it("$1", () => {
$0;
});
cyv
- visit
cy.visit("$1");
$0;
cyget
- get
cy.get('$1')${0:;}
cyf
- find
find('$1')${0:;}
cy1
- first
first()\${0:;}
cyt
- type
type('$1')${0:;}
cycont
- contains
contains(${2:'$3', }'$1')${0:;}
cyclk
- click
click()\${0:;}
cyserv
- server
cy.server();
\$0;
cyrt
- route
cy.route(${2:'$3', }$1).as('${4}');\$0
cyw
- wait
cy.wait(${1:'@${2}'});\$0
cyvp
- viewport
cy.viewport($1, $2);
\$0;
cyreq
- request
cy.request({
method: "$1",
url: "$2",
headers: { "Accept-Language": "en-us" },
});
\$0;
cyadd
- add command
Cypress.Commands.add('$1', ${3: { previous: '$4' \} , }$2);\$0
iJS.to