Tester for System.Web.UI.WebControls.Label
Inheritance: AspControlTester
Esempio n. 1
0
        public override void EditTest()
        {
            LabelTester Nazwa = new LabelTester("ctl01_Nazwa", CurrentWebForm);
            LabelTester Opis = new LabelTester("ctl01_Opis", CurrentWebForm);
            Zalacznik z = Zalacznik.GetWellKnown();
            z.Save(null);
            IdTb.Text = z.Id.ToString();
            PostBtn.Click();
            AreEqual(z.Nazwa, Nazwa.Text, "nazwa");
            AreEqual(z.Opis, Opis.Text, "opis");

            EditBtn.Click();
            TextBoxTester NazwaEdit = new TextBoxTester("ctl01_NazwaEdit", CurrentWebForm);
            TextBoxTester OpisEdit = new TextBoxTester("ctl01_OpisEdit", CurrentWebForm);

            string unNazwa = Guid.NewGuid().ToString();
            string unOpis = Guid.NewGuid().ToString();
            NazwaEdit.Text = unNazwa;
            OpisEdit.Text = unOpis;
            SaveBtn.Click();
            Zalacznik zalacznikFromDb = (Zalacznik)z.Resync();
            AreEqual(unNazwa, zalacznikFromDb.Nazwa, "Nazwa");
            AreEqual(unOpis, zalacznikFromDb.Opis, "Opis");
            zalacznikFromDb.Delete();
        }
        public void TestCredentials()
        {
            LabelTester userId = new LabelTester("userId", CurrentWebForm);

            Browser.Credentials = CredentialCache.DefaultCredentials;
            Browser.GetPage(TEST_URL);

            AssertEquals("userId", WindowsIdentity.GetCurrent().Name, userId.Text);
        }
Esempio n. 3
0
        protected override void SetUp()
        {
            base.SetUp();
            button = new ImageButtonTester("ImageButton1", CurrentWebForm);
            disabledButton = new ImageButtonTester("Disabled", CurrentWebForm);
            clickResult = new LabelTester("clickResult", CurrentWebForm);

            Browser.GetPage(BaseUrl + "AspTester/ImageButtonTestPage.aspx");
        }
        public override void DisplayTest()
        {
            LabelTester Nazwa = new LabelTester("ctl02_Nazwa", CurrentWebForm);
            LabelTester Skrot = new LabelTester("ctl02_Skrot", CurrentWebForm);
            LabelTester Poczta = new LabelTester("ctl02_ctl00_Poczta", CurrentWebForm);
            LabelTester Wojewodztwo = new LabelTester("ctl02_ctl00_Wojewodztwo", CurrentWebForm);
            LabelTester Gmina = new LabelTester("ctl02_ctl00_Gmina", CurrentWebForm);
            LabelTester Ulica = new LabelTester("ctl02_ctl00_Ulica", CurrentWebForm);
            LabelTester Kraj = new LabelTester("ctl02_ctl00_Kraj", CurrentWebForm);
            LabelTester Kod = new LabelTester("ctl02_ctl00_Kod", CurrentWebForm);
            LabelTester Powiat = new LabelTester("ctl02_ctl00_Powiat", CurrentWebForm);
            LabelTester Gus = new LabelTester("ctl02_ctl00_Gus", CurrentWebForm);
            LabelTester Miejscowosc = new LabelTester("ctl02_ctl00_Miejscowosc", CurrentWebForm);
            LabelTester Tel = new LabelTester("ctl02_ctl01_Tel", CurrentWebForm);
            LabelTester Tel2 = new LabelTester("ctl02_ctl01_Tel2", CurrentWebForm);
            LabelTester Fax = new LabelTester("ctl02_ctl01_Fax", CurrentWebForm);
            LabelTester Www = new LabelTester("ctl02_ctl01_Www", CurrentWebForm);
            LabelTester Email = new LabelTester("ctl02_ctl01_Email", CurrentWebForm);

            Lokalizacja l = Lokalizacja.GetWellKnown();
            string unNazwa = Guid.NewGuid().ToString();
            l.Nazwa = unNazwa;
            l.Save(null);
            int idAdres = (int)l.IdAdres;
            int idKontakt = (int)l.IdKontakt;

            IdTb.Text = l.Id.ToString();
            PostBtn.Click();
            Assert.AreEqual(l.Id, int.Parse(sessionLbl.Text), "Z³y id lokalizacji");

            Assert.AreEqual(l.Nazwa, Nazwa.Text, "z³a nazwa lokalizacji");
            Assert.AreEqual(l.Skrot, Skrot.Text, "z³y skrót lokalizacji");
            Assert.AreEqual(l.Adres.Poczta, Poczta.Text, "poczta");
            Assert.AreEqual(l.Adres.Wojewodztwo, Wojewodztwo.Text, "województwo");
            Assert.AreEqual(l.Adres.Gmina, Gmina.Text, "gmina");
            Assert.AreEqual(l.Adres.Ulica, Ulica.Text, "ulica");
            Assert.AreEqual(l.Adres.Kraj, Kraj.Text, "kraj");
            Assert.AreEqual(l.Adres.Kod, Kod.Text, "kod");
            Assert.AreEqual(l.Adres.Powiat, Powiat.Text, "powiat");
            Assert.AreEqual(l.Adres.Gus, Gus.Text, "gus");
            Assert.AreEqual(l.Adres.Miejscowosc, Miejscowosc.Text, "miejscowosc");
            Assert.AreEqual(l.Kontakt.Tel, Tel.Text, "tel");
            Assert.AreEqual(l.Kontakt.Tel2, Tel2.Text, "tel2");
            Assert.AreEqual(l.Kontakt.Fax, Fax.Text, "fax");
            Assert.AreEqual(l.Kontakt.Www, Www.Text, "www");
            Assert.AreEqual(l.Kontakt.Email, Email.Text, "email");

            l.Delete();
            Adres a = Dm.Retrieve<Adres>(idAdres);
            a.Delete();
            Kontakt k = Dm.Retrieve<Kontakt>(idKontakt);
            k.Delete();
        }
Esempio n. 5
0
        public static void KontaktDisplayTest(Kontakt k, string prefix, WebForm currentWebForm)
        {
            LabelTester Fax = new LabelTester(GetCtrlId(prefix,"Fax"), currentWebForm);
            LabelTester Tel = new LabelTester(GetCtrlId(prefix, "Tel"), currentWebForm);
            LabelTester Tel2 = new LabelTester(GetCtrlId(prefix, "Tel2"), currentWebForm);
            LabelTester Email = new LabelTester(GetCtrlId(prefix, "Email"), currentWebForm);
            LabelTester Www = new LabelTester(GetCtrlId(prefix, "Www"), currentWebForm);

            Assert.AreEqual(k.Fax, Fax.Text, "z造 fax");
            Assert.AreEqual(k.Tel, Tel.Text, "z造 telefon");
            Assert.AreEqual(k.Tel2, Tel2.Text, "z造 telefon 2");
            Assert.AreEqual(k.Email, Email.Text, "z造 e-mail");
            Assert.AreEqual(k.Www, Www.Text, "z造 adres www");
        }
Esempio n. 6
0
        protected override void SetUp()
        {
            base.SetUp();

            UserControlTester userControl = new UserControlTester("userControl", CurrentWebForm);

            label = new LabelTester("label", userControl);
            button = new ButtonTester("button", userControl);
            linkButton = new LinkButtonTester("linkButton", userControl);

            clickResult = new LabelTester("clickResult", CurrentWebForm);

            Browser.GetPage(BaseUrl + "AspTester/UserControlTestPage.aspx");
        }
Esempio n. 7
0
        public void TestSubmit_WhenMultipleForms()
        {
            LabelTester submitted = new LabelTester("submitted", form1);
            Assert.AreEqual("none", submitted.Text);

            LinkButtonTester one = new LinkButtonTester("one", form1);
            one.Click();
            Assert.AreEqual("form 1", submitted.Text);

            form2.Submit();
            Assert.AreEqual("form 2", submitted.Text);

            new WebFormTester("RedirectForm", Browser).Submit();
            AssertRedirected();
        }
Esempio n. 8
0
		public void TestGoToPage2WithButtonLogin() 
		{ 
			// First, instantiate "Tester" objects: 
			ButtonTester buttonLogin = new ButtonTester("ButtonLogin", CurrentWebForm); 
			LabelTester labelTester = new LabelTester("LabelPreviousView", CurrentWebForm);

			// Second, visit the page being tested: 
			Browser.GetPage("http://localhost/Castle.MVC.Test.Web/Views/index.aspx"); 
			string loginPage = this.Browser.CurrentUrl.AbsoluteUri.ToString();

			buttonLogin.Click(); 
			string currentPage = this.Browser.CurrentUrl.AbsoluteUri.ToString();
			Assert(currentPage, loginPage != currentPage);
			AssertEquals("index", labelTester.Text); 
		} 
Esempio n. 9
0
        public void TestButtonClickInRepeater()
        {
            ButtonTester button1 = new ButtonTester("Button1", CurrentWebForm);
            LabelTester label1 = new LabelTester("Label1", CurrentWebForm);

            button1.Click();

            ButtonTester innerButton1 = new ButtonTester("btnInner", repeater3.Item(0));
            ButtonTester innerButton2 = new ButtonTester("btnInner", repeater3.Item(1));

            innerButton1.Click();
            Assert.AreEqual("Thing 1", label1.Text);

            innerButton2.Click();
            Assert.AreEqual("Thing 2", label1.Text);
        }
Esempio n. 10
0
        public override void DisplayTest()
        {
            LabelTester Nazwa = new LabelTester("ctl01_Nazwa", CurrentWebForm);
            LabelTester Opis = new LabelTester("ctl01_Opis", CurrentWebForm);
            Zalacznik z = Zalacznik.GetWellKnown();
            string unNazwa = Guid.NewGuid().ToString();
            string unOpis = Guid.NewGuid().ToString();
            z.Nazwa = unNazwa;
            z.Opis = unOpis;
            z.Save(null);

            IdTb.Text = z.Id.ToString();
            PostBtn.Click();
            AreEqual(z.Id, int.Parse(sessionLbl.Text), "Z³y id");
            AreEqual(z.Nazwa, Nazwa.Text, "z³a nazwa");
            AreEqual(z.Opis, Opis.Text, "z³y opis");
            z.Delete();
        }
        public void Test01RestrictedUsersListPage()
        {
            try
            {
                DnaTestURLRequest dnaRequest = new DnaTestURLRequest("h2g2");
                Console.WriteLine("Before Test01RestrictedUsersListPage");
                dnaRequest.SetCurrentUserEditor();
                dnaRequest.UseEditorAuthentication = true;
                string relativePath = @"/dna/h2g2/RestrictedUsers";
                dnaRequest.RequestNUnitASPPage(relativePath, Browser);

                System.Threading.Thread.Sleep(2000);

                DropDownListTester siteList = new DropDownListTester("SiteList");
                Assert.AreEqual(siteList.Visible, true);
                siteList.Items.FindByText("All").Selected = true;

                DropDownListTester userStatusTypes = new DropDownListTester("UserStatusTypes");
                Assert.AreEqual(userStatusTypes.Visible, true);
                userStatusTypes.Items.FindByText("Premoderated").Selected = true;

                LabelTester error = new LabelTester("lblError");
                string errorText = error.Text;
                bool noError = true;
                if (errorText == "Insufficient permissions - Editor Status Required")
                {
                    noError = false;
                }

                Assert.IsTrue(noError, "Error in Restricted User Page.");

                Console.WriteLine("After Test01RestrictedUsersListPage");
            }
            catch (Exception ex)
            {
                Console.WriteLine("EXCEPTION");
                Console.WriteLine(ex.Message);
            }

        }
Esempio n. 12
0
        public static void AdresDisplayTest(Adres a, string prefix, WebForm currentWebForm)
        {
            LabelTester PowiatLbl = new LabelTester(GetCtrlId(prefix,"Powiat"), currentWebForm);
            LabelTester KodLbl = new LabelTester(GetCtrlId(prefix,"Kod"), currentWebForm);
            LabelTester GusLbl = new LabelTester(GetCtrlId(prefix,"Gus"), currentWebForm);
            LabelTester KrajLbl = new LabelTester(GetCtrlId(prefix,"Kraj"), currentWebForm);
            LabelTester UlicaLbl = new LabelTester(GetCtrlId(prefix,"Ulica"), currentWebForm);
            LabelTester GminaLbl = new LabelTester(GetCtrlId(prefix,"Gmina"), currentWebForm);
            LabelTester WojewodztwoLbl = new LabelTester(GetCtrlId(prefix,"Wojewodztwo"), currentWebForm);
            LabelTester PocztaLbl = new LabelTester(GetCtrlId(prefix,"Poczta"), currentWebForm);
            LabelTester MiejscowoscLbl = new LabelTester(GetCtrlId(prefix,"Miejscowosc"), currentWebForm);

            AreEqual(a.Powiat, PowiatLbl.Text, "Z³y Powiat");
            AreEqual(a.Kod, KodLbl.Text, "Z³y Kod");
            AreEqual(a.Gus, GusLbl.Text, "Z³y Gus");
            AreEqual(a.Kraj, KrajLbl.Text, "Z³y Kraj");
            AreEqual(a.Ulica, UlicaLbl.Text, "Z³y Ulica");
            AreEqual(a.Gmina, GminaLbl.Text, "Z³y Gmina");
            AreEqual(a.Wojewodztwo, WojewodztwoLbl.Text, "Z³y Wojewodztwo");
            AreEqual(a.Poczta, PocztaLbl.Text, "Z³y Poczta");
            AreEqual(a.Miejscowosc, MiejscowoscLbl.Text, "Z³y Miejscowosc");
        }
Esempio n. 13
0
        public static void SetData(Stypendysta s, string prefix, WebForm currentWebForm)
        {
            TextBoxTester imie = new TextBoxTester(GetCtrlId(prefix, "ImieEdit"), currentWebForm);
            TextBoxTester imie2 = new TextBoxTester(GetCtrlId(prefix, "Imie2Edit"), currentWebForm);
            TextBoxTester nazwisko = new TextBoxTester(GetCtrlId(prefix, "NazwiskoEdit"), currentWebForm);
            TextBoxTester pesel = new TextBoxTester(GetCtrlId(prefix, "PeselEdit"), currentWebForm);
            TextBoxTester nip = new TextBoxTester(GetCtrlId(prefix, "NipEdit"), currentWebForm);
            DropDownListTester szkola = new DropDownListTester(GetCtrlId(prefix, "SzkolaEdit"), currentWebForm);
            LabelTester uzytkownikWprowadzajacy = new LabelTester(GetCtrlId(prefix, "UzytkownikWprowadzajacyEdit"), currentWebForm);
            LabelTester dataWprowadzenia = new LabelTester(GetCtrlId(prefix, "DataWprowadzeniaEdit"), currentWebForm);

            imie.Text = s.Imie;
            imie2.Text = s.Imie2;
            nazwisko.Text = s.Nazwisko;
            pesel.Text = s.Pesel;
            nip.Text = s.Nip;
            szkola.SelectedValue = s.Szkola.Id.ToString();
            //uzytkownikWprowadzajacy.Text = s.UzytkownikWprowadzajacy;
            //dataWprowadzenia.Text = s.DataWprowadzenia.ToString();

            AdresComponentTest.SetData(s.AdresZameldowania, prefix + "_ctl01", currentWebForm);
            KontaktComponentTest.SetData(s.Kontakt, prefix + "_ctl00", currentWebForm);
        }
Esempio n. 14
0
        public static void StypendystaDisplayTest(Stypendysta s, string prefix, WebForm currentWebForm)
        {
            LabelTester imie = new LabelTester(GetCtrlId(prefix,"Imie"), currentWebForm);
            LabelTester imie2 = new LabelTester(GetCtrlId(prefix,"Imie2"), currentWebForm);
            LabelTester nazwisko = new LabelTester(GetCtrlId(prefix,"Nazwisko"), currentWebForm);
            LabelTester pesel = new LabelTester(GetCtrlId(prefix,"Pesel"), currentWebForm);
            LabelTester nip = new LabelTester(GetCtrlId(prefix,"Nip"), currentWebForm);
            LabelTester szkola = new LabelTester(GetCtrlId(prefix,"Szkola"), currentWebForm);
            LabelTester uzytkownikWprowadzajacy = new LabelTester(GetCtrlId(prefix,"UzytkownikWprowadzajacy"), currentWebForm);
            LabelTester dataWprowadzenia = new LabelTester(GetCtrlId(prefix,"DataWprowadzenia"), currentWebForm);

            Assert.AreEqual(s.Imie, imie.Text, "B³êdne imiê.");
            Assert.AreEqual(s.Imie2, imie2.Text, "B³êdne imiê2.");
            Assert.AreEqual(s.Nazwisko, nazwisko.Text, "B³êdne nazwisko.");
            Assert.AreEqual(s.Pesel, pesel.Text, "B³êdny pesel.");
            Assert.AreEqual(s.Nip, nip.Text, "B³êdny NIP.");
            Assert.AreEqual(s.Szkola.ToString(), szkola.Text, "B³êdna szko³a.");
            Assert.AreEqual(s.UzytkownikWprowadzajacy, uzytkownikWprowadzajacy.Text, "B³êdny u¿ytkownik wprowadzaj¹cy.");
            //            Assert.IsTrue(s.DataWprowadzenia == DateTime.Parse(dataWprowadzenia.Text), "B³êdna data wprowadzenia.");

            AdresComponentTest.AdresDisplayTest(s.AdresZameldowania, prefix+"_ctl01", currentWebForm);
            KontaktComponentTest.KontaktDisplayTest(s.Kontakt, prefix+"_ctl00", currentWebForm);
        }
Esempio n. 15
0
        public void Test01MemberListPage()
        {
            Console.WriteLine("Before Test01MemberListPage");
            _dnarequest.SetCurrentUserEditor();
            _dnarequest.UseEditorAuthentication = true;
            string relativePath = @"/dna/haveyoursay/MemberList";
            _dnarequest.RequestNUnitASPPage(relativePath, Browser);

            TextBoxTester entry = new TextBoxTester("txtEntry", CurrentWebForm);
            Assert.AreEqual(entry.Visible, true);
            entry.Text = "1090558354";

            RadioButtonListTester radiolist = new RadioButtonListTester("rdSearchType");
            Assert.AreEqual(radiolist.Visible, true);
            radiolist.SelectedIndex = 0;

            ButtonTester search = new ButtonTester("Search", CurrentWebForm);

            LabelTester err = new LabelTester("lblError",CurrentWebForm);
            Assert.AreNotEqual("Insufficient permissions - Editor Status Required", err.Text);

            Console.WriteLine("After Test01MemberListPage");
        }
Esempio n. 16
0
        public void TestUserLanguages()
        {
            LabelTester userLanguages = new LabelTester("userLanguages", CurrentWebForm);

              Browser.GetPage(TestUrl);
              AssertEquals("default user language", "Not Set", userLanguages.Text);

              Browser.UserLanguages = new string[] {"en-gb"};
              Browser.GetPage(TestUrl);
              AssertEquals("modified single user language", "[en-gb]", userLanguages.Text);

              Browser.UserLanguages = new string[] {"en-us", "en-gb"};
              Browser.GetPage(TestUrl);
              AssertEquals("modified multiple user languages", "[en-us][en-gb]", userLanguages.Text);
        }
Esempio n. 17
0
        protected override void SetUp()
        {
            button = new ButtonTester("LokalizacjaGrid_SearchBtn", CurrentWebForm);
            filterValue = new TextBoxTester("LokalizacjaGrid_ValueTxt", CurrentWebForm);
            next = new MyLinkTester("Next", CurrentWebForm);
            prev = new MyLinkTester("Prev", CurrentWebForm);
            last = new MyLinkTester("Last", CurrentWebForm);
            first = new MyLinkTester("First", CurrentWebForm);
            //            itemsCount = new LabelTester("ItemsCount", CurrentWebForm);
            currentPage = new LabelTester("CurrentPage", CurrentWebForm);
            filterField = new DropDownListTester("LokalizacjaGrid_FilterList", CurrentWebForm);

            Dm.DeleteSql<Lokalizacja>("Nazwa like 'SSS%'");
            Lokalizacja l1;
            for (int i = 0; i < 80; i++)
            {
                l1 = Lokalizacja.GetWellKnown();
                l1.Nazwa = "SSS" + i.ToString().PadLeft(3, '0');
                l1.Skrot = "LP" + i.ToString().PadLeft(3, '0');

                l1.Save(null);
            }

            base.SetUp();
        }
        public void Test02RestrictedUsersListPageWithNormalUserErrorTest()
        {
            try
            {
                DnaTestURLRequest dnaRequest = new DnaTestURLRequest("h2g2");
                Console.WriteLine("Before Test02RestrictedUsersListPageWithNormalUserErrorTest");
                dnaRequest.SetCurrentUserNormal();
                dnaRequest.UseEditorAuthentication = true;
                string relativePath = @"/dna/h2g2/RestrictedUsers";
                dnaRequest.RequestNUnitASPPage(relativePath, Browser);

                System.Threading.Thread.Sleep(2000);

                LabelTester error = new LabelTester("lblError");
                string errorText = error.Text;
                bool isError = false;
                if (errorText == "Insufficient permissions - Editor Status Required")
                {
                    isError = true;
                }

                Assert.IsTrue(isError, "No Error for Normal user in Restricted User Page.");

                Console.WriteLine("After Test02RestrictedUsersListPageWithNormalUserErrorTest");
            }
            catch (Exception ex)
            {
                Console.WriteLine("EXCEPTION");
                Console.WriteLine(ex.Message);
            }
        }
Esempio n. 19
0
 protected override void SetUp()
 {
     base.SetUp();
       redirect = new LinkButtonTester("redirect", CurrentWebForm);
       dropCookie = new LinkButtonTester("dropCookie", CurrentWebForm);
       dropCookieAndRedirect = new LinkButtonTester("dropCookieAndRedirect", CurrentWebForm);
       dropCookieWithExpiry = new LinkButtonTester("dropCookieWithExpiry", CurrentWebForm);
       postBack = new LinkButtonTester("postBack", CurrentWebForm);
       followLink = new HtmlAnchorTester("followLink", CurrentWebForm);
       cookie = new LabelTester("cookie", CurrentWebForm);
       testParm = new LabelTester("testParm", CurrentWebForm);
       urlReferrer = new LabelTester("urlReferrer", CurrentWebForm);
 }
Esempio n. 20
0
 public void TestSpace()
 {
     LabelTester spaceLabel = new LabelTester("spaceLabel");
     AssertEquals("space", "foo ", spaceLabel.Text);
 }
Esempio n. 21
0
 public void TestOneParameterConstructor()
 {
     LabelTester textLabel = new LabelTester("textLabel");
     AssertEquals("text", "foo", textLabel.Text);
 }
Esempio n. 22
0
 public void TestNested()
 {
     LabelTester outerLabel = new LabelTester("outerLabel");
     LabelTester innerLabel = new LabelTester("innerLabel", outerLabel);
     AssertEquals("inner", "inner", innerLabel.Text);
 }
Esempio n. 23
0
 public void TestFormatted()
 {
     LabelTester formattedLabel = new LabelTester("formattedLabel");
     AssertEquals("formatted", "a <i>HTML</i> tag", formattedLabel.Text);
 }
Esempio n. 24
0
        public void TestUserAgent()
        {
            LabelTester userAgent = new LabelTester("userAgent", CurrentWebForm);

              Browser.GetPage(TestUrl);
              AssertEquals("default user agent", HttpClient.IE_USER_AGENT, userAgent.Text);
              Browser.UserAgent = "Foo Explorer/4.2";
              Browser.GetPage(TestUrl);
              AssertEquals("modified user agent", "Foo Explorer/4.2", userAgent.Text);
        }
Esempio n. 25
0
        public void Test06MemberListNonEditorPage()
        {
            Console.WriteLine("Before Test06MemberListNonEditorPage");
            _dnarequest.SetCurrentUserNormal();
            _dnarequest.UseEditorAuthentication = true;
            string relativePath = @"/dna/haveyoursay/MemberList";
            _dnarequest.RequestNUnitASPPage(relativePath, Browser);

            LabelTester error = new LabelTester("lblError");
            string errorText = error.Text;
            bool isError = false;
            if (errorText == "Insufficient permissions - Editor Status Required")
            {
                isError = true;
            }

            Assert.IsTrue(isError, "Error in Member List Page.");

            Console.WriteLine("After Test06MemberListNonEditorPage");
        }
Esempio n. 26
0
        /// <summary>
        /// Executed before each test method is run.  Override in subclasses to do subclass
        /// set up.  NOTE: [SetUp] attribute cannot be used in subclasses because it is already
        /// in use.
        /// </summary>
        protected override void SetUp()
        {
            PostBtn = new ButtonTester("PostBtn", CurrentWebForm);
            SaveBtn = new ButtonTester("SaveBtn", CurrentWebForm);
             NewBtn = new ButtonTester("NewBtn", CurrentWebForm);
             EditBtn = new ButtonTester("EditBtn", CurrentWebForm);
             DelBtn = new ButtonTester("DelBtn", CurrentWebForm);
            IdTb = new TextBoxTester("IdTb", CurrentWebForm);

            sessionLbl = new LabelTester("SessionLbl", CurrentWebForm);

            Powiat = new TextBoxTester("ctl02_PowiatEdit", CurrentWebForm);
            Kod = new TextBoxTester("ctl02_KodEdit", CurrentWebForm);
            Gus = new TextBoxTester("ctl02_GusEdit", CurrentWebForm);
            Kraj = new TextBoxTester("ctl02_KrajEdit", CurrentWebForm);
            Ulica = new TextBoxTester("ctl02_UlicaEdit", CurrentWebForm);
            Gmina = new TextBoxTester("ctl02_GminaEdit", CurrentWebForm);
            Wojewodztwo = new TextBoxTester("ctl02_WojewodztwoEdit", CurrentWebForm);
            Poczta = new TextBoxTester("ctl02_PocztaEdit", CurrentWebForm);
            Miejscowosc = new TextBoxTester("ctl02_MiejscowoscEdit", CurrentWebForm);

            PowiatLbl = new LabelTester("ctl02_Powiat", CurrentWebForm);
            KodLbl = new LabelTester("ctl02_Kod", CurrentWebForm);
            GusLbl = new LabelTester("ctl02_Gus", CurrentWebForm);
            KrajLbl = new LabelTester("ctl02_Kraj", CurrentWebForm);
            UlicaLbl = new LabelTester("ctl02_Ulica", CurrentWebForm);
            GminaLbl = new LabelTester("ctl02_Gmina", CurrentWebForm);
            WojewodztwoLbl = new LabelTester("ctl02_Wojewodztwo", CurrentWebForm);
            PocztaLbl = new LabelTester("ctl02_Poczta", CurrentWebForm);
            MiejscowoscLbl = new LabelTester("ctl02_Miejscowosc", CurrentWebForm);
            base.SetUp();
        }
Esempio n. 27
0
        protected override void SetUp()
        {
            PostBtn = new ButtonTester("PostBtn", CurrentWebForm);
            NewBtn = new ButtonTester("NewBtn", CurrentWebForm);
            EditBtn = new ButtonTester("EditBtn", CurrentWebForm);
            DelBtn = new ButtonTester("DelBtn", CurrentWebForm);
            SaveBtn = new ButtonTester("SaveBtn", CurrentWebForm);
            CancelBtn = new ButtonTester("CancelBtn", CurrentWebForm);
            IdTb = new TextBoxTester("IdTb", CurrentWebForm);
            sessionLbl = new LabelTester("SessionLbl", CurrentWebForm);

            base.SetUp();
        }
Esempio n. 28
0
 protected override void SetUp()
 {
     base.SetUp();
     list = CreateListControl("list", CurrentWebForm);
     emptyList = CreateListControl("emptyList", CurrentWebForm);
     disabledList = CreateListControl("disabledList", CurrentWebForm);
     submit = new LinkButtonTester("submit", CurrentWebForm);
     clearSelection = new LinkButtonTester("clearSelection", CurrentWebForm);
     autoPostBack = new CheckBoxTester("auto", CurrentWebForm);
     indexChanged = new LabelTester("indexChanged", CurrentWebForm);
 }
Esempio n. 29
0
 public void TestText()
 {
     LabelTester textLabel = new LabelTester("textLabel");
     AssertEquals("text", "foo", textLabel.Text);
 }
        public void Test06RestrictedUsersListNonEditorPage()
        {
            try
            {
                DnaTestURLRequest dnaRequest = new DnaTestURLRequest("haveyoursay");
                Console.WriteLine("Before Test06RestrictedUsersListNonEditorPage");
                dnaRequest.SetCurrentUserNormal();
                dnaRequest.UseEditorAuthentication = true;
                string relativePath = @"/dna/haveyoursay/RestrictedUsers";
                dnaRequest.RequestNUnitASPPage(relativePath, Browser);

                LabelTester error = new LabelTester("lblError");
                string errorText = error.Text;
                bool isError = false;
                if (errorText == "Insufficient permissions - Editor Status Required")
                {
                    isError = true;
                }

                Assert.IsTrue(isError, "Error in permissions for Restricted User Page.");

                Console.WriteLine("After Test06RestrictedUsersListNonEditorPage");
            }
            catch (Exception ex)
            {
                Console.WriteLine("EXCEPTION");
                Console.WriteLine(ex.Message);
            }
        }