public void ThenUserShouldBeAbleToSee(string userFullName) { try { HomePage homePage = new HomePage(CustomBaseClass.MyDriver); AssertClass.ContainsText(homePage.textUserFullName, userFullName); DriverClass.CloseTest(); } catch (Exception E) { Console.WriteLine("Test Failed: could not verify username: {0}", E.Message); DriverClass.CloseTest(); throw; } }
public void ThenUserShouldGetMessage(string error) { try { CustomBaseClass.Thinktime(10); LoginPage loginPage = new LoginPage(); AssertClass.ContainsText(loginPage.invalidUserError, error); DriverClass.CloseTest(); } catch (Exception E) { Console.WriteLine("Test Fail: Error message is incorrect: {0}", E.Message); DriverClass.CloseTest(); throw; } }