如何使用赛普拉斯选择(Vue)v选择选项?

时间:2020-06-16 20:15:44

标签: vue.js cypress e2e-testing

似乎应该可以,但是不能。 任何人都知道在v-select上进行选择的技巧吗?

my.vue

      <v-select 
        data-cy="exp_month"
        name="exp_month" 
        v-model="card.expiration.month" 
        :items="months" 
        label="exp month">
      </v-select>

myTest.js

  it('should select the first month', () => {
    cy.get("[data-cy=exp_month]").select("01")
  })

结果

CypressError: cy.select() can only be called on a <select>. Your subject is a: <input aria-label="exp month" data-cy="exp_month" name="exp_month" readonly="readonly" type="text" placeholder=" " autocomplete="on" aria-readonly="false">

1 个答案:

答案 0 :(得分:0)

我想v选择不是选择。

我不知道这是不是正确的方法,但这就是我最终要做的。

top