Verifying presence of wallet warning on store list

This commit is contained in:
rockstardev
2020-10-17 15:53:07 -05:00
parent be9cc41957
commit d90fcf15bd
3 changed files with 14 additions and 6 deletions

View File

@@ -228,7 +228,11 @@ namespace BTCPayServer.Tests
Driver.FindElement(By.Id("Email")).SendKeys(user); Driver.FindElement(By.Id("Email")).SendKeys(user);
Driver.FindElement(By.Id("Password")).SendKeys(password); Driver.FindElement(By.Id("Password")).SendKeys(password);
Driver.FindElement(By.Id("LoginButton")).Click(); Driver.FindElement(By.Id("LoginButton")).Click();
}
public void GoToStores()
{
Driver.FindElement(By.Id("Stores")).Click();
} }
public void GoToStore(string storeId, StoreNavPages storeNavPage = StoreNavPages.Index) public void GoToStore(string storeId, StoreNavPages storeNavPage = StoreNavPages.Index)

View File

@@ -300,13 +300,18 @@ namespace BTCPayServer.Tests
{ {
await s.StartAsync(); await s.StartAsync();
var alice = s.RegisterNewUser(); var alice = s.RegisterNewUser();
var store = s.CreateNewStore().storeName; var storeData = s.CreateNewStore();
// verify that hints are displayed on the store page // verify that hints are displayed on the store page
Assert.True(s.Driver.PageSource.Contains("Wallet not setup for the store, please provide Derviation Scheme"), Assert.True(s.Driver.PageSource.Contains("Wallet not setup for the store, please provide Derviation Scheme"),
"Wallet hint not present"); "Wallet hint not present");
Assert.True(s.Driver.PageSource.Contains("Review settings if you want to receive Lightning payments"), Assert.True(s.Driver.PageSource.Contains("Review settings if you want to receive Lightning payments"),
"Lightning hint not present"); "Lightning hint not present");
s.GoToStores();
Assert.True(s.Driver.PageSource.Contains("warninghint_" + storeData.storeId),
"Warning hint on list not present");
s.GoToStore(storeData.storeId);
s.AddDerivationScheme(); // wallet hint should be dismissed s.AddDerivationScheme(); // wallet hint should be dismissed
s.Driver.AssertNoError(); s.Driver.AssertNoError();
Assert.False(s.Driver.PageSource.Contains("Wallet not setup for the store, please provide Derviation Scheme"), Assert.False(s.Driver.PageSource.Contains("Wallet not setup for the store, please provide Derviation Scheme"),
@@ -314,11 +319,11 @@ namespace BTCPayServer.Tests
s.Driver.FindElement(By.Id("dismissLightningHint")).Click(); // dismiss lightning hint s.Driver.FindElement(By.Id("dismissLightningHint")).Click(); // dismiss lightning hint
Assert.Contains(store, s.Driver.PageSource); Assert.Contains(storeData.storeName, s.Driver.PageSource);
var storeUrl = s.Driver.Url; var storeUrl = s.Driver.Url;
s.ClickOnAllSideMenus(); s.ClickOnAllSideMenus();
s.GoToInvoices(); s.GoToInvoices();
var invoiceId = s.CreateInvoice(store); var invoiceId = s.CreateInvoice(storeData.storeName);
s.AssertHappyMessage(); s.AssertHappyMessage();
s.Driver.FindElement(By.ClassName("invoice-details-link")).Click(); s.Driver.FindElement(By.ClassName("invoice-details-link")).Click();
var invoiceUrl = s.Driver.Url; var invoiceUrl = s.Driver.Url;

View File

@@ -66,16 +66,15 @@
<td> <td>
@if (store.IsOwner) @if (store.IsOwner)
{ {
<a asp-action="UpdateStore" asp-controller="Stores" asp-route-storeId="@store.Id" id="update-store-@store.Id">@store.Name</a> <a asp-action="UpdateStore" asp-controller="Stores" asp-route-storeId="@store.Id">@store.Name</a>
} }
else else
{ {
@store.Name @store.Name
} }
@if (store.HintWalletWarning) @if (store.HintWalletWarning)
{ {
<span class="fa fa-warning text-warning" title="Wallet not setup for this store"></span> <span class="fa fa-warning text-warning" title="Wallet not setup for this store" id="warninghint_@store.Id"></span>
} }
</td> </td>
<td> <td>