Пример #1
0
        public void IsNotSmartNavigation()
        {
            Page pg = new Page();

            pg.SmartNavigation = false;
            WebAssert.IsNotSmartNavigation(pg);
        }
Пример #2
0
 /**
  * Creates a new instance.
  * @param name the plugin name
  * @param description the plugin description
  * @param filename the plugin filename
  */
 public PluginConfiguration(String name, String description, String filename)
 {
     WebAssert.notNull("name", name);
     name_        = name;
     description_ = description;
     filename_    = filename;
 }
Пример #3
0
        public void AreTemplateSourceDirectoryEqual()
        {
            TextBox  txtBoxControl = new TextBox();
            CheckBox chkBoxControl = new CheckBox();

            WebAssert.AreTemplateSourceDirectoryEqual(txtBoxControl, chkBoxControl);
        }
Пример #4
0
        public void IsNotEnableViewState()
        {
            TextBox txtBoxControl = new TextBox();

            txtBoxControl.EnableViewState = false;
            WebAssert.IsNotEnableViewState(txtBoxControl);
        }
Пример #5
0
 /// <summary>
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 /// <param name="type">the mime type</param>
 /// <param name="description">the type description</param>
 /// <param name="suffixes">the file suffixes</param>
 public MimeType(String type, String description, String suffixes)
 {
     WebAssert.notNull("type", type);
     type_        = type;
     description_ = description;
     suffixes_    = suffixes;
 }
Пример #6
0
        public void TestXPath()
        {
            string        test = "<html><myTag foo='bar' /></html>";
            HtmlTagTester tag  = HtmlTagTester.TestInstance(test, "//*[@foo='bar']");

            WebAssert.Visible(tag);
        }
Пример #7
0
        public void IsNotVisible()
        {
            TextBox txtBoxControl = new TextBox();

            txtBoxControl.Visible = false;
            WebAssert.IsNotVisible(txtBoxControl);
        }
Пример #8
0
        public void IsSmartNavigation()
        {
            Page pg = new Page();

            pg.SmartNavigation = true;
            WebAssert.IsSmartNavigation(pg);
        }
Пример #9
0
        public void TestNoMessages()
        {
            textBox1.Text = "hi";
            textBox2.Text = "bye";
            textBox3.Text = "fly";
            button.Click();

            WebAssert.NotVisible(bulletedSummary);
            WebAssert.NotVisible(listSummary);

            try
            {
                string[] ignored = bulletedSummary.Messages;
                Fail("expected exception");
            }
            catch (WebAssertionException)
            {
            }
            try
            {
                string[] ignored = listSummary.Messages;
                Fail("expected exception");
            }
            catch (WebAssertionException)
            {
            }
        }
Пример #10
0
        public void IsNotChild()
        {
            PlaceHolder place         = new PlaceHolder();
            TextBox     txtBoxControl = new TextBox();

            WebAssert.IsNotChild(place, txtBoxControl);
        }
Пример #11
0
        public void IsIDEqual()
        {
            TextBox txtBoxControl = new TextBox();

            txtBoxControl.ID = "TxtBoxControl";
            WebAssert.IsIDEqual(txtBoxControl, "TxtBoxControl");
        }
Пример #12
0
        public void IsVisible()
        {
            TextBox txtBoxControl = new TextBox();

            txtBoxControl.Visible = true;
            WebAssert.IsVisible(txtBoxControl);
        }
Пример #13
0
        public void IsNotValid()
        {
            Page pg = new Page();

            pg.Validate();
            WebAssert.IsNotValid(pg);
        }
Пример #14
0
        public void AreErrorPageEqual()
        {
            Page pg = new Page();

            pg.ErrorPage = "404.html";

            WebAssert.AreErrorPageEqual("404.html", pg);
        }
Пример #15
0
 public static void Init()
 {
     DriverFactory = new WebDriverFactory();
     Asserter      = new WebAssert();
     Timeouts      = new WebTimeoutSettings();
     Logger        = new NUnitLogger();
     MapInterfaceToElement.Init(DefaultInterfacesMap);
 }
Пример #16
0
 public void MalformedTables()
 {
     string[][] expected = new string[][]
     {
         new string[] {}
     };
     WebAssert.AreEqual(expected, malformedTable.Cells, "malformed table");
 }
Пример #17
0
 public void TestTableContainsRow()
 {
     string[][] testData = new string[][]
     {
         new string[] { "a", "b" },
     };
     WebAssert.TableContainsRow(testData, "a", "b");
 }
Пример #18
0
        public void AreClientTargetEqual()
        {
            Page pg = new Page();

            pg.ClientTarget = "BrowserDetect.html";

            WebAssert.AreClientTargetEqual("BrowserDetect.html", pg);
        }
Пример #19
0
 public void TestSorted_WhenNumber()
 {
     string[][] testData = new string[][]
     {
         new string[] { "9" },
         new string[] { "10" },
     };
     WebAssert.Sorted(testData, 0, true, DataType.Int);
 }
Пример #20
0
        public void TestNoValueAttribute()
        {
            HtmlInputRadioButtonTester button2A = new HtmlInputRadioButtonTester("button2A");

            button2A.Checked = true;
            postback.Click();

            WebAssert.TableContainsRow(formVars.RenderedCells, new string[] { "group2", "on" });
        }
Пример #21
0
        public void HasControls()
        {
            PlaceHolder place         = new PlaceHolder();
            TextBox     txtBoxControl = new TextBox();

            place.Controls.Add(txtBoxControl);

            WebAssert.HasControls(place);
        }
Пример #22
0
 public void TestSorted_WhenDate()
 {
     string[][] testData = new string[][]
     {
         new string[] { "7/4/2002" },
         new string[] { "7/16/2002" },
     };
     WebAssert.Sorted(testData, 0, true, DataType.DateTime);
 }
Пример #23
0
 public void TableHeaderTags()
 {
     string[][] expected = new string[][]
     {
         new string[] { "header 1", "data 1", "header 2", "data 2" }
     };
     WebAssert.AreEqual(expected, headerTags.Cells, "header tags table");
     WebAssert.AreEqual(expected, headerTags.RenderedCells, "header tags table (rendered)");
 }
Пример #24
0
 public void TestRenderedCells()
 {
     string[][] expected = new string[][]
     {
         new string[] { "Link", "Cell 1, 1", "Cell 1, 2", "Space: ", "1" },
         new string[] { "Link", "Cell 2, 1", "Cell 2, 2", "Space: ", "2" }
     };
     WebAssert.AreEqual(expected, grid1.RenderedCells);
 }
Пример #25
0
 public void TestCells()
 {
     string[][] expected = new string[][]
     {
         new string[] { "<a id=\"dataGrid1_ctl02_link1\" href=\"javascript:__doPostBack('dataGrid1$ctl02$link1','')\">Link</a>", "Cell 1, 1", "Cell 1, 2", "Space: ", "1" },
         new string[] { "<a id=\"dataGrid1_ctl03_link1\" href=\"javascript:__doPostBack('dataGrid1$ctl03$link1','')\">Link</a>", "Cell 2, 1", "Cell 2, 2", "Space: ", "2" }
     };
     WebAssert.AreEqual(expected, grid1.Cells);
 }
Пример #26
0
        public void IsChild()
        {
            PlaceHolder place         = new PlaceHolder();
            TextBox     txtBoxControl = new TextBox();

            txtBoxControl.ID = "TxtBoxControl";
            place.Controls.Add(txtBoxControl);

            WebAssert.IsChild(place, "TxtBoxControl");
        }
Пример #27
0
 public void TestSorted_WhenSortedDescendingAndEndingWithEmptyString()
 {
     string[][] testData = new string[][]
     {
         new string[] { "4" },
         new string[] { "3" },
         new string[] { "2" },
         new string[] { "" },
     };
     WebAssert.Sorted(testData, 0, false, DataType.String);
 }
Пример #28
0
 public void TestSorted_WhenSorted()
 {
     string[][] testData = new string[][]
     {
         new string[] { "1" },
         new string[] { "2" },
         new string[] { "3" },
         new string[] { "4" }
     };
     WebAssert.Sorted(testData, 0, true, DataType.String);
 }
Пример #29
0
 /// <summary>
 /// For backwards compatibility; will be deprecated in the future.
 /// </summary>
 public static void AssertVisibility(ControlTester tester, bool expectedVisibility)
 {
     if (expectedVisibility)
     {
         WebAssert.Visible(tester);
     }
     else
     {
         WebAssert.NotVisible(tester);
     }
 }
Пример #30
0
 public void TestSorted_WhenSortingOnLastColumn()
 {
     string[][] testData = new string[][]
     {
         new string[] { "1", "4" },
         new string[] { "3", "3" },
         new string[] { "2", "2" },
         new string[] { "4", "1" },
     };
     WebAssert.Sorted(testData, 1, false, DataType.String);
 }