From b10f27157a7ca3cc010c65d1ee1411af75b56590 Mon Sep 17 00:00:00 2001 From: KarmaKamikaze Date: Mon, 13 Nov 2023 16:19:13 +0100 Subject: [PATCH] Better test case names --- ChatRPGTests/ChatRPGFixture.cs | 1 - ChatRPGTests/E2ETestUtility.cs | 1 + ...xE2ETests.cs => UnauthorizedIndexE2ETests.cs} | 16 ++++++++-------- 3 files changed, 9 insertions(+), 9 deletions(-) rename ChatRPGTests/{IndexE2ETests.cs => UnauthorizedIndexE2ETests.cs} (83%) diff --git a/ChatRPGTests/ChatRPGFixture.cs b/ChatRPGTests/ChatRPGFixture.cs index 3fe9d8d..902a6c5 100644 --- a/ChatRPGTests/ChatRPGFixture.cs +++ b/ChatRPGTests/ChatRPGFixture.cs @@ -25,7 +25,6 @@ public async Task InitializeAsync() public async Task DisposeAsync() { - // Stop the app when the tests are done if (!_appProcess!.HasExited) { _appProcess.Kill(); diff --git a/ChatRPGTests/E2ETestUtility.cs b/ChatRPGTests/E2ETestUtility.cs index f5e5b76..fdc8b52 100644 --- a/ChatRPGTests/E2ETestUtility.cs +++ b/ChatRPGTests/E2ETestUtility.cs @@ -25,6 +25,7 @@ public static void Teardown(IWebDriver driver) catch { // Was not logged in or unable to log out + // We do not care if it fails during teardown } driver.Close(); diff --git a/ChatRPGTests/IndexE2ETests.cs b/ChatRPGTests/UnauthorizedIndexE2ETests.cs similarity index 83% rename from ChatRPGTests/IndexE2ETests.cs rename to ChatRPGTests/UnauthorizedIndexE2ETests.cs index 1c029a6..6a4fe04 100644 --- a/ChatRPGTests/IndexE2ETests.cs +++ b/ChatRPGTests/UnauthorizedIndexE2ETests.cs @@ -4,13 +4,13 @@ namespace ChatRPGTests; [Collection("E2E collection")] -public class IndexE2ETests : IDisposable +public class UnauthorizedIndexE2ETests : IDisposable { private readonly ChatRPGFixture _fixture; private readonly IWebDriver _driver; private readonly WebDriverWait _wait; - public IndexE2ETests(ChatRPGFixture fixture) + public UnauthorizedIndexE2ETests(ChatRPGFixture fixture) { _fixture = fixture; _driver = E2ETestUtility.Setup("/"); @@ -18,7 +18,7 @@ public IndexE2ETests(ChatRPGFixture fixture) } [Fact] - public void IndexPage_ContainsTitleText() + public void UnauthorizedIndexPage_ContainsTitleText() { // Arrange string expectedTitle = "ChatRPG"; @@ -32,7 +32,7 @@ public void IndexPage_ContainsTitleText() } [Fact] - public void IndexPage_ContainsSloganText() + public void UnauthorizedIndexPage_ContainsSloganText() { // Arrange string expectedSlogan = "Immerse yourself in the ultimate AI-powered adventure!"; @@ -46,7 +46,7 @@ public void IndexPage_ContainsSloganText() } [Fact] - public void IndexPage_ContainsLoginButton() + public void UnauthorizedIndexPage_ContainsLoginButton() { Thread.Sleep(1000); // wait for typing animation to finish // Act @@ -57,7 +57,7 @@ public void IndexPage_ContainsLoginButton() } [Fact] - public void IndexPage_ContainsRegisterButton() + public void UnauthorizedIndexPage_ContainsRegisterButton() { Thread.Sleep(1000); // wait for typing animation to finish // Act @@ -68,7 +68,7 @@ public void IndexPage_ContainsRegisterButton() } [Fact] - public void PressingLoginButton_ShouldRedirectToLoginPage() + public void UnauthorizedIndexPage_PressingLoginButton_ShouldRedirectToLoginPage() { Thread.Sleep(1000); // wait for typing animation to finish // Act @@ -81,7 +81,7 @@ public void PressingLoginButton_ShouldRedirectToLoginPage() } [Fact] - public void PressingRegisterButton_ShouldRedirectToRegisterPage() + public void UnauthorizedIndexPage_PressingRegisterButton_ShouldRedirectToRegisterPage() { Thread.Sleep(1000); // wait for typing animation to finish // Act