[testng-dev] testNG dependsOnMethods order of execution

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[testng-dev] testNG dependsOnMethods order of execution

Fazlan Nazeem
Hi,

I need to clarify the order of test execution with dependsOnMethods option. Suppose if I have a code like follows.

@Test
public void testA(){
}

@Test
public void testB(){
}

@Test(dependsOnMethods="testA")
public void testC(){
}


@Test(dependsOnMethods="testB")
public void testD(){
}

Is testC always guaranteed to be executed just after testA? (no other tests would run in between)
is testD  always guaranteed to be executed just after testB? (no other tests would run in between)


There doesn't seem to be any points in the documentation regarding this fact. 

--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-dev.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

[testng-dev] Re: testNG dependsOnMethods order of execution

Julien Herr
Response: No and no.

It only means:
* testC will never be run before testA, and
* testD will never be run before testB.

Priority could be used to force the order, but there is currently an issue when priority is used with dependsOnMethods: https://github.com/cbeust/testng/issues/474

Another solution may be to separate your tests into 2 different classes.

Le dimanche 1 novembre 2015 16:55:00 UTC+1, Fazlan Nazeem a écrit :
Hi,

I need to clarify the order of test execution with dependsOnMethods option. Suppose if I have a code like follows.

@Test
public void testA(){
}

@Test
public void testB(){
}

@Test(dependsOnMethods="testA")
public void testC(){
}


@Test(dependsOnMethods="testB")
public void testD(){
}

Is testC always guaranteed to be executed just after testA? (no other tests would run in between)
is testD  always guaranteed to be executed just after testB? (no other tests would run in between)


There doesn't seem to be any points in the documentation regarding this fact. 

--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-dev.
For more options, visit https://groups.google.com/d/optout.