Skip to content

Commit

Permalink
added Deley to E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Radoslav Radev committed May 1, 2024
1 parent 51945ce commit 09619ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Backend/Tests/E2E.Tests/LoginTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public LoginTests(IWebDriver? driver = null)
[Fact]
public void Login()
{
Thread.Sleep(1000);
string usernameText = "[email protected]";
IWebElement usernameInput = _driver.FindElement(LoginPage.UsernameInput);
foreach (var c in usernameText)
Expand Down Expand Up @@ -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";
Expand All @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions Backend/Tests/E2E.Tests/Pages/LoginPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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

}

0 comments on commit 09619ea

Please sign in to comment.