Пример #1
0
        public void WhenIDeleteAllTheKnowledgeBaseItemsICreatedForThisTestScenario()
        {
            var items = ScenarioContext.Current.Keys.Where(k => k.StartsWith("KBIName")).ToList();

            for (var i = 0; i < items.Count; i++)
            {
                _commonStepDefs.GivenINavigateToPage("knowledge-base");
                _commonStepDefs.ThenIShouldBeNavigatedToPage("knowledge-base");
                _kbmSearchPage.SelectAllCategories();
                _kbmSearchPage.ClickSearch();
                _kbmSearchPage.ClickEditFor(i);
                _kbmEditItemPage.ClickDelete();
                _commonStepDefs.ThenAConfirmationPopupIsDisplayedStating("Delete item",
                                                                         "Do you want to delete this item?");
                _commonStepDefs.WhenIClickOnTheNotesConfirmationDialog("Delete");
                _commonStepDefs.ThenTheNotesConfirmationDialogIsDismissed();
                _commonStepDefs.ThenIShouldBeNavigatedToPage("knowledge-base");
            }
        }
        public void WhenIAddTheFollowingKnowledgeBaseItems(Table table)
        {
            var rows = table.Rows;
            var i    = 0;

            foreach (var row in rows)
            {
                _commonStepDefs.GivenINavigateToPage("knowledge-base/create");
                _commonStepDefs.ThenIShouldBeNavigatedToPage("knowledge-base/create");
                _addNewItem.EnterKbDetails(row, i);
                _addNewItem.EnterKbAddressDetails(row);
                _addNewItem.EnterKbNote(row["Note"]);
                if (row.ContainsKey("Global") && !string.IsNullOrWhiteSpace(row["Global"]))
                {
                    if (row["Global"].Equals("true", StringComparison.InvariantCultureIgnoreCase))
                    {
                        _addNewItem.TickAssignToAllDestinations();
                    }
                    else if (row["Global"].Equals("false", StringComparison.InvariantCultureIgnoreCase))
                    {
                        _addNewItem.UntickAssignToAllDestinations();
                    }
                }
                else
                {
                    _addNewItem.ClickAdd();
                    _addNewItem.SelectRelationship(row);
                    _addNewItem.ClickAddOnTheRelationshipDialog();
                    _addNewItem.VerifyRelationshipDialogIsDismissed();
                }

                _addNewItem.ClickSave();
                _commonStepDefs.ThenIShouldBeNavigatedToPage("knowledge-base");
                _createUpdateRoles.VerifyTextOnGrowlNotification("Success");

                i++;
            }
        }