public void SeleniumSoftAssertIsTrueFalseConditionPageSource() { this.WebDriver.Navigate().GoToUrl(TestSiteAutomationUrl); this.Log = new FileLogger(string.Empty, "SeleniumSoftAssertIsTrueFalseConditionPageSource.txt", MessageType.GENERIC, true); SeleniumSoftAssert seleniumSoftAssert = new SeleniumSoftAssert(this.TestObject); string logLocation = ((FileLogger)this.Log).FilePath; string pageSourceLocation = logLocation.Substring(0, logLocation.LastIndexOf('.')) + "_PS (1).txt"; bool isFalse = seleniumSoftAssert.IsTrue(false, "testSoftAssert", "message"); Assert.IsTrue(File.Exists(pageSourceLocation), "Fail to find page source"); File.Delete(pageSourceLocation); File.Delete(logLocation); Assert.IsFalse(isFalse); }
public void SeleniumSoftAssertIsFalseTrueConditionPageSource() { // Make sure we initialized the web driver Assert.IsNotNull(this.WebDriver); SeleniumSoftAssert seleniumSoftAssert = new SeleniumSoftAssert(this.TestObject); string logLocation = ((FileLogger)this.Log).FilePath; string pageSourceLocation = logLocation.Substring(0, logLocation.LastIndexOf('.')) + "_PS (1).txt"; bool isFalse = seleniumSoftAssert.IsFalse(true, "testSoftAssert", "message"); Assert.IsTrue(File.Exists(pageSourceLocation), "Fail to find page source"); File.Delete(pageSourceLocation); Assert.IsFalse(isFalse); }
public void SeleniumSoftAssertIsFalseTrueCondition() { // Make sure we initialized the web driver Assert.IsNotNull(this.WebDriver); SeleniumSoftAssert seleniumSoftAssert = new SeleniumSoftAssert(TestObject); string logLocation = ((FileLogger)Log).FilePath; string screenShotLocation = logLocation.Substring(0, logLocation.LastIndexOf('.')) + " testSoftAssert" + " (1).png"; bool isFalse = seleniumSoftAssert.IsFalse(true, "testSoftAssert", "message"); Assert.IsTrue(File.Exists(screenShotLocation), "Fail to find screenshot"); File.Delete(screenShotLocation); Assert.IsFalse(isFalse); }