From 09619eac4cf3deae1b95ca85a32d37e50fdaf068 Mon Sep 17 00:00:00 2001 From: Radoslav Radev Date: Wed, 1 May 2024 21:23:13 +0200 Subject: [PATCH] added Deley to E2E tests --- Backend/Tests/E2E.Tests/LoginTests.cs | 6 ++++-- Backend/Tests/E2E.Tests/Pages/LoginPage.cs | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Backend/Tests/E2E.Tests/LoginTests.cs b/Backend/Tests/E2E.Tests/LoginTests.cs index bab16f3..b2195fc 100644 --- a/Backend/Tests/E2E.Tests/LoginTests.cs +++ b/Backend/Tests/E2E.Tests/LoginTests.cs @@ -20,6 +20,7 @@ public LoginTests(IWebDriver? driver = null) [Fact] public void Login() { + Thread.Sleep(1000); string usernameText = "raga70@abv.bg"; IWebElement usernameInput = _driver.FindElement(LoginPage.UsernameInput); foreach (var c in usernameText) @@ -59,6 +60,7 @@ public void Logout() [Fact] public void Register() { + Thread.Sleep(1000); // _driver.FindElement(LoginPage.UsernameInput).SendKeys($"Tester-{new Guid().ToString()}@abv.bg"); IWebElement usernameInput = _driver.FindElement(LoginPage.UsernameInput); string usernameText = $"Tester-{Guid.NewGuid().ToString()}@abv.bg"; @@ -75,12 +77,12 @@ public void Register() { passwordInput .SendKeys(c.ToString()); - Thread.Sleep(200); + Thread.Sleep(600); } _driver.FindElement(LoginPage.RegisterButton).Click(); - Thread.Sleep(500); + Thread.Sleep(1500); _driver.FindElement(LoginPage.AcceptEula).Click(); Thread.Sleep(5000); Assert.NotNull(_driver.FindElement(Common.LogoutButton)); diff --git a/Backend/Tests/E2E.Tests/Pages/LoginPage.cs b/Backend/Tests/E2E.Tests/Pages/LoginPage.cs index 01e82c8..15ed594 100644 --- a/Backend/Tests/E2E.Tests/Pages/LoginPage.cs +++ b/Backend/Tests/E2E.Tests/Pages/LoginPage.cs @@ -9,6 +9,6 @@ public static class LoginPage public static By LoginButton = By.XPath("""//*[@id="root"]/div[2]/div/div/article/section/button[2]"""); //after switch public static By RegisterButton = By.XPath("""//*[@id="root"]/div[2]/div/div/article/section/button[1]"""); //after switch - public static By AcceptEula = By.XPath("""//*[@id=":r2:"]/div/div[3]/button/span"""); //only available after registe pressed - + public static By AcceptEula = By.XPath("""//*[@id=":r0:"]/div/div[3]/button/span"""); //only available after registe pressed + } \ No newline at end of file