root/trunk/eCard/eCardMVC/adMoto.Payments.Test/UI/AuthenticationTests.cs @ 993

Wersja 993, 1.5 KB (wprowadzona przez marek, 16 years temu)

re #215

Line 
1using NUnit.Framework;
2using WatiN.Core;
3
4namespace adMoto.Payments.Test.UI
5{
6    [TestFixture]
7    public class AuthenticationTests : BaseTests
8    {
9        private readonly UIHelper _uiHelper = new UIHelper();
10        private static string adres = UIHelper.LoginSite;
11       
12        [SetUp]
13        public void SetUp()
14        {
15            System.Diagnostics.Debug.WriteLine("nowy test");
16            _uiHelper.SearchAndClean();
17            ie.GoTo(adres);           
18        }
19
20        [Test]
21        [Category("UI")]
22        public void Can_Not_Login_When_Using_InValid_Login_Information()
23        {
24            ie.TextField(Find.ByName("numerFaktury")).TypeText("");
25            ie.TextField(Find.ByName("nip")).TypeText("");
26            ie.Button(Find.ById("loguj")).Click();
27            Assert.IsTrue(ie.ContainsText("Logowanie nie powiodło się"));
28        }
29       
30        [Test]
31        [Category("UI")]
32        public void Can_Login_When_Using_Correct_Login_Information()
33        {
34            var uiData = _uiHelper.CreateAndAddTestRecordToRepository(10);
35           
36            ie.TextField(Find.ByName("numerFaktury")).TypeText(uiData.Test_numer_faktury);
37            ie.TextField(Find.ByName("nip")).TypeText(uiData.Test_nip);
38            ie.Button(Find.ById("loguj")).Click();
39            Assert.IsTrue(ie.ContainsText("Szczegóły zlecenia"));
40           
41            _uiHelper.DeleteTestRecordsFromRepository(uiData);
42        }
43    }
44}
Notatka: Zobacz TracBrowser aby uzyskać więcej informacji.