-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugins folder not supported #2
Comments
Ah yes, they changed cypress config in 10.* :( It should be fairly similar though, can you test something like this and see if it works for you? in import { defineConfig } from 'cypress'
import generateLogin from '@intility/cypress-msal'
let publicClientConfig = {
auth: {
clientId: "APP_CLIENT_ID",
authority: "https://login.microsoftonline.com/TENANT_ID",
},
};
let requests = [
{
scopes: ["User.Read"],
},
];
let login = generateLogin(publicClientConfig, requests);
export default defineConfig({
// ...other cypress settings here...
e2e: {
setupNodeEvents(on, config) {
// `on` is used to hook into various events Cypress emits
on('task', {
// register a task named login which calls the generated login from @intility/cypress-msal
login
})
}
}
}) |
Thanks, tried this but am getting the error below...may be due to the ReferenceError
When Cypress detects uncaught errors originating from your test code it will automatically fail the current test. Cypress could not associate this error to any specific test. We dynamically generated a new test to display this failure.
|
Hi @AlphaGeek, I merged the updated getting started section, which hopefully resolves your issue 😊 |
still getting the "login is not a function" error in the before() using latest Cypress version |
@AlphaGeek can you share (the important parts of) your config / setup? |
cypress.config.ts (does it matter that it is a TS file?) [client_id] is replaced by our QA client id and [tenant] is replaced by our tentant import { defineConfig } from "cypress"; let publicClientConfig = { let requests = [ let login = generateLogin(publicClientConfig, requests); export default defineConfig({ my cypress test (smokeTest.js): describe("Ensure site is up and running", () => { it("Home page should open", () => { it("Should display the WB logo", () => { it("Should have All Active silos", () => { it("Should have Trading Desk Commentary silos", () => { after(() => { run using "npx cypress open" currently running 10.11.0 of Cypress but have tried with 12.* and had same issue |
tried using: before(() => cy.task('login')); instead of: before(() => cy.login); and that seemed to help in that I think it found it but then it timed out |
Sorry the late response, we haven't really had time to maintain this package. Just ran into something similar myself; #5 (comment) Did you find another solution to your problem? |
Docs say to include the code with the publicClientConfig, module.exports, etc in the /plugins/index.js file however I am using Cypress 10.4 and the plugins folder is no longer supported. Is there an example of how to use this with Cypress 10+?
The text was updated successfully, but these errors were encountered: