Code Monkey home page Code Monkey logo

Comments (6)

prescottprue avatar prescottprue commented on June 12, 2024 1

Yes I really like this idea a lot, thanks for posting! I actually was considering this as a way to support adding login for multiple users by UID (as mentioned in #14 ).

from cypress-firebase.

dhair-seva avatar dhair-seva commented on June 12, 2024 1

That would be amazing to have. Now thinking about it, it might be more valuable to directly use your command, kind of like how you use cy.callFirestore. At that point, we could do cy.exec("${npm bin}/createTestEnvFile"). Then we can pass in the uid into this command. Anyway, those are some ideas. After Christmas, I will have more time to help contribute when these type of issues come up. But for now, I can only give ideas since I don't have as much time as I would like.

from cypress-firebase.

dhair-seva avatar dhair-seva commented on June 12, 2024

Here is a reference I used that gave me this idea.
https://glebbahmutov.com/blog/powerful-cy-task/

from cypress-firebase.

dhair-seva avatar dhair-seva commented on June 12, 2024

@prescottprue I tried doing my last comment with this code:

Cypress.env("TEST_UID", CypressConfig.users[role].uid)
return cy
  .exec(`set TEST_UID=${CypressConfig.users[role].uid}`)
  .exec("npm run e2e:set:config", { env: process.env }).its("stdout").should("contain", "cypress.env.json updated successfully")

My script in package.json is:

./node_modules/.bin/cypress-firebase createTestEnvFile

I also tried the second exec command to be node_modules\\.bin\\cypress-firebase createTestEnvFile. Both commands shut down cypress' browser with no error. If I comment out the second exec command, it runs just fine. It seems that it fails only when I'm running that command. I can run, for example, npm run lint (I know, I would never run that in cypress, but just as a test).

Any ideas why it would fail with createTestEnvFile?

from cypress-firebase.

dhair-seva avatar dhair-seva commented on June 12, 2024

Doesn't this issue get resolved with 0.10.0?

from cypress-firebase.

prescottprue avatar prescottprue commented on June 12, 2024

@dhair-seva Yes it does - thanks for posting.

I guess it doesn't necessarily update the value in the environment as described by the title, but a new JWT is generated when passing a UID to cy.login, it just isn't written to the environment.

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.