cypress-firebase | Cypress plugin and custom commands | Authentication library

 by   prescottprue TypeScript Version: 4.0.0 License: MIT

kandi X-RAY | cypress-firebase Summary

kandi X-RAY | cypress-firebase Summary

cypress-firebase is a TypeScript library typically used in Security, Authentication, Firebase applications. cypress-firebase has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub, GitLab.

Cypress plugin and custom commands for testing Firebase projects
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              cypress-firebase has a low active ecosystem.
              It has 255 star(s) with 48 fork(s). There are 7 watchers for this library.
              There were 1 major release(s) in the last 6 months.
              There are 24 open issues and 82 have been closed. On average issues are closed in 152 days. There are 8 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of cypress-firebase is 4.0.0

            kandi-Quality Quality

              cypress-firebase has 0 bugs and 0 code smells.

            kandi-Security Security

              cypress-firebase has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              cypress-firebase code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              cypress-firebase is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              cypress-firebase releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 181 lines of code, 0 functions and 70 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cypress-firebase
            Get all kandi verified functions for this library.

            cypress-firebase Key Features

            No Key Features are available at this moment for cypress-firebase.

            cypress-firebase Examples and Code Snippets

            No Code Snippets are available at this moment for cypress-firebase.

            Community Discussions

            QUESTION

            cypress-io/github-action does not accept all environment variables
            Asked 2021-Oct-19 at 11:05

            my purpose is simple, run cypress e2e test using Github actions upon Pull Request. I used cypress-firebase for testing and all my test should run with Firebase Emulator. And I also used cypress-io/github-action for CI.

            My problem is, when using cypress-io/github-action, I need to pass some environment variables for my react app to work with Firebase emulator, and all environment variables can not be recognized by the whole entire app. See my workflow file to understand.

            Here are my related part of my Github action workflow file:

            ...

            ANSWER

            Answered 2021-Oct-19 at 11:05

            According to the docs You can define environment variables for a step, job, or entire workflow, so here you defined those env variables only for this step Cypress run and not for the entire job, to solve this you should define env variables using this, an example:

            Source https://stackoverflow.com/questions/69629218

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install cypress-firebase

            Note: These instructions assume your tests are in the cypress folder (cypress' default). See the folders section below for more info about other supported folders.
            Install cypress-firebase and firebase-admin both: yarn add -D cypress-firebase firebase-admin@9 or npm i --save-dev cypress-firebase firebase-admin@9 (NOTE: firebase-admin v10 modules is not yet supported, but is in the works)
            Go to project setting on firebase console and generate new private key. See how to do so in the Google Docs.
            Add serviceAccount.json to your .gitignore (THIS IS VERY IMPORTANT TO KEEPING YOUR INFORMATION SECURE!)
            Save the downloaded file as serviceAccount.json in the root of your project (make sure that it is .gitignored) - needed for firebase-admin to have read/write access to your DB from within your tests
            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 }); With Firebase Web SDK version 9 import firebase from "firebase/compat/app"; import "firebase/compat/auth"; import "firebase/compat/database"; import "firebase/compat/firestore"; import { attachCustomCommands } from "cypress-firebase"; const fbConfig = { // Your config from Firebase Console }; firebase.initializeApp(fbConfig); attachCustomCommands({ Cypress, cy, firebase });
            Make sure that you load the custom commands file in an cypress/support/index.js like so: import "./commands"; NOTE: This is a pattern which is setup by default by Cypress, so this file may already exist
            Setup plugin adding following your plugins file (cypress/plugins/index.js): const admin = require("firebase-admin"); const cypressFirebasePlugin = require("cypress-firebase").plugin; module.exports = (on, config) => { const extendedConfig = cypressFirebasePlugin(on, config, admin); // Add other plugins/tasks such as code coverage here return extendedConfig; }; With Typescript import admin from "firebase-admin"; import { plugin as cypressFirebasePlugin } from "cypress-firebase"; module.exports = ( on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions ) => { const extendedConfig = cypressFirebasePlugin(on, config, admin); return extendedConfig; };
            To confirm things are working, create a new test file (cypress/integration/examples/test_hello_world.js) adding a test that uses the cypress-firebase custom command (cy.callFirestore): describe("Some Test", () => { it("Adds document to test_hello_world collection of Firestore", () => { cy.callFirestore("add", "test_hello_world", { some: "value" }); }); });
            From the root of your project, start Cypress with the command $(npm bin)/cypress open. In the Cypress window, click your new test (test_hello_world.js) to run it.
            Look in your Firestore instance and see the test_hello_world collection to confirm that a document was added.
            Pat yourself on the back, you are all setup to access Firebase/Firestore from within your tests!
            Go to Authentication page of the Firebase Console and select an existing user to use as the testing account or create a new user. This will be the account which you use to login while running tests.
            Get the UID of the account you have selected, we will call this UID TEST_UID
            Set the UID of the user you created earlier to the Cypress environment. You can do this using a number of methods: Adding CYPRESS_TEST_UID to a .env file which is gitignored Adding TEST_UID to cypress.env.json (make sure you place this within your .gitignore) Adding as part of your npm script to run tests with a tool such as cross-env here: "test": "cross-env CYPRESS_TEST_UID=your-uid cypress open"
            Call cy.login() with the before or beforeEach sections of your tests

            Support

            When using a custom app name or running more than one firebase instance in your app:.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i cypress-firebase

          • CLONE
          • HTTPS

            https://github.com/prescottprue/cypress-firebase.git

          • CLI

            gh repo clone prescottprue/cypress-firebase

          • sshUrl

            git@github.com:prescottprue/cypress-firebase.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Authentication Libraries

            supabase

            by supabase

            iosched

            by google

            monica

            by monicahq

            authelia

            by authelia

            hydra

            by ory

            Try Top Libraries by prescottprue

            react-redux-firebase

            by prescottprueJavaScript

            redux-firestore

            by prescottprueJavaScript

            generator-react-firebase

            by prescottprueJavaScript

            fireadmin

            by prescottprueJavaScript

            firebase-ci

            by prescottprueJavaScript