Testing a redirect to a new route with Cypress

前端 未结 2 1008
情书的邮戳
情书的邮戳 2021-02-05 02:30

I am using Cypress for testing my web application.

This snippet currently works and will submit a new thing:

describe(\'The Create Page\', () => {
  i         


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-05 03:18

    Use below code to find out the url irrespective of other parameters

    cy.location().should((loc) => {
       expect(loc.pathname.toString()).to.contain('/home');
     });
    

提交回复
热议问题