Beispiel #1
0
        public void HtmlTable_FindRowUsingTableWithoutRowHeaders_Succeeds()
        {
            WebPage           bWin = WebPage.Launch(CurrentDirectory + "/TestHtmlPage.html", "A Test");
            EnhancedHtmlTable tbl  = bWin.Get <EnhancedHtmlTable>("id=calcWithOutHeaders");

            tbl.FindRowAndClick(2, "9", EnhancedHtmlTableSearchOptions.NormalTight);
            Assert.AreEqual("9", tbl.GetCellValue(2, 2).Trim());
            bWin.Close();
        }
Beispiel #2
0
        public void HtmlTable_ColumnCount_Succeeds()
        {
            WebPage.Launch(CurrentDirectory + "/TestHtmlPage.html");
            var bWin = new WebPage("A Test");
            EnhancedHtmlTable tbl = bWin.Get <EnhancedHtmlTable>("id=calcWithHeaders");

            Assert.AreEqual(3, tbl.ColumnCount);
            bWin.Close();
        }
Beispiel #3
0
        public void HtmlTable_GetCellValueWithHeaderCell_Succeeds()
        {
            WebPage bWin = WebPage.Launch(CurrentDirectory + "/TestHtmlPage.html", "A Test");

            EnhancedHtmlTable termTable = bWin.Get <EnhancedHtmlTable>("Id=calcWithHeaderCells");

            Assert.AreEqual("3", termTable.GetCellValue(1, 1));

            bWin.Close();
        }
Beispiel #4
0
        public void HtmlTable_ClickOnColumnHeader_Succeeds()
        {
            WebPage.Launch(CurrentDirectory + "/TestHtmlPage.html");
            var bWin = new WebPage("A Test");
            EnhancedHtmlTable tbl = bWin.Get <EnhancedHtmlTable>("id=tableWithAlertOnHeaderClick");

            tbl.FindHeaderAndClick(0, 0);
            bWin.PerformDialogAction(BrowserDialogAction.Ok);
            bWin.Close();
        }
Beispiel #5
0
        public void HtmlTable_GetCellValueUsingTableWithTHInTBODY_Succeeds()
        {
            //Arrange
            using (var tempFile = new TempFile(
                       @"<html>
    <head>
        <title>test</title>
    </head>
    <body>
        <table id=""tableId"" border=""1"">
            <tbody>
                <tr>
                    <th>Lun</th>
                    <th>Used Space</th>
                    <th>Free Space</th>
                    <th>Usage %</th>
                    <th>&nbsp;</th>
                </tr>
                <tr>
                    <td>LUN_04</td>
                    <td>26534605227</td>
                    <td>15405750418</td>
                    <td>
                        <dl>
                            <dd>
                                <dl>
                                    <dd>
                                        <span>64.27%</span>
                                    </dd>
                                </dl>
                            </dd>
                        </dl>
                    </td>
                    <td></td>
                </tr>
            </tbody>
        </table>
    </body>
</html>"))
            {
                WebPage.Launch(tempFile.FilePath);
                var window = new WebPage("test");

                EnhancedHtmlTable table = window.Get <EnhancedHtmlTable>("id=tableId");

                //Act
                table.FindRowAndClick(0, "LUN_04", EnhancedHtmlTableSearchOptions.NormalTight);

                //Assert
                Assert.AreEqual("LUN_04", table.GetCellValue(1, 0).Trim());

                window.Close();
            }
        }
Beispiel #6
0
        public void HtmlTable_GetColumnHeaders_Succeeds()
        {
            WebPage.Launch(CurrentDirectory + "/TestHtmlPage.html");
            var bWin = new WebPage("A Test");
            EnhancedHtmlTable tbl = bWin.Get <EnhancedHtmlTable>("id=calcWithHeaders");
            var saExpectedValues  = new[] { "Header1", "Header2", "Header3" };

            string[] saHeaders = tbl.GetColumnHeaders();
            Assert.AreEqual(saExpectedValues[0], saHeaders[0]);
            Assert.AreEqual(saExpectedValues[1], saHeaders[1]);
            Assert.AreEqual(saExpectedValues[2], saHeaders[2]);
            bWin.Close();
        }
Beispiel #7
0
        public void HtmlTable_FindHeaderAndClick_Succeeds()
        {
            //Arrange
            using (var tempFile = new TempFile(
                       @"<html>
    <head>
        <title>test</title>
    </head>
    <body>
        <table style=""width: 100%;"" id=""tableId"">
            <tbody>
                <tr>
                    <td>Commitment</td>
                    <th>September</th>
                    <th>October</th>
                    <th>November</th>
                    <td>Total</td>
                </tr>
                <tr>
                    <td>Beginning Balance</td>
                    <td>¥21,570,253</td>
                    <td>¥21,375,491</td>
                    <td>¥21,200,873</td>
                    <td></td>
                </tr>
                <tr>
                    <td>New Purchases</td>
                    <td>¥0</td>
                    <td>¥0</td>
                    <td>¥0</td>
                    <td></td>
                </tr>
                <tr>
                    <td>Utilized</td>
                    <td>¥194,762</td>
                    <td>¥174,618</td>
                    <td>¥0</td>
                    <td>¥369,380</td>
                </tr>
                <tr>
                    <td>Ending Balance</td>
                    <td>¥21,375,491</td>
                    <td>¥21,200,873</td>
                    <td>¥21,200,873</td>
                    <td></td>
                </tr>
                <tr>
                    <td><b>Overage</b></td> 
                    <td>¥0</td>
                    <td>¥0</td>
                    <td>¥0</td>
                    <td>¥0</td>
                    <td></td>
                </tr>
                <tr>
                    <td><b>Total Usage</b></td>
                    <td>¥194,762</td>
                    <td>¥174,618</td>
                    <td>¥0</td>
                    <td>¥369,380</td>
                </tr>
            </tbody>
        </table>
    </body>
</html>"))
            {
                WebPage.Launch(tempFile.FilePath);
                var window = new WebPage("test");

                EnhancedHtmlTable table = window.Get <EnhancedHtmlTable>("id=tableId");

                //Act
                table.FindHeaderAndClick(0, 2);

                window.Close();
            }
        }