コード例 #1
0
 public void AddCustomCostAdjustmentDefaults(CostAdjustmentsData costAdjustmentsData)
 {
     ClickElement(_btnAdd);
     PopulateCostAdjustmentFields(costAdjustmentsData);
     ClickElement(_btnDialogAdd);
     Assert.IsTrue(IsSingleSuccessToastNotificationShown());
 }
コード例 #2
0
        private IWebElement GetCostAdjustmentRowCheckBox(CostAdjustmentsData costAdjustmentsData)
        {
            var rowXpath = BuildCostAdjustmentRowXpath(costAdjustmentsData);
            var row      = _grdCostAdjustmentsTable.FindElement(By.XPath(rowXpath));

            return(row.FindElement(By.ClassName("checkbox-component-icon")));
        }
コード例 #3
0
        public bool DoesCustomCostAdjustmentExist(CostAdjustmentsData costAdjustmentsData)
        {
            EnsureMandatoryValuesAreProvided(costAdjustmentsData);
            var rowXpath = BuildCostAdjustmentRowXpath(costAdjustmentsData);

            return(IsElementPresent(By.XPath(rowXpath)));
        }
コード例 #4
0
 public void EditCostAdjustmentDefaults(CostAdjustmentsData costAdjustmentsData)
 {
     SelectCostAdjustmentRow(costAdjustmentsData);
     ClickElement(_btnEdit);
     PopulateCostAdjustmentFields(costAdjustmentsData);
     ClickElement(_btnDialogSave);
     Assert.IsTrue(IsSingleSuccessToastNotificationShown());
     DismissAllToastNotifications();
     UnselectCostAdjustmentRow(costAdjustmentsData);
 }
コード例 #5
0
        private string BuildCostAdjustmentRowXpath(CostAdjustmentsData costAdjustmentsData)
        {
            var dash      = "—";
            var client    = costAdjustmentsData.Client;
            var country   = costAdjustmentsData.Country;
            var publisher = costAdjustmentsData.Publisher;

            if (client == Default)
            {
                client = country = publisher = dash;
            }

            return($"//div[contains(@class,'ag__row ag__row--is-body')][contains(.,'{client}') and contains(.,'{country}') and contains(.,'{publisher}') and contains(.,'{costAdjustmentsData.Adjustment}')]");
        }
コード例 #6
0
        private void PopulateCostAdjustmentFields(CostAdjustmentsData costAdjustmentsData)
        {
            if (!string.IsNullOrEmpty(costAdjustmentsData.Client) && costAdjustmentsData.Client != Default)
            {
                ClearInputAndTypeValue(_ddlClient, costAdjustmentsData.Client);
                ClearInputAndTypeValueIfRequired(_ddlCountry, costAdjustmentsData.Country);
                ClearInputAndTypeValueIfRequired(_ddlPublisher, costAdjustmentsData.Publisher);
                ClearInputAndTypeValue(_ddlAdjustment, costAdjustmentsData.Adjustment);
            }

            ClearInputAndTypeValueIfRequired(_txtVendorRate, costAdjustmentsData.VendorRate);
            SetReactCheckBoxState(_chkAllowUserOverrideVendorRate, costAdjustmentsData.AllowUserOverrideVendorRate);

            if (_txtClientRate.Enabled)
            {
                ClearInputAndTypeValueIfRequired(_txtClientRate, costAdjustmentsData.ClientRate);
                SetReactCheckBoxState(_chkAllowUserOverrideClientRate, costAdjustmentsData.AllowUserOverrideClientRate);
            }
        }
コード例 #7
0
        private void EnsureMandatoryValuesAreProvided(CostAdjustmentsData costAdjustmentsData)
        {
            var dataErrorFound   = false;
            var clientDataErrors = new StringBuilder();

            clientDataErrors.Append("The feature file " + FeatureContext.FeatureInfo.Title + " has the following data issues:");

            if (string.IsNullOrWhiteSpace(costAdjustmentsData.Client))
            {
                dataErrorFound = true;
                clientDataErrors.Append("\n- Client was not set");
            }

            if (string.IsNullOrWhiteSpace(costAdjustmentsData.Adjustment))
            {
                dataErrorFound = true;
                clientDataErrors.Append("\n- Adjustment was not set");
            }

            if (dataErrorFound)
            {
                throw new ArgumentException(clientDataErrors.ToString());
            }
        }
コード例 #8
0
        private void UnselectCostAdjustmentRow(CostAdjustmentsData costAdjustmentsData)
        {
            var rowCheckBox = GetCostAdjustmentRowCheckBox(costAdjustmentsData);

            SetReactCheckBoxState(rowCheckBox, false);
        }