--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to a topic in the Google Groups "Cukes" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cukes/OTUjEupNjYk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Wednesday, 13 May 2015 at 07:24, Eajaz Ali wrote:
My outcome s this step needs to completely executed, irrespective of assertion failures.
I am trying to implement asserts from junit library.
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
Hi,You can catch the assertion exceptions like below but in this case you can not see the failure assertions/steps via cucumber.> @Given("^I perform validation$")
> public I_perform_validation(){
>try{
> //assertion1 -> fail} cathc(AssertionException e) {//log something}
> //assertion2 -> pass
> //assertion3 -> pass
> }
On Wed, May 13, 2015 at 7:16 AM, Paul Rayner <pa...@virtual-genius.com> wrote:
> On Tue, May 12, 2015 at 6:50 PM, Eajaz Ali <eajaz...@gmail.com> wrote:
>>
>> Hi Team,
>>
>> I am using cucumber-jvm framework for my automation tests. I want to
>> implement continuation of my step even after there is an assertion failure.
>> For example in my step definition:
>>
>> @Given("^I perform validation$")
>> public I_perform_validation(){
>>
>> //assertion1 -> fail
>> //assertion2 -> pass
>> //assertion3 -> pass
>> }
>>
>> If assertion1 fails, I still want to continue to assertion2 and
>> assertion3.
>>
>> Can someone please help. This will be really helpful, as I don't want to
>> go over @Given 3 times for three different assertions.
>
>
> 'Given' is for setting up context, the state of the system under test, not
> for making assertions. That is what 'Then' is for.
I disagree with this statement. I find it very useful to have
assertions in Given steps. The purpose is to check that the data setup
has been done correctly.
You received this message because you are subscribed to a topic in the Google Groups "Cukes" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cukes/OTUjEupNjYk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cukes+un...@googlegroups.com.
Hi All,Thank you very much for your great advices on using Assertions. I want to perform field level validation on a particular field with different kinds of test data like blank data, invalid data, special characters.If I want to pass them from features file, then for each test data, the selenium driver is launched in @Before method. That would eat lot of time in execution only, but with manual testing if would hardly take seconds. To accommodate this, I want to include all possible assertions w.r.t UI level field level validation in my one step , for eg in @Then. At the same time. I record all my failures and successful assertions in one single run.
class MyCollector extends ErrorCollector {
@Override
public void verify() throws Throwable {
super.verify();
};
}@Then("<good description that makes the step understandable>")
public void step_def_method_name() throws Throwable {
MyCollector collector = new MyCollector();
collector.checkThat(actual1, equalTo(expected1));
collector.checkThat(actual2, equalTo(expected2));
collector.verify();
}Mila