Giter Club home page Giter Club logo

Comments (8)

das-mensch avatar das-mensch commented on July 29, 2024 1

I was facing the same problem.
A little workaround could be (using testcafe):

const setFakeVue = ClientFunction(() => {
    window.Vue = {version: "2.2.6"};
});

fixture `Home`.page('url').beforeEach(async t => {
    await setFakeVue();
});

from testcafe-vue-selectors.

fiws avatar fiws commented on July 29, 2024

Is there a workaround for this? I tried setting window.Vue = Vue;, now nothing works – i cannot even select by id :\

from testcafe-vue-selectors.

miherlosev avatar miherlosev commented on July 29, 2024

So far, we couldn't come up with a workaround for this.
If your application uses vue-loader, don't use the testcafe-selector-extentions plugin.
Instead, use build-in TestCafe selectors.

from testcafe-vue-selectors.

Ranmus avatar Ranmus commented on July 29, 2024

@fiws You cannot assign Vue imported in test (server side) to variable via function executed on client side. @das-mensch gave the best solution at the moment. Alternatively you can statically import Vue in your application by adding script tag and linking to some cdn. Or add dynamically script tag with Vue via client function.

from testcafe-vue-selectors.

miherlosev avatar miherlosev commented on July 29, 2024

@fiws @das-mensch @Ranmus
[email protected]

from testcafe-vue-selectors.

leonardovilarinho avatar leonardovilarinho commented on July 29, 2024

Is this solution still working?

I'm using the webpack-simple template. I'm testing but not finding the elements within App. See the error and code:

deepinscreenshot_20180223164743

from testcafe-vue-selectors.

miherlosev avatar miherlosev commented on July 29, 2024

Hi @leonardovilarinho.
I can not reproduce the problem on my side.
Make sure your application is running in development mode.
If it is true, then could you attach to issue the full code of your application?

from testcafe-vue-selectors.

leonardovilarinho avatar leonardovilarinho commented on July 29, 2024

Hi @miherlosev, I found my error!

The Vue documentation suggests use the camel case to declare the component names. For example: List; ListItem.

But in the testcafe-vue-selector code there is a transformation filter for lowercase in the tags. Resulting in: list; listitem.

Then search the testcafe for "list" and do not find the element, because "l" is in lowercase.

I'll take you in the PR (#35). Now, the plugin allows the camel case format and suit components names.

from testcafe-vue-selectors.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.