Testcafe Vue选择器无法获取Vue组件

ste*_*ste 5 javascript testing automated-tests vue.js testcafe

我正在使用Testcafe Vue选择器在Vue应用程序上执行e2e测试,但看起来我无法抓住我的任何组件:

1) An error occurred in getVue code:

      TypeError: Cannot read property '__vue__' of undefined
Run Code Online (Sandbox Code Playgroud)

这是我创建的样本测试:

import VueSelector from "testcafe-vue-selectors";
import { Selector } from 'testcafe';

fixture `Getting Started`
    .page `http://localhost:8081/`;

test('test totalValue format', async t => {
    const totalValue = VueSelector("total-value");

    await t
        .click("#total-value-toggle-format")
        .expect(totalValue.getVue(({ props }) => props.formatProperty)).eql(null)
});
Run Code Online (Sandbox Code Playgroud)

我的组件树的结构如下:

Root
|___App
    |___Hello
        |___TotalValue
Run Code Online (Sandbox Code Playgroud)

然后像这样导入组件:

  "total-value": TotalValue,
Run Code Online (Sandbox Code Playgroud)

为什么这不起作用?

编辑:这是我测试组件的页面

<template>
    <div class="hello">
        <div class="component-wrapper">
              <total-value
                  :value="totalValueValue"
                  :formatProperty="computedFormatNumber">
              </total-value>
        </div>
    </div>
</template>

<script>   
import TotalValue from "../../core/TotalValue";

export default {
    name: "hello",
    components: {
        "total-value": TotalValue,
    },
    data() {
        return {
            totalValueValue: 1000000,
            formatNumber: true,
            formatFunction: Assets.formatNumber,
        };
    },
    computed: {
        computedFormatNumber() {
            return this.formatNumber ? ["nl", "0,0 a"] : [];
        },

    },
};
Run Code Online (Sandbox Code Playgroud)

Ale*_*kin 1

作为后续行动,我们已经修复了该线程中描述的问题:

支持通过 vue-loader 加载组件