mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-23 15:14:49 +01:00
Fix test
This commit is contained in:
@@ -99,9 +99,7 @@ namespace BTCPayServer.Tests
|
||||
|
||||
public string RegisterNewUser(bool isAdmin = false)
|
||||
{
|
||||
GoToHome();
|
||||
if (Driver.PageSource.Contains("id=\"Logout\""))
|
||||
Logout();
|
||||
EnsureLogout();
|
||||
var usr = RandomUtils.GetUInt256().ToString().Substring(20) + "@a.com";
|
||||
Driver.FindElement(By.Id("Register")).Click();
|
||||
Driver.FindElement(By.Id("Email")).SendKeys(usr);
|
||||
@@ -114,6 +112,13 @@ namespace BTCPayServer.Tests
|
||||
return usr;
|
||||
}
|
||||
|
||||
private void EnsureLogout()
|
||||
{
|
||||
GoToHome();
|
||||
if (Driver.PageSource.Contains("id=\"Logout\""))
|
||||
Logout();
|
||||
}
|
||||
|
||||
public (string storeName, string storeId) CreateNewStore()
|
||||
{
|
||||
var usr = "Store" + RandomUtils.GetUInt64().ToString();
|
||||
@@ -205,10 +210,10 @@ namespace BTCPayServer.Tests
|
||||
|
||||
public void Login(string user, string password)
|
||||
{
|
||||
EnsureLogout();
|
||||
Driver.FindElement(By.Id("Email")).SendKeys(user);
|
||||
Driver.FindElement(By.Id("Password")).SendKeys(password);
|
||||
Driver.FindElement(By.Id("LoginButton")).Click();
|
||||
|
||||
}
|
||||
|
||||
public void GoToStore(string storeId, StoreNavPages storeNavPage = StoreNavPages.Index)
|
||||
|
||||
Reference in New Issue
Block a user