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

@depends doesnt work with @dataprovider #3862

Closed
Fuin opened this issue Dec 21, 2016 · 5 comments
Closed

@depends doesnt work with @dataprovider #3862

Fuin opened this issue Dec 21, 2016 · 5 comments

Comments

@Fuin
Copy link

Fuin commented Dec 21, 2016

Hello

I have an @Depends as well as an @dataProvider annotation on one of my tests.

/**
* @param \Step\Acceptance\Login $I
*
* @Depends ProfileManagement\RegistrationCest:registerWithRequiredFields
* @dataProvider userProvider
*/
public function editPassword(\Step\Acceptance\Login $I, Example $example)
{
$I->amOnPage(HomePage::$URL);
$I->login();
$I->waitForElementVisible(ProfilePage::$profileChangePasswordFirstField);
$I->fillField(ProfilePage::$profileChangePasswordFirstField, $example['password']);
$I->fillField(ProfilePage::$profileChangePasswordSecondField, $example['password']);
$I->click(ProfilePage::$profileSaveNewPasswordButton);
$I->waitForElementVisible(ProfilePage::$profileMessageContainer);
$I->canSee('Passwort würde erfolgreich geändert', ProfilePage::$profileMessageContainer);
}

It works well for that one test however all following tests which have the @Depends annotation are skipped with the message

Dependent test for ProfileManagement\UpdateProfileCest:editPassword not found

If I add the @dataProvider annotation to all tests with @Depends its working

Codeception version: 2.2.7
PHP Version: 5.7.3
Operating System: Windows 7
Installation type: Composer

@edno
Copy link
Contributor

edno commented Dec 21, 2016

Confirmed, however, in my case only the last test is skipped even if it does not have a @depends annotation. Also some suites are not affected by this issue.

@edno
Copy link
Contributor

edno commented Dec 21, 2016

@Fuin can you try in your project the fix proposed.

The fix is located in vendor/Codeception/src/Codeception/SuiteManager.php

@Fuin
Copy link
Author

Fuin commented Dec 22, 2016

Thanks, I've changed the lines in SuiteManager and all tests are working fine.
Is this going to be added to the 2.2.8 Release and when is it?

@edno
Copy link
Contributor

edno commented Dec 22, 2016

If fine with @DavertMik then yes it will be available in 2.2.8.

@Naktibalda
Copy link
Member

The fix was merged.

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

No branches or pull requests

3 participants