| Line | |
|---|
| 1 | using NUnit.Framework;
|
|---|
| 2 | using WatiN.Core;
|
|---|
| 3 |
|
|---|
| 4 | namespace Platnosci.Tests.Web
|
|---|
| 5 | {
|
|---|
| 6 | [TestFixture]
|
|---|
| 7 | public class UIFieldTest
|
|---|
| 8 | {
|
|---|
| 9 | [Test]
|
|---|
| 10 | [Category("UI")]
|
|---|
| 11 | public void FirstnameIsTooLong()
|
|---|
| 12 | {
|
|---|
| 13 | const string test = "test";
|
|---|
| 14 | var ie = new IE("http://localhost:3646/pl/Account/LogOn");
|
|---|
| 15 | ie.TextField(Find.ByName("numerFaktury")).TypeText("1/SLJ/2009");
|
|---|
| 16 | ie.TextField(Find.ByName("nip")).TypeText("9730727417");
|
|---|
| 17 | ie.Button(Find.ById("loguj")).Click();
|
|---|
| 18 |
|
|---|
| 19 | ie.TextField(Find.ByName("Payer.FirstName")).TypeText("12345678901234567890123456");
|
|---|
| 20 | ie.TextField(Find.ByName("Payer.LastName")).TypeText(test);
|
|---|
| 21 | ie.Button(Find.ById("place")).Click();
|
|---|
| 22 | Assert.IsTrue(ie.ContainsText("Zbyt długa nazwa"));
|
|---|
| 23 | ie.ForceClose();
|
|---|
| 24 | ie.Close();
|
|---|
| 25 | ie.Dispose();
|
|---|
| 26 | }
|
|---|
| 27 | [Test]
|
|---|
| 28 | [Category("UI")]
|
|---|
| 29 | public void SurnameIsTooLong()
|
|---|
| 30 | {
|
|---|
| 31 | const string test = "test";
|
|---|
| 32 | var ie = new IE("http://localhost:3646/pl/Account/LogOn");
|
|---|
| 33 | ie.TextField(Find.ByName("numerFaktury")).TypeText("1/SLJ/2009");
|
|---|
| 34 | ie.TextField(Find.ByName("nip")).TypeText("9730727417");
|
|---|
| 35 | ie.Button(Find.ById("loguj")).Click();
|
|---|
| 36 |
|
|---|
| 37 | ie.TextField(Find.ByName("Payer.FirstName")).TypeText(test);
|
|---|
| 38 | ie.TextField(Find.ByName("Payer.LastName")).TypeText("1234567890123456789012345678901");
|
|---|
| 39 | ie.Button(Find.ById("place")).Click();
|
|---|
| 40 | Assert.IsTrue(ie.ContainsText("Zbyt długa nazwa"));
|
|---|
| 41 | ie.ForceClose();
|
|---|
| 42 | ie.Close();
|
|---|
| 43 | ie.Dispose();
|
|---|
| 44 | }
|
|---|
| 45 | }
|
|---|
| 46 | }
|
|---|
Notatka: Zobacz
TracBrowser
aby uzyskać więcej informacji.