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

Comments

Projects
None yet
3 participants
@Fuin

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

This comment has been minimized.

Show comment
Hide comment
@edno

edno Dec 21, 2016

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@edno

edno Dec 21, 2016

Contributor

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

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

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

This comment has been minimized.

Show comment
Hide comment
@Fuin

Fuin 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?

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

This comment has been minimized.

Show comment
Hide comment
@edno

edno Dec 22, 2016

Contributor

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

Contributor

edno commented Dec 22, 2016

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

@Naktibalda

This comment has been minimized.

Show comment
Hide comment
@Naktibalda

Naktibalda Dec 29, 2016

Member

The fix was merged.

Member

Naktibalda commented Dec 29, 2016

The fix was merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment