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 for BDD #281

Closed
5 tasks done
infoneershalin opened this issue Jul 8, 2019 · 1 comment
Closed
5 tasks done

dependsOnMethods not working for BDD #281

infoneershalin opened this issue Jul 8, 2019 · 1 comment

Comments

@infoneershalin
Copy link

QAF Version

2.1.14, 2.1.15-beta-1, 2.1.15-beta-2

Steps To Reproduce

1. Create BDD with dependentScenarios and make one scenario(on which other scenario is dependent) fail/skip.

Expected behavior

Dependent scenario should not be executed.

Actual behavior

Dependent scenario gets executed.

Is the issue reproducible on runner?

  • QAS
  • Maven
  • Gradle
  • Ant
  • Eclipse

Test case sample

SCENARIO: SignUp
META-DATA: {"description":"Sample Test Scenario","groups":["SMOKE"]}

    Given this should fail or skip
    
END



SCENARIO: Login
META-DATA: {"description":"Sample Test Scenario","groups":["SMOKE"],"dependsOnMethods":["SignUp"]}

    Given COMMENT: "This should not run"
    
END
@cjayswal
Copy link
Member

cjayswal commented Mar 17, 2020

With qaf 3.0.0 we may not support test dependency with BDD or Feature file. If one want to take benefit of test dependency and still want to implement BDD new feature of RuntimeScenarioFactory can be useful, where scenario is create during execution in Java code just like reading from BDD or Feature file. It will look like:

 import static com.qmetry.qaf.automation.step.client.RuntimeScenarioFactory.scenario;
 
@Test(description="a sample scenario" ...)
 public void testWithGivenWhenThen() {

 	scenario().
	given("a precondition",()->{
 		//write appropriate code...
 	}).
 	when("some action performed",()->{
 		//write appropriate code...
 	}).
 	then("it should have expected outcome",()->{
 		//write appropriate code...
 	}).
 	execute();
 }

This will have all feature of BDD, like dry-run, reporting of each step including not-run steps, step listeners...

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

2 participants