Skip to content

Verify asserts without stop tests

Jakub Raczek edited this page Jun 5, 2016 · 7 revisions

Our test framework supports Verify asserts methods, in case of failure by delegating asserts to Verify test will not be stop. Thanks to this all asserts from test can be verify and the result are presented at the test end.

Verify.That(
       this.DriverContext,
       () => Assert.AreEqual(5 + 7 + 2, forgotPassword.EnterEmail(5, 7, 2)),
       () => Assert.AreEqual("Your e-mail's been sent!", forgotPassword.ClickRetrievePassword));

You can set if screenshot will be taken or page source will be saved in case of failure of delegated assert (by default both are disabled).

Verify.That(this.DriverContext, () => Assert.IsFalse(flag), true, true);
Verify.That(
    this.DriverContext,
    true,
    false,
    () => Assert.AreEqual(5 + 7 + 2, forgotPassword.EnterEmail(5, 7, 2)),
    () => Assert.AreEqual("Your e-mail's been sent!", forgotPassword.ClickRetrievePassword));

Verify API

Clone this wiki locally