Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jraczek-acc committed Dec 6, 2024
1 parent d8e789f commit ac1f807
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
6 changes: 4 additions & 2 deletions Ocaramba.Documentation/Ocaramba.Documentation.shfbproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@
<Preliminary>False</Preliminary>
<HeaderText>Framework to automate tests using Selenium WebDriver</HeaderText>
<FeedbackEMailAddress>ocaramba%40objectivity.co.uk</FeedbackEMailAddress>
<CopyrightHref>http://www.objectivity.co.uk/</CopyrightHref>
<FeedbackEMailAddress>ocarmaba%40objectivity.co.uk</FeedbackEMailAddress>
<CopyrightHref>http://www.accenture.com</CopyrightHref>
<FeedbackEMailAddress>
</FeedbackEMailAddress>
<SdkLinkTarget>Blank</SdkLinkTarget>
<MissingTags>Summary, Parameter, Returns, AutoDocumentCtors, TypeParameter, AutoDocumentDispose</MissingTags>
<DocumentationSources>
Expand All @@ -77,6 +78,7 @@
</configuration>
</PlugInConfig>
</PlugInConfigurations>
<FrameworkVersion>.NET Framework 4.7.2</FrameworkVersion>
</PropertyGroup>
<!-- There are no properties for these groups. AnyCPU needs to appear in order for Visual Studio to perform
the build. The others are optional common platform types that may appear. -->
Expand Down
23 changes: 11 additions & 12 deletions Ocaramba.Tests.NUnit/Tests/HerokuappTestsNUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ public void BasicAuthTest()
var basicAuthPage =
new InternetPage(this.DriverContext).OpenHomePageWithUserCredentials().GoToBasicAuthPage();

//Verify.That(
// this.DriverContext,
// () =>
//Assert.AreEqual(
// "Congratulations! You must have the proper credentials.",
// basicAuthPage.GetCongratulationsInfo));
Verify.That(
this.DriverContext,
() => Assert.That(basicAuthPage.GetCongratulationsInfo, Is.EqualTo("Congratulations! You must have the proper credentials."))
);
}

[Test]
Expand All @@ -54,10 +52,11 @@ public void ForgotPasswordTest()

var forgotPassword = new ForgotPasswordPage(this.DriverContext);

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

[Test]
Expand All @@ -70,8 +69,8 @@ public void MultipleWindowsTest()
.GoToMultipleWindowsPage()
.OpenNewWindowPage();

// Assert.True(newWindowPage.IsPageTile(PageTitle), "wrong page title, should be {0}", PageTitle);
//Assert.True(newWindowPage.IsNewWindowH3TextVisible(PageTitle), "text is not equal to {0}", PageTitle);
Assert.That(newWindowPage.IsPageTile(PageTitle), Is.True, "wrong page title, should be {0}", PageTitle);
Assert.That(newWindowPage.IsNewWindowH3TextVisible(PageTitle), Is.True, "text is not equal to {0}", PageTitle);
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public MultipleWindowsPage(DriverContext driverContext)
public NewWindowPage OpenNewWindowPage()
{
this.Driver.GetElement(this.clickHerePageLocator).Click();
this.Driver.SwitchToWindowUsingUrl(new Uri("http://the-internet.herokuapp.com/windows/new"), 5);
this.Driver.SwitchToWindowUsingUrl(new Uri("https://the-internet.herokuapp.com/windows/new"), 5);
return new NewWindowPage(this.DriverContext);
}
}
Expand Down
1 change: 1 addition & 0 deletions OcarambaLite/Extensions/WebDriverExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ public static void SwitchToWindowUsingUrl(this IWebDriver webDriver, Uri url, do
}
}

Logger.Debug($"Driver url {driver.Url}");
return false;
});
}
Expand Down

0 comments on commit ac1f807

Please sign in to comment.