LoginSignup
yurihyp
@yurihyp (yu ryp)

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

Cypress: cy.location() vs cy.url()

解決したいこと

cypressのcy.location()とcy.url()の違いについて教えてください。

cy.location = window.locationオブジェクトを取得する
cy.url = urlを取得する

cy.location('protocol').should('contain', 'HTTPS')
cy.url().should('contain', 'HTTPS')


cy.location('hostname').should('eq', 'qiita.com')
cy.location('path').should('eq', 'qiita.com')
cy.url().should('contain', 'qiita.com')


これらをどう使い分けたらいいか分かりません。
それぞれ、使い分けることでどのようなメリットがあるのでしょうか。

どなたかご教示くださいますと幸いです。

0

No Answers yet.

Your answer might help someone💌