[ANSWERED] Exit test on fail in subtest

Get help with testing, discuss unit testing strategies etc.


User avatar
nickolay
Core Developer
Core Developer
Posts: 3466
Joined: Mon May 16, 2011 10:48 am

Re: Exit test on fail in subtest

Post by nickolay »

Hm.. So `t.exit()` has to throw the exception - no other way to interrupt the test. I'll revert that.
We offer training in both Ext JS and our products, read more here.
Read the API documentation

User avatar
nickolay
Core Developer
Core Developer
Posts: 3466
Joined: Mon May 16, 2011 10:48 am

Re: Exit test on fail in subtest

Post by nickolay »

Thank you for the patience. Reverted to always throw the exception and improved `waitFor` handling. Please verify the new behavior in the tomorrow nightly.
We offer training in both Ext JS and our products, read more here.
Read the API documentation

User avatar
paulb
Posts: 24
Joined: Thu Apr 11, 2019 9:47 am

Re: Exit test on fail in subtest

Post by paulb »

Nice work nickolay! It works as expected and will be a major improvement in our workflow. Thanks a lot, really appreciated!
Do you already know when the next stable release with this feature will be available?

User avatar
nickolay
Core Developer
Core Developer
Posts: 3466
Joined: Mon May 16, 2011 10:48 am

Re: Exit test on fail in subtest

Post by nickolay »

You are welcome! :) We are planning 5.5.0 release in a week or two (it is stable already and nightly is pretty much the same).
We offer training in both Ext JS and our products, read more here.
Read the API documentation

User avatar
paulb
Posts: 24
Joined: Thu Apr 11, 2019 9:47 am

Re: Exit test on fail in subtest

Post by paulb »

Sorry to bother you again but I found way to break your breakTestOnFail config. :(

When the test fails due to an exception within the tested code the next subtest is launched. Change 'Subtest 2' to:

Code: Select all

st.it('Subtest 2', function(sst) {
	sst.chain(function(next) {
		sst.is(2, 2);
		sst.foo(); // sst.foo is not a function
		sst.waitForElementVisible('foo', next);
	}, function(next) {
		sst.waitForElementVisible('foo', next);
		sst.is(3, 3);
	});
});
When you run the given example, 'Subtest 3' is executed.

User avatar
nickolay
Core Developer
Core Developer
Posts: 3466
Joined: Mon May 16, 2011 10:48 am

Re: Exit test on fail in subtest

Post by nickolay »

He-he, thank you for the report, I'll check soon.
We offer training in both Ext JS and our products, read more here.
Read the API documentation

User avatar
nickolay
Core Developer
Core Developer
Posts: 3466
Joined: Mon May 16, 2011 10:48 am

Re: Exit test on fail in subtest

Post by nickolay »

Covered with the test and fixed.
We offer training in both Ext JS and our products, read more here.
Read the API documentation

User avatar
paulb
Posts: 24
Joined: Thu Apr 11, 2019 9:47 am

Re: Exit test on fail in subtest

Post by paulb »

Thanks again nickolay! Tested the nightly and works like a charm!

Post Reply