Function When_I_make_a_request

  • When I make an HTTP request:

    When I make a {string} request to {string}
    

    Parameters

    • method:
          | "CHECKOUT"
          | "CONNECT"
          | "COPY"
          | "DELETE"
          | "GET"
          | "HEAD"
          | "LOCK"
          | "M-SEARCH"
          | "MERGE"
          | "MKACTIVITY"
          | "MKCOL"
          | "MOVE"
          | "NOTIFY"
          | "OPTIONS"
          | "PATCH"
          | "POST"
          | "PROPFIND"
          | "PROPPATCH"
          | "PURGE"
          | "PUT"
          | "REPORT"
          | "SEARCH"
          | "SUBSCRIBE"
          | "TRACE"
          | "UNLOCK"
          | "UNSUBSCRIBE"
    • url: string
    • Optionaloptions: DataTable

    Returns void

    Make a GET request to http://dev.local/seed:

    When I make a "GET" request to "http://dev.local/seed"
    

    Make an OPTIONS request to /api:

    When I make an "OPTIONS" request to "/api"
    

    If you make a request after visiting a page, Cypress assumes the URL used for the visit is the host:

    When I visit "http://localhost:8080/app"
    And I make a "POST" request to "users/1.json"
    # URL is http://localhost:8080/users/1.json

    If you make a request prior to visiting a page, Cypress assumes the host is the baseUrl property configured inside of of your configuration file.