https://cypress.io logo
Hi folks! I'm trying to get account information by...
# e2e-testing
f
Hi folks! I'm trying to get account information by using
cy.request
to hit an API endpoint that should return all the account info in the response. I need to create disposable accounts on the fly, then have Cypress get the account ID number so that we can use an e2e endpoint to make changes to the account to get it in the state it needs to be in for testing. I'm using this:
Copy code
cy.request({
        method: "GET",
        url: "https://my.api.url/customers/me",
        headers: {
          "Content-Type": "application/vnd.api+json",
        },
      }).then((response) => {
        cy.log(response.body);
      });
I'm getting a 200 response in Cypress's ui, but I should be getting an array full of customer info, but instead I'm not seeing anything in the console or network tab, and the log only says
{data: Object{3}}
Can someone tell me what I'm doing wrong? Thanks much!