| 1 | using NUnit.Framework;
|
|---|
| 2 | using WatiN.Core;
|
|---|
| 3 |
|
|---|
| 4 | namespace adMoto.Payments.Test.Web.UI
|
|---|
| 5 | {
|
|---|
| 6 | [TestFixture]
|
|---|
| 7 | public class MerchantTests
|
|---|
| 8 | {
|
|---|
| 9 | [Test]
|
|---|
| 10 | [Category("UI")]
|
|---|
| 11 | public void Redirects_To_Ecard_When_All_Details_Are_Correct()
|
|---|
| 12 | {
|
|---|
| 13 | const string test = "test";
|
|---|
| 14 | var ie = new IE("http://localhost:3646/pl/Account/LogOn");
|
|---|
| 15 | ie.TextField(Find.ByName("numerFaktury")).TypeText("27/ASZ/2009");
|
|---|
| 16 | ie.TextField(Find.ByName("nip")).TypeText("854956281");
|
|---|
| 17 | ie.Button(Find.ById("loguj")).Click();
|
|---|
| 18 |
|
|---|
| 19 | ie.TextField(Find.ByName("Payer.FirstName")).TypeText(test);
|
|---|
| 20 | ie.TextField(Find.ByName("Payer.LastName")).TypeText(test);
|
|---|
| 21 | ie.Button(Find.ById("place")).Click();
|
|---|
| 22 | Assert.IsTrue(ie.ContainsText("Imię i nazwisko:" + test + " " + test));
|
|---|
| 23 | Assert.IsTrue(ie.Url.Contains("https://pay.ecard.pl/"));
|
|---|
| 24 | ie.ForceClose();
|
|---|
| 25 | ie.Close();
|
|---|
| 26 | ie.Dispose();
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | [Test]
|
|---|
| 30 | [Category("UI")]
|
|---|
| 31 | public void Returns_ZlyHash_When_Invoice_Amount_Is_Zero()
|
|---|
| 32 | {
|
|---|
| 33 | // wartosc faktury 1/SLJ/2009 jest 0 (zero)
|
|---|
| 34 | // wowczas eCard powinien zwrocic zlyHash - stala informujaca, ze cos jest nie tak...
|
|---|
| 35 |
|
|---|
| 36 | const string test = "test";
|
|---|
| 37 | var ie = new IE("http://localhost:3646/pl/Account/LogOn");
|
|---|
| 38 | ie.TextField(Find.ByName("numerFaktury")).TypeText("1/SLJ/2009");
|
|---|
| 39 | ie.TextField(Find.ByName("nip")).TypeText("9730727417");
|
|---|
| 40 | ie.Button(Find.ById("loguj")).Click();
|
|---|
| 41 |
|
|---|
| 42 | ie.TextField(Find.ByName("Payer.FirstName")).TypeText(test);
|
|---|
| 43 | ie.TextField(Find.ByName("Payer.LastName")).TypeText(test);
|
|---|
| 44 | ie.Button(Find.ById("place")).Click();
|
|---|
| 45 | Assert.IsTrue(ie.ContainsText("Wystąpił nieoczekiwany błąd"));
|
|---|
| 46 | ie.ForceClose();
|
|---|
| 47 | ie.Close();
|
|---|
| 48 | ie.Dispose();
|
|---|
| 49 | }
|
|---|
| 50 | }
|
|---|
| 51 | } |
|---|