| [930] | 1 | using NUnit.Framework;
|
|---|
| [882] | 2 | using WatiN.Core;
|
|---|
| 3 |
|
|---|
| [960] | 4 | namespace Platnosci.Tests.Web.UI
|
|---|
| [882] | 5 | {
|
|---|
| 6 | [TestFixture]
|
|---|
| [960] | 7 | public class MerchantTests
|
|---|
| [882] | 8 | {
|
|---|
| 9 | [Test]
|
|---|
| 10 | [Category("UI")]
|
|---|
| [960] | 11 | public void Redirects_To_Ecard_When_All_Details_Are_Correct()
|
|---|
| [882] | 12 | {
|
|---|
| [930] | 13 | const string test = "test";
|
|---|
| 14 | var ie = new IE("http://localhost:3646/pl/Account/LogOn");
|
|---|
| [932] | 15 | ie.TextField(Find.ByName("numerFaktury")).TypeText("27/ASZ/2009");
|
|---|
| [882] | 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);
|
|---|
| [950] | 20 | ie.TextField(Find.ByName("Payer.LastName")).TypeText(test);
|
|---|
| [882] | 21 | ie.Button(Find.ById("place")).Click();
|
|---|
| [950] | 22 | Assert.IsTrue(ie.ContainsText("Imię i nazwisko:" + test + " " + test));
|
|---|
| [960] | 23 | Assert.IsTrue(ie.Url.Contains("https://pay.ecard.pl/"));
|
|---|
| [930] | 24 | ie.ForceClose();
|
|---|
| [950] | 25 | ie.Close();
|
|---|
| 26 | ie.Dispose();
|
|---|
| [882] | 27 | }
|
|---|
| [950] | 28 |
|
|---|
| [882] | 29 | [Test]
|
|---|
| 30 | [Category("UI")]
|
|---|
| [960] | 31 | public void Returns_ZlyHash_When_Invoice_Amount_Is_Zero()
|
|---|
| [882] | 32 | {
|
|---|
| [960] | 33 | // wartosc faktury 1/SLJ/2009 jest 0 (zero)
|
|---|
| 34 | // wowczas eCard powinien zwrocic zlyHash - stala informujaca, ze cos jest nie tak...
|
|---|
| [882] | 35 |
|
|---|
| [952] | 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"));
|
|---|
| [958] | 46 | ie.ForceClose();
|
|---|
| 47 | ie.Close();
|
|---|
| 48 | ie.Dispose();
|
|---|
| [952] | 49 | }
|
|---|
| [882] | 50 | }
|
|---|
| [950] | 51 | } |
|---|