Open AlanMendicutti opened 1 year ago
@AlanMendicutti make sure you are returning the plugin as per the setup documentation (your example only calls cypressFirebasePlugin
but doesn't return it in setupNodeEvents
:
setupNodeEvents(on, config) {
// implement node event listeners here
- cypressFirebasePlugin(on, config, admin);
+ return cypressFirebasePlugin(on, config, admin);
},
Did you also make sure to setup custom commands using attachCustomCommands
:
cypress/support/e2e.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 });
@prescottprue Yes this is me e2e.ts (btw i'm using Typescript)
import firebase from 'firebase/compat/app';
import 'firebase/compat/auth';
import 'firebase/compat/firestore';
import 'firebase/compat/database';
import { attachCustomCommands } from 'cypress-firebase';
const fbConfig = {
apiKey: "xxxx",
authDomain: "xxxx",
projectId: "xxxx",
storageBucket: "xxxx",
messagingSenderId: "xxx",
appId: "xxxx",
};
firebase.initializeApp(fbConfig);
attachCustomCommands({ Cypress, cy, firebase });
The issue with typescript is that i can't add the return statement for the cypressFirebasePlugin
Because i get this:
Type '(on: PluginEvents, config: PluginConfigOptions) => ExtendedCypressConfig' is not assignable to type '(on: PluginEvents, config: PluginConfigOptions) => void | PluginConfigOptions | Promise<void | PluginConfigOptions>'.
But could that be related? Because locally works great. It's only in the github actions where I get that error.
@AlanMendicutti - is there a reason for the import of cypress-firebase within the test itself? That could cause issues
Is the rest of stack available in the error? I.e. showing what line is calling .includes
?
Not at all, I removed it and the same issue persists. I've tried to see the stack trace but without success.
I just realized that it gets that error if it has a cy.wait(n miliseconds);
or cy.contains('anything');
So it's more probably related to a node versions compatibility, right @prescottprue ?
@AlanMendicutti Node 18 is still supported, so I'm not sure why it would be a node version compatibility issue
If you are able to provide a repo where this issue is able to be replicated I'm sure we can get to the bottom of it. I've tried a number of combinations, but haven't been able to replicate
The test is crashing and returning to the login page after showing this error message: "Cannot read properties of undefined (reading 'includes')"
This was working yesterday, and then all of the sudden today it started to show that error.
BTW the error only shows up in my Github Actions (CD/CD flow) during the cypress tests execution. Locally works like a charm.
My config: next13-pwa (0.1.0)
node (18.16.2)
cypress (^13.1.0) cypress-firebase (^2.2.5)
The test that fails:
My cypress.config.ts
The error message:
Does anyone else is going through this? Thanks!