Code Monkey home page Code Monkey logo

Comments (7)

scowling avatar scowling commented on June 12, 2024 1

Bingo! @prescottprue
Coming back to this with a clear head on Monday morning. It was file location.
I moved the command and plugin stuff to a cypress directory in the root. Even though cypress is configured to pickup tests in the nested folder.

Thanks for your help

from cypress-firebase.

prescottprue avatar prescottprue commented on June 12, 2024

@scowling quick question about the setup - do you need the file:preprocessor? I was under the impression that cypress handles typescript out of the box now - thought I saw that in their release notes a short while back.

As for the main issue, looks like there is a problem with the custom commands not being loaded, which is separate from the plugin (which adds tasks called by custom commands). Are you sure you followed all of the setup steps in the README (specifically step number 5):

  1. Add the following your custom commands file (cypress/support/commands.js):

    import firebase from "firebase/app";
    import "firebase/auth";
    import "firebase/database";
    import "firebase/firestore";
    import { attachCustomCommands } from "cypress-firebase";
    
    const fbConfig = {
      // Your config from Firebase Console
    };
    
    firebase.initializeApp(fbConfig);
    
    attachCustomCommands({ Cypress, cy, firebase });
    

from cypress-firebase.

scowling avatar scowling commented on June 12, 2024

Yep that is in there, although VS code is complaining that
cypress-firebase/index.d.ts' is not a module.ts(2306)

The only other stuff in commands.ts is the example boilerplate that cypress has in there

Regarding the preprocessor - I only installed cypress yesterday and that is the default setup. I can remove it if you think it might be the problem (edit: I removed it and the problem persists)

from cypress-firebase.

scowling avatar scowling commented on June 12, 2024

any thoughts here @prescottprue ?
I've tried alternate ways to import the attachCustomCommands module into commands.ts but cypress is having none of it. And VS Code still complains that cypress-firebase is not a module.

from cypress-firebase.

prescottprue avatar prescottprue commented on June 12, 2024

@scowling Did you log in that file to make sure it is being called? If cy.callFirestore is not set, then I'm almost positive it is coming down to something with attachCustomCommands

The not finding the module seems really weird - since you just started are you able to share your repo so that the issue can be reproduced? Going to try to repro on my end again later today as well

from cypress-firebase.

scowling avatar scowling commented on June 12, 2024

sorry @prescottprue it's not an empty project - just that I have just added cypress - I can't share it

Could the complication be related to the fact that it's in an NX workspace?
Folder structure is like this:

  • apps
    • main_app
    • main_app-e2e
      • src
        • fixtures
        • integration
        • plugins
        • support
      • cypress.json

I dismissed that as a problem because cypress actually runs and performs the smoke test - and then fails on expect(cy.callFirestore).to.be.a('function')

from cypress-firebase.

prescottprue avatar prescottprue commented on June 12, 2024

Happy to hear, thanks for the update. Now I know to mention checking for that in the future!

from cypress-firebase.

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.