Example #1
0
        public override bool VerifySearchResultByCriteria(KeyValuePair <string, string> valuePair, SearchCriteria name)
        {
            bool   isDisplayed = false;
            string logMsg      = string.Empty;

            try
            {
                IList <bool> resultsList = new List <bool>();

                PopulateCriteriaByType(SearchCriteria.Title, valuePair.Key);
                ClickBtn_Search();
                //PageAction.WaitForLoading();
                PageAction.WaitForPageReady();
                bool searchResult = GridHelper.VerifyRecordIsDisplayed(ColumnName.Number, valuePair.Value, TableHelper.TableType.Single);
                resultsList.Add(searchResult);

                logMsg = $"Search by Criteria '{SearchCriteria.Title.ToString()}'";
                Report.Info($"{logMsg}  was {(searchResult ? "" : "NOT ")}successful", searchResult);
                TestUtility.AddAssertionToList(searchResult, logMsg);

                ClickBtn_Clear();
                PageAction.WaitForPageReady();

                isDisplayed = resultsList.Contains(false)
                    ? false
                    : true;
            }
            catch (Exception)
            {
                log.Error(logMsg);
            }

            return(isDisplayed);
        }
        public void VerifyIfRecordsAreDisplayedByFilter(Dictionary <ColumnName, string> values)
        {
            bool status = true;

            foreach (var valuePair in values)
            {
                status = status &&
                         GridHelper.VerifyRecordIsDisplayed(
                    valuePair.Key, valuePair.Value, TableHelper.TableType.Single);

                TestUtility.AddAssertionToList(status, string.Format("Filter Validation, Key: {0}, Value: {1}", valuePair.Key, valuePair.Value));
            }

            GridHelper.VerifyRecordIsDisplayed(ColumnName.SubmittalNumber, values[ColumnName.SubmittalNumber], TableHelper.TableType.Single);

            //Open the record
            GridHelper.ClickButtonForRow(Page.TableHelper.TableButton.View, string.Empty, false);

            //Go back to Revise Review Submittal page - so the record gets locked
            NavigateToPage.RMCenter_Review_Revise_Submittal();

            GridHelper.VerifyRecordIsDisplayed(ColumnName.SubmittalNumber, values[ColumnName.SubmittalNumber], TableHelper.TableType.Single);

            //Verify if grid displays as locked by current user
            status = status && GridHelper.VerifyRecordIsDisplayed(
                ColumnName.RecordLockCreatedBy, ConfigUtil.GetCurrentUserEmail(), TableHelper.TableType.Single);

            TestUtility.AddAssertionToList(status, string.Format("Filter Validation, Key: {0}, Value: {1}", ColumnName.RecordLockCreatedBy, ConfigUtil.GetCurrentUserEmail()));
        }
Example #3
0
        public override bool VerifySearchResultByCriteria(string transmittalNumber, IList <KeyValuePair <EntryFieldType, string> > entryFieldValuesList)
        {
            bool   isDisplayed = false;
            string logMsg      = string.Empty;

            try
            {
                SearchCriteria criteria;
                IList <bool>   resultsList = new List <bool>();

                foreach (KeyValuePair <EntryFieldType, string> kvPair in entryFieldValuesList)
                {
                    criteria = GetMatchingSearchCriteriaForEntryField(kvPair.Key);

                    if (tenantSearchCriteriaFields.Contains(criteria))
                    {
                        if (!criteria.Equals(SearchCriteria.NoSelection))
                        {
                            PopulateCriteriaByType(criteria, kvPair.Value);
                            ClickBtn_Search();
                            //PageAction.WaitForLoading();
                            PageAction.WaitForPageReady();
                            bool searchResult = GridHelper.VerifyRecordIsDisplayed(ColumnName.TransmittalNumber, transmittalNumber, TableHelper.TableType.Single);
                            resultsList.Add(searchResult);

                            logMsg = $"Search by Criteria '{criteria}'";
                            Report.Info($"{logMsg}  was {(searchResult ? "" : "NOT ")}successful", searchResult);
                            TestUtility.AddAssertionToList(searchResult, logMsg);

                            ClickBtn_Clear();
                            //PageAction.WaitForLoading();
                            PageAction.WaitForPageReady();
                        }
                    }
                }

                isDisplayed = resultsList.Contains(false)
                    ? false
                    : true;
            }
            catch (Exception)
            {
                log.Error(logMsg);
            }

            return(isDisplayed);
        }
Example #4
0
        private void VerifyRequiredFields(IList <EntryFieldType> actualFields, bool isSaveFlow = false)
        {
            IList <string> actualReqFields = new List <string>();

            foreach (EntryFieldType field in actualFields)
            {
                if (isSaveFlow && !field.GetString().Equals("UploadFiles"))
                {
                    actualReqFields.Add(field.GetString());
                }
                else
                {
                    actualReqFields.Add(field.GetString());
                }
            }

            var expectedReqFields = GetTenantRequiredFieldLocators()
                                    .Where(i => !string.IsNullOrEmpty(i))
                                    .ToList();

            TestUtility.AddAssertionToList(PageAction.VerifyExpectedList(actualReqFields, expectedReqFields,
                                                                         "VerifyUploadQASubmittalRequiredFields"), "VerifyUploadQASubmittalRequiredFields");
        }