Pokaż
Ignoruj:
Data:
2010-01-04 15:10:02 (16 years ago)
Autor:
alina
Opis:

re #215 dodanie klasy bazowej dla testow interfejsowych

Pliki:
1 zmodyfikowane

Legenda:

Bez zmian
Dodane
Usunięte
  • trunk/eCard/eCardMVC/adMoto.Payments.Test/UI/AuthenticationTests.cs

    r986 r991  
    11using NUnit.Framework; 
    22using WatiN.Core; 
     3using adMoto.Payments.Core.Data;    
     4using adMoto.Payments.Core; 
     5using adMoto.Payments.Core.Interfaces; 
    36 
    4 namespace adMoto.Payments.Test.UI 
     7namespace adMoto.Payments.Test.UI  
    58{ 
    69    [TestFixture] 
    7     public class AuthenticationTests 
     10    public class AuthenticationTests : BaseTests 
    811    { 
    912        private readonly UIHelper _uiHelper = new UIHelper(); 
    1013        private static string adres = UIHelper.LoginSite; 
    1114         
     15        [SetUp] 
     16        public void SetUp() 
     17        { 
     18            System.Diagnostics.Debug.WriteLine("nowy test"); 
     19            _uiHelper.SearchAndClean(); 
     20            ie.GoTo(adres);            
     21        } 
     22 
    1223        [Test] 
    1324        [Category("UI")] 
    1425        public void Can_Not_Login_When_Using_InValid_Login_Information() 
    1526        { 
    16             var ie = new IE(adres); 
    1727            ie.TextField(Find.ByName("numerFaktury")).TypeText(""); 
    1828            ie.TextField(Find.ByName("nip")).TypeText(""); 
    1929            ie.Button(Find.ById("loguj")).Click(); 
    2030            Assert.IsTrue(ie.ContainsText("Logowanie nie powiodło się")); 
    21             _uiHelper.CloseWebBrowser(ie); 
    2231        } 
    2332         
     
    2635        public void Can_Login_When_Using_Correct_Login_Information() 
    2736        { 
    28             var uiData = _uiHelper.CreateAndAddTestRecordToRepository(0); 
    29  
    30             var ie = new IE(adres); 
     37            var uiData = _uiHelper.CreateAndAddTestRecordToRepository(10); 
     38             
    3139            ie.TextField(Find.ByName("numerFaktury")).TypeText(uiData.Test_numer_faktury); 
    3240            ie.TextField(Find.ByName("nip")).TypeText(uiData.Test_nip); 
    3341            ie.Button(Find.ById("loguj")).Click(); 
    3442            Assert.IsTrue(ie.ContainsText("Szczegóły zlecenia")); 
    35             _uiHelper.CloseWebBrowser(ie); 
     43             
    3644            _uiHelper.DeleteTestRecordsFromRepository(uiData); 
    3745        }