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

dependsOnMethods not working when dependency is on scenarios with dataProviders #271

Closed
2 of 5 tasks
raviguptasmarsh opened this issue May 15, 2019 · 6 comments
Closed
2 of 5 tasks

Comments

@raviguptasmarsh
Copy link

raviguptasmarsh commented May 15, 2019

QAF Version

Latest

Steps To Reproduce

1. Create a scenario(ONE) with csv data provider so that its scenario name gets appended with the first column name in the csv data provider.
2. In another scenario(TWO), use this scenario name as a data provider.
3. Run the scenario.

Expected behavior

ONE should run followed by TWO

Actual behavior

No tests run

Is the issue reproducible on runner?

  • QAS
  • Maven - Yes
  • Gradle
  • Ant
  • Eclipse - Yes

Test case sample

SCENARIO: TWO
META-DATA: {"description":"Test Scenario TWO","groups":["SMOKE"],"dependsOnMethods":["ONE"]}

COMMENT: "THIS IS Scenario <TWO> depends on <ONE>"

END

SCENARIO: ONE
META-DATA: {"description":"Test Scenario ONE","groups":["SMOKE"], "dataFile":"resources/test.csv}

 COMMENT: "THIS IS Scenario <TWO> depends on <ONE>"

END

test.csv
summary,num_of_users
with 1 user,1
with 10 users,10

@raviguptasmarsh
Copy link
Author

Other observation:
Also tried
"dependsOnMethods":["ONE - with 1 user","ONE - with 10 users"]
but same result was seen.

@naeem-github
Copy link
Contributor

Hi @raviguptasmarsh For the workaround you can use priority metadata as mentioned in Test case meta-data

@raviguptasmarsh
Copy link
Author

Yes, @naeem-github as of now using either "priority" or "dependsOnGroups" as workaround.

@cjayswal
Copy link
Member

Related or duplicate to #66

@shivaprasad2634
Copy link

shivaprasad2634 commented Feb 19, 2022

This is still not resolved. this is important feature we need. In one of th old post from Amit I found he mentioned
Link : #83
<<<
Depends on method will work only when both methods class instance is same. For BDD/KWD Scenario both Scenario class instance would be different, so it was not working. So now for Scenarios it will check methods class name only.

there are file changes under [src/org/testng/DependencyMap.java]. as part of this change . But now it looks reverted in 3.1.0-RC2

@cjayswal
Copy link
Member

cjayswal commented Feb 20, 2022

Refer #281, With qaf 3.0.0 test dependency with BDD or Feature file is not supported, it will be supported with RuntimeScenarioFactory. You can refer comment on #281 or alternate as suggested in this post.

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

No branches or pull requests

4 participants