Skip to content
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

Laravel route "login" does not exist. #55

Open
troccoli opened this issue Jun 4, 2022 · 6 comments · May be fixed by #91
Open

Laravel route "login" does not exist. #55

troccoli opened this issue Jun 4, 2022 · 6 comments · May be fixed by #91

Comments

@troccoli
Copy link

troccoli commented Jun 4, 2022

I'm using Cypress 10, which may be relevant, and version 2.2.1 of this package.

I have a simple test to check the login form works

describe('Login', function () {
    it('redirects to the home page once logged in', function () {
        cy.visit({route: 'login'})
            .get('#email').type('[email protected]')
            .get('#password').type('password')
            .get('[type="submit"]').click()
            .url().should('eq', Cypress.config().baseUrl + '/');
    });
});

The test passes, but I get the message Laravel route "login" does not exist.

Screenshot 2022-06-04 at 15 31 05

It clearly exists so I'm not sure what is that about. Besides, the message in an assertion and it's green, which indicates it's not an error (which is correct).

Could it be that maybe the package is trying to assert the route exist rather than it doesn't?

@rcrespo9
Copy link

facing the same issue

@i-bajrai
Copy link

@troccoli I have the same issue but if I add cy.refreshRoutes() to the top of the test then its happy.

@troccoli
Copy link
Author

I do call cy.refreshRoutes() in the before() method.

@Joucke
Copy link

Joucke commented Oct 31, 2022

It looks like the route handler (in laravel-routes.js) is correctly validating that the route exists, but the "error message" is stating the opposite of what it should state.

I think the feedback Chai and Cypress are giving, should be what we're trying to assert, not what we want to know if the assertion fails. E.g. Assert the route exists, then the message should be "Laravel route "login" should exist"

@Thinkro
Copy link

Thinkro commented Dec 2, 2022

Placing cy.refreshRoutes() in before() does not fix this for me

@Slund
Copy link

Slund commented Dec 2, 2022

I'm ignoring these messages for now. It's only the representation in the Cypress UI that is a bit misleading. The message doesn't appear when running headless mode unless the route actually doesn't exist.

@troccoli troccoli linked a pull request Nov 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants