Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Commit

Permalink
Possible workaround for Cannot read property 'body' of null
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBestPessimist committed Aug 6, 2019
1 parent 010f5a5 commit 92a03f0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cypress/support/commands/general.js
Expand Up @@ -248,7 +248,14 @@ function performDocumentViewAction(windowId, documentViewAction, documentIdAlias
responseTimeout: 20000,
})
.then(xhr => {
return { documentId: xhr.response.body[0].id };
expect(xhr.status).to.eq(200);
expect(xhr.response).to.not.be.empty;
expect(xhr.response.body[0]).to.not.be.empty;

cy.log('frist!: ' + JSON.stringify(xhr));
cy.log('frist! x2: ' + JSON.stringify(xhr));
cy.log('frist[0]: ' + JSON.stringify(xhr.response.body[0]));
return cy.wrap({ documentId: xhr.response.body[0].id });
})
.as(documentIdAliasName);
}
Expand Down

0 comments on commit 92a03f0

Please sign in to comment.