Testcafe Vue Selectors 无法抓取 Vue 组件

Testcafe Vue Selectors can't grab Vue component

我正在使用 Testcafe Vue Selectors 对我的 Vue 应用程序执行端到端测试,但看起来我无法获取我的任何组件:

1) An error occurred in getVue code:

      TypeError: Cannot read property '__vue__' of undefined

这是我创建的示例测试:

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)
});

我的组件树结构如下:

Root
|___App
    |___Hello
        |___TotalValue

然后我这样导入组件:

  "total-value": TotalValue,

为什么这不起作用?

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

<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"] : [];
        },

    },
};

只是跟进,我们已经解决了此线程中描述的问题:

Support component loaded via vue-loader