public void SelectGivenNumberColumnsFromColumnOptionsStopsSelectedList(int numberColumns) { StopsMoveAllColumnsRight.Click(); //Move all columns to Selected list to make sure we have options to work with var numberOfColumns = StopsSelectedColumns.GetOptions().Count(); var currentOption = numberOfColumns / 2; var counter = 0; //Start selecting columns from the middle index and then increase while (counter < numberColumns) { StopsSelectedColumns.SelectByIndex(currentOption, "Stops - Selected Columns"); //Select the 3rd column in the list currentOption++; counter++; } ScenarioContext.Current["ExpectedSelectedColumns"] = StopsSelectedColumns.GetSelectedOptionsText(); //Save off the selected columns for use later }
public void DoubleLeftClickOnGivenStopsAvailableColumnName(string columnName) { StopsSelectedColumns.DoubleLeftClickOnSelectListOption(columnName); }
//Used to select a given column name and then save changes public void AddGivenColumnNameToSelectedColumnsListAndSaveChanges(List <string> columnNames, string stopsOrRoutesList) { OpenColumnOptionsPopup(); List <String> currentlySelectedColumnsForGivenList = stopsOrRoutesList == "Stops" ? StopsSelectedColumns.GetOptionsText().ToList() : RoutesSelectedColumns.GetOptionsText().ToList(); //If all specified columns are already selected if (columnNames.All(value => currentlySelectedColumnsForGivenList.Contains(value))) { //Close the column options popup ColumnOptionsCancelButton.Click(); } //Need to select some columns below else { foreach (string columnName in columnNames) { if (IsGivenColumnNameSelected(columnName, stopsOrRoutesList) == false) { //If the given column is not already in the selected list, then move it there MoveGivenColumnNameToSelectedColumnsList(columnName, stopsOrRoutesList); } } SaveColumnOptions(); //Save the column options popup } }