正在学习 Cypress,在 Google 上找不到答案。这是按钮和周围元素的 html。我相信这个页面是一个带有 flex css 的 vue.js Web 应用程序。
<div class="row no-gutters align-center justify-center" data-v-11111111="">
<div class="v-card__actions" data-v-11111111="">
<button class="title v-btn--contained theme--dark v-size--x-large green" data-v-11111111="" type="button">
<span class="v-btn__content">
Start
</span>
</button>
</div>
</div>
这是我的 Cypress 描述:
describe('Begin the form', () => {
it('I can start the form', () => {
cy.visit('https://this.app.com/#/start');
cy.get("span[class='.v-btn__content']").click();
});
});
当我在 Cypress 中运行上述内容时,我在 Cypress 结果中得到以下结果:
Timed out retrying: Expected to find element: span[class='.v-btn__content'], but never found it.
最佳答案
好的,那就试试这个
cy.get('.v-btn--contained').click();
关于javascript - 使用 Cypress 无法单击 Web 应用程序上的“开始”按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61657198/