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

Ensure fragments are ignored when parsing URLs for routes #26

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

cs278
Copy link
Contributor

@cs278 cs278 commented Mar 12, 2024

Codeception/module-symfony#185

No idea why but Codeception gets the failing test information completely wrong:

There was 1 failure:
1) EventsCest: See event
 Test  tests/Functional/EventsCest.php:seeEvent
 Step  See event "non-existent-event"
 Fail  The "/register#content" url does not match with any route

Scenario Steps:

 7. $I->assertTrue(true,"seeEvent assertion fails with non-existent events.") at tests/Functional/EventsCest.php:107
 6. $I->seeEvent("non-existent-event") at tests/Functional/EventsCest.php:105
 5. $I->seeEvent("kernel.request","kernel.finish_request") at tests/Functional/EventsCest.php:103
 4. $I->seeEvent("App\Event\UserRegisteredEvent") at tests/Functional/EventsCest.php:102
 3. $I->submitSymfonyForm("registration_form",{"[email]":"[email protected]","[plainPassword]":"123456","[agreeTerms]":true}) at tests/Functional/EventsCest.php:98
 2. $I->stopFollowingRedirects() at tests/Functional/EventsCest.php:96

@cs278 cs278 marked this pull request as ready for review March 12, 2024 12:27
@TavoNiievez
Copy link
Member

I ran vendor/bin/codecept Functional -v and saw the correct error message:

There was 1 failure:
1) IssuesCest: Ensure fragments are ignored
 Test  tests\Functional\IssuesCest.php:ensureFragmentsAreIgnored
 Step  See in current route "app_register"
 Fail  The "/register#content" url does not match with any route

Scenario Steps:

 2. $I->seeInCurrentRoute("app_register") at tests\Functional\IssuesCest.php:42
 1. $I->amOnPage("/register#content") at tests\Functional\IssuesCest.php:41

Your patch fixes the issue so i'm ok with it.

@TavoNiievez TavoNiievez merged commit 3419af9 into Codeception:5.4 Mar 15, 2024
0 of 3 checks passed
@cs278 cs278 deleted the test-fragments branch March 18, 2024 21:50
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 this pull request may close these issues.

2 participants