I am testing this site for concierge medical professionals, written in Zoho.
The flow, of the section in question, is as follows:
once practice is created, user is to:
Right now, I have the practice contract and rate card test suites completed, and parameterized/sanity test cases for the discount and retainer schedule test suites. Neither is deterministic right now, as both of those require one "free" rate card, and right now, there's no control for that in the test cases like there is in the rate card test cases.
The rate card test case has, as its initial/teardown steps, logic to create dummy contract if there isn't a "free" contract to assign the rate card to, and we delete the dummy contract if one had to be created:
// creating dummy contracts iff there is less than 1 unassigned contract. Else if there are more, we fail the test right away, because that would require us choose one, which is not, by definition a sanity test case concern.
PracticePage initPage = new PracticePage(practiceProfile.getPracticeURL());
if (!hasUnassignedContract()) {
createDummyContract()
WebUI.verifyEqual(initPage.getNumberOfContracts(), initPage.getNumberOfRateCards() + 1)
}
@TearDown
void close() {
if (PracticePage.NewContractsCreated > 0) {
PracticePage page = new PracticePage(((PracticeProfile)practiceProfile).getPracticeURL());
page.go();
page.deleteFirstContract();
}
}
Discount and retainer schedule test cases, since they require a rate card to work off of, should:
but wait a minute, the contract deletion logic happens in the child test case, which means that the contract is going to be deleted once child test case is done!
How can we either:
?
I don't like having to do this, as it adds another if-condition, but here goes:
PracticePage
, as a static method :public static void DeleteFirstContract(String practiceURL) {
if (this.NewContractsCreated > 0) {
PracticePage page = new PracticePage(practiceURL);
page.go();
page.deleteFirstContract();
}
}
shouldHandleTeardown
, default value = true, andif (shouldHandleTeardown) PracticePage.DeleteFirstContract(practiceProfile.getPracticeURL())
or something similar, and finally
Unless someone contradicts me on here, no it doesn't seem possible to call, let alone delay the execution of, a method of a child test case from a drive test case.