cy.request qs para path params ex: /api/books/:bookId #22455
Unanswered
brunoluizcassiano
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Estou tentando realizar um request no cypress onde preciso enviar um params par o bookID na url "/api/books/:bookId"
achei diversos exemplos como o abaixo, porem nenhum me atendeu, alguém tem algum sugestão?
cy.request({
url: 'https://jsonplaceholder.cypress.io/comments',
qs: {
postId: 1,
id: 3,
},
})
.its('body')
.should('be.an', 'array')
.and('have.length', 1)
.its('0') // yields first element of the array
.should('contain', {
postId: 1,
id: 3,
})
Beta Was this translation helpful? Give feedback.
All reactions