Пример #1
0
        public void MultipleCustomFiltersOnTwoColumns()
        {
            var firstColumn  = "Integer";
            var secondColumn = "IntegerNullable";

            this.navigator.AllTypesDataPage().GoTo();
            var table           = new TableElement("table", this.driver);
            var filterContainer = new CustomFilterContainer(this.driver, "#custom-filters-container");

            filterContainer.Gt(firstColumn, "5");
            filterContainer.Lt(firstColumn, "70");
            filterContainer.Gte(secondColumn, "20");
            filterContainer.Lte(secondColumn, "50");

            table.ClickSortButton(firstColumn);
            var resultFirstColumnValues = table.GetColumnRowValuesUntilAny(firstColumn).Select(x => int.Parse(x));

            Assert.IsTrue(resultFirstColumnValues.All(x => 5 < x && x < 70));

            table.ClickSortButton(firstColumn);
            resultFirstColumnValues = table.GetColumnRowValuesUntilAny(firstColumn).Select(x => int.Parse(x));
            Assert.IsTrue(resultFirstColumnValues.All(x => 5 < x && x < 70));

            table.ClickSortButton(secondColumn);
            var resultsecondColumnValues = table.GetColumnRowValuesUntilAny(secondColumn).Select(x => int.Parse(x));

            Assert.IsTrue(resultsecondColumnValues.All(x => 20 <= x && x <= 50));

            table.ClickSortButton(firstColumn);
            resultsecondColumnValues = table.GetColumnRowValuesUntilAny(secondColumn).Select(x => int.Parse(x));
            Assert.IsTrue(resultsecondColumnValues.All(x => 20 <= x && x <= 50));
        }
Пример #2
0
        public void Sort_SholdWorkWithSubsecuentPropertiesSortOperations()
        {
            ExceptionsHandler.Hande(() =>
            {
                string firstColumnName  = "Integer";
                string secondColumnName = "DoubleProperty";

                this.navigator.AllTypesDataPage().GoTo();
                var tableElement = new TableElement("table", this.driver);
                tableElement.ClickSortButton(firstColumnName, SortDirectionsEnum.Asc);
                tableElement.ClickSortButton(secondColumnName, SortDirectionsEnum.Asc);

                AssertNonTextPropertyOrder(secondColumnName, secondColumnName, SortDirectionsEnum.Asc, typeof(double), tableElement);
                tableElement.GoToLastPage();
                AssertNonTextPropertyOrder(secondColumnName, secondColumnName, SortDirectionsEnum.Asc, typeof(double), tableElement);
            },
                                    this.driver);
        }
Пример #3
0
        public void MultipleCustomFiltersOnSameColumn()
        {
            var column = "Integer";

            this.navigator.AllTypesDataPage().GoTo();
            var table           = new TableElement("table", this.driver);
            var filterContainer = new CustomFilterContainer(this.driver, "#custom-filters-container");

            filterContainer.Gt(column, "5");
            filterContainer.Lt(column, "10");

            table.ClickSortButton(column);
            Thread.Sleep(GlobalConstants.GlobalThreadSleep);
            var resultColumnValues = table.GetColumnRowValuesUntilAny(column).Select(x => int.Parse(x));

            Assert.IsTrue(resultColumnValues.All(x => 5 < x && x < 10));

            table.ClickSortButton(column);
            Thread.Sleep(GlobalConstants.GlobalThreadSleep);
            resultColumnValues = table.GetColumnRowValuesUntilAny(column).Select(x => int.Parse(x));
            Assert.IsTrue(resultColumnValues.All(x => 5 < x && x < 10));
        }
Пример #4
0
        public void Sort_SholdWorkAppropriateForNonTextTypes(string columnName, SortDirectionsEnum direction, Type propertyType)
        {
            ExceptionsHandler.Hande(() =>
            {
                this.navigator.AllTypesDataPage().GoTo();
                var tableElement    = new TableElement("table", this.driver);
                string columnHeader = columnName.StartsWith("NestedModel") ? this.GetHeaderForNestedModel(columnName) : columnName;
                tableElement.ClickSortButton(columnHeader, direction);

                AssertNonTextPropertyOrder(columnName, columnHeader, direction, propertyType, tableElement);
                tableElement.GoToLastPage();
                AssertNonTextPropertyOrder(columnName, columnHeader, direction, propertyType, tableElement);
            },
                                    this.driver);
        }
Пример #5
0
        public void Sort_SholdWorkAppropriateForTextTypes(string columnName, SortDirectionsEnum direction)
        {
            ExceptionsHandler.Hande(() =>
            {
                this.navigator.AllTypesDataPage().GoTo();
                var tableElement = new TableElement("table", this.driver);
                tableElement.ClickSortButton(columnName, direction);

                // Assert that rows are in correct order for the first page
                AssertTextPropertyOrder(columnName, direction, tableElement);
                tableElement.GoToLastPage();
                // Assert that rows are in correct order for the last page
                AssertTextPropertyOrder(columnName, direction, tableElement);
            },
                                    this.driver);
        }