【发布时间】:2019-06-27 11:46:41
【问题描述】:
我有一个编辑器页面。当我添加任何内容并单击“保存”按钮时,我的 URL 将更改,在 URL 中添加一个随机 ID。每次单击“保存按钮”时,我想检查我的 ID 是否正在更改。
我将 URL 结果保存在变量中并想检查它,我这样做:
const currentURL = cy.url();
cy.get('.editor-toolbar-actions-save').click();
cy.url().should('not.eq', currentURL);
但是我的currentURL 变量的类型不是字符串:
预计 http://localhost:8080/editor/37b44d4d-48b7-4d19-b3de-56b38fc9f951 不等于 { Object (chainerId, firstCall) }
如何使用我的变量?
【问题讨论】:
标签: url automated-tests e2e-testing cypress