vendredi 13 novembre 2020

Cypress custom commands autocomplete not available

I am wondering if there is a way to activate autocomplete for custom commands? For example:

  1. Create a few custom commands like

    Cypress.Commands.add("loginCookie", (url, cookie) => {
      cy.visit(url);
      cy.setCookie("t", cookie);
      cy.reload();
    })
    
  2. In the index.js file I added import "./commands". Index file is in the original location ../support/index.js, same for commands file.

  3. The custom command cy.login(url, token); does work but the autocomplete is not available and so the open declaration option and it's kind of annoying.

Any workaround?

Aucun commentaire:

Enregistrer un commentaire