public void WhenIDeleteTheFirstEntity(string entityName)
        {
            var page = new GenericEntityPage(entityName, _contextConfiguration);

            page.Navigate();
            page.DeleteTopEntity();
        }
Beispiel #2
0
        public void WhenINavigateToTheCreatePage(string entityName)
        {
            _entityName = entityName;
            var page = new GenericEntityPage(entityName, _contextConfiguration);

            page.Navigate();
            _createPage = page.ClickCreateButton();
        }
        public void IOpenTheCreateEntityForm(string entityName)
        {
            var page = new GenericEntityPage(entityName, _contextConfiguration);

            page.ClickCreateButton();
            var factory = new EntityDetailFactory(_contextConfiguration);

            factory.ApplyDetails(entityName, true);
        }
Beispiel #4
0
        public void SortBy(string entityName, string columnName)
        {
            var page               = new GenericEntityPage(entityName, _contextConfiguration);
            var columnHeader       = page.ColumnHeader(columnName);
            var initialHeaderState = columnHeader.GetAttribute("class");

            columnHeader.Click();
            _driverWait.Until(_ => columnHeader.GetAttribute("class") != initialHeaderState);
        }
        public void ThenIValidateEachEntityHasEntityAssociations(string referenceOppositeName, int numAssociations, string targetEntityName, string association)
        {
            if (targetEntityName is null)
            {
                throw new ArgumentNullException(nameof(targetEntityName));
            }

            // form a list of expected guids to compare with the ones that are read off the page
            ICollection <Guid> expectedGuids = new List <Guid>();
            ICollection <Guid> searchGuids   = new List <Guid>();

            if (association == _initialAssociation)
            {
                _targetEntities.ForEach(x => searchGuids.Add(x.Id));
                _sourceEntities.ForEach(x => expectedGuids.Add(x.Id));
            }
            else
            {
                _targetEntities.ForEach(x => expectedGuids.Add(x.Id));
                _sourceEntities.ForEach(x => searchGuids.Add(x.Id));
            }

            // Navigate to entity page
            var page = new GenericEntityPage(referenceOppositeName, _contextConfiguration);

            page.Navigate();

            foreach (var searchGuid in searchGuids)
            {
                // Search for entity using GUID
                page.SearchInput.ClickWithWait(_driverWait);
                page.SearchInput.SendKeys(searchGuid.ToString());
                page.SearchButton.Click();
                _driverWait.Until(_ => page.TotalEntities() == 1);
                page.GetAllEntites().FirstOrDefault()?.EditItem();

                // Get the guids from the page
                var entityDetailsSection = EntityDetailUtils.GetEntityDetailsSection(referenceOppositeName, _contextConfiguration);
                var associations         = entityDetailsSection.GetAssociation(association.Replace(" ", "").ToLower());

                // Assert the guids on the page match the expected guids
                foreach (var guid in expectedGuids)
                {
                    Assert.Contains(guid, associations);
                }
                Assert.Equal(numAssociations, associations.Count);
                new GenericEntityEditPage(_contextConfiguration).Cancel();
            }
        }
Beispiel #6
0
        public void AssertThatTypeProperlySortedIn(string columnName, string pageName, string attributeType, string sortOrder)
        {
            var page = new GenericEntityPage(pageName, _contextConfiguration);
            // Get original list
            var originalList = page.GetColumnContents(columnName);
            // Filter out non-alphanumeric contents except Date, Time, DateTime
            var sortingList = SortingUtils.FilterOutNonAlphanumeric(attributeType, originalList);

            switch (sortingList.Count)
            {
            case 0:
                Assert.Empty(sortingList);                         // When table content is all non-alphanumeric/non-date/times
                break;

            default:
                var sortedList = SortingUtils.AssertSorted(_contextConfiguration.CultureInfo, attributeType, sortingList, sortOrder);
                Assert.Equal(sortedList, sortingList, new EqualityListComparer <string>());
                break;
            }
        }
Beispiel #7
0
 public FilterSteps(ContextConfiguration contextConfiguration) : base(contextConfiguration)
 {
     _contextConfiguration = contextConfiguration;
     _genericEntityPage    = new GenericEntityPage(_contextConfiguration);
     _isFastText           = contextConfiguration.SeleniumSettings.FastText;
 }
Beispiel #8
0
 public BulkDeleteFeatureSteps(ContextConfiguration contextConfiguration) : base(contextConfiguration)
 {
     _contextConfiguration = contextConfiguration;
     _genericEntityPage    = new GenericEntityPage(_contextConfiguration);
     _modalOnPage          = new ModalOnPage(_contextConfiguration);
 }
        public void IClickToCreateAnEntity(string entityName)
        {
            var page = new GenericEntityPage(entityName, _contextConfiguration);

            page.ClickCreateButton();
        }
 public EntityCreateSteps(ContextConfiguration contextConfiguration) : base(contextConfiguration)
 {
     _contextConfiguration = contextConfiguration;
     _genericEntityPage    = new GenericEntityPage(_contextConfiguration);
 }
        public void AssertOnBackendPage(string pageName)
        {
            var page = new GenericEntityPage(pageName.RemoveWordsSpacing(), _contextConfiguration);

            page.AssertOnPage();
        }
        public void WhenIClickOnFilterButton(string entityName)
        {
            var page = new GenericEntityPage(entityName, _contextConfiguration);

            page.FilterButton.Click();
        }
Beispiel #13
0
        public void WhenIClickViewOnTheFirstRowAndNavigateToTheViewEntityPage(string entityName)
        {
            var genericEntityPage = new GenericEntityPage(entityName, _contextConfiguration);

            genericEntityPage.ViewTopEntity();
        }