| [930] | 1 | using NUnit.Framework;
|
|---|
| [882] | 2 | using WatiN.Core;
|
|---|
| 3 |
|
|---|
| 4 | namespace Platnosci.Tests.Web
|
|---|
| 5 | {
|
|---|
| 6 | [TestFixture]
|
|---|
| 7 | public class UIPlatnosciTests
|
|---|
| 8 | {
|
|---|
| 9 | [Test]
|
|---|
| 10 | [Category("UI")]
|
|---|
| [950] | 11 | public void CheckCorrectPay()
|
|---|
| [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));
|
|---|
| [930] | 23 | ie.ForceClose();
|
|---|
| [950] | 24 | ie.Close();
|
|---|
| 25 | ie.Dispose();
|
|---|
| [882] | 26 | }
|
|---|
| [950] | 27 |
|
|---|
| [882] | 28 | [Test]
|
|---|
| 29 | [Category("UI")]
|
|---|
| [950] | 30 | public void CheckErrorPay()
|
|---|
| [882] | 31 | {
|
|---|
| [930] | 32 | const string test = "test";
|
|---|
| 33 | var ie = new IE("http://localhost:3646/pl/Account/LogOn");
|
|---|
| [932] | 34 | ie.TextField(Find.ByName("numerFaktury")).TypeText("27/ASZ/2009");
|
|---|
| [882] | 35 | ie.TextField(Find.ByName("nip")).TypeText("854956281");
|
|---|
| 36 | ie.Button(Find.ById("loguj")).Click();
|
|---|
| 37 |
|
|---|
| 38 | ie.TextField(Find.ByName("Payer.FirstName")).TypeText(test);
|
|---|
| [950] | 39 | ie.TextField(Find.ByName("Payer.LastName")).TypeText("");
|
|---|
| [882] | 40 | ie.Button(Find.ById("place")).Click();
|
|---|
| [950] | 41 | Assert.IsTrue(ie.ContainsText("Proszę podać"));
|
|---|
| [930] | 42 | ie.ForceClose();
|
|---|
| [950] | 43 | ie.Close();
|
|---|
| 44 | ie.Dispose();
|
|---|
| [882] | 45 | }
|
|---|
| [952] | 46 | [Test]
|
|---|
| 47 | [Category("UI")]
|
|---|
| 48 | public void AmountIsZeroReturnZlyHash()
|
|---|
| 49 | {
|
|---|
| 50 | const string test = "test";
|
|---|
| 51 | var ie = new IE("http://localhost:3646/pl/Account/LogOn");
|
|---|
| 52 | ie.TextField(Find.ByName("numerFaktury")).TypeText("1/SLJ/2009");
|
|---|
| 53 | ie.TextField(Find.ByName("nip")).TypeText("9730727417");
|
|---|
| 54 | ie.Button(Find.ById("loguj")).Click();
|
|---|
| 55 |
|
|---|
| 56 | ie.TextField(Find.ByName("Payer.FirstName")).TypeText(test);
|
|---|
| 57 | ie.TextField(Find.ByName("Payer.LastName")).TypeText(test);
|
|---|
| 58 | ie.Button(Find.ById("place")).Click();
|
|---|
| 59 | Assert.IsTrue(ie.ContainsText("Wystąpił nieoczekiwany błąd"));
|
|---|
| 60 |
|
|---|
| 61 | }
|
|---|
| [882] | 62 | }
|
|---|
| [950] | 63 | } |
|---|