Exemplo n.º 1
0
        public void UserSeePartnerLinksWhere(List <UIPartnerLinksTable> linksTable)
        {
            int index = 0;

            foreach (var row in linksTable)
            {
                row.Registrations += memorizedPartnerTable.ElementAt(index).Registrations;
                row.Transitions   += memorizedPartnerTable.ElementAt(index).Transitions;
                index++;
            }
            CheckPartnerLinkList(linksTable);
            CommonComponentSteps.MakeScreenshot();
        }
Exemplo n.º 2
0
        public void ErrorLog()
        {
            //Make screenshot if step failed
            if (ScenarioContext.Current.TestError != null)
            {
                CommonComponentSteps.MakeScreenshot("FAILED_", true);
                TestLogger.Message("#====> FAILED:" + Environment.NewLine
                                   + "+ " + ScenarioStepContext.Current.StepInfo.Text +
                                   Environment.NewLine + Environment.NewLine
                                   + ScenarioContext.Current.TestError.Message, false, true);
            }


            //Checking for JS errors after every step, if a new errors are detected then make screenshot
            if (previousStepJSerrors.Any())
            {
                if (!previousStepJSerrors.IsSameOrEqualTo(DriverManager.GetWebDriver().Manage().Logs.GetLog(LogType.Browser).Where(it => it.Level == LogLevel.Severe)))
                {
                    _JSerrorsList.AppendLine(Environment.NewLine + "+ " + ScenarioStepContext.Current.StepInfo.Text +
                                             Environment.NewLine);
                    _JSerrorsList.AppendLine(CommonComponentSteps.MakeScreenshot());
                }
            }


            //Memorize actual console errors
            previousStepJSerrors = DriverManager.GetWebDriver().Manage().Logs.GetLog(LogType.Browser)
                                   //Detect only SEVERE errors
                                   .Where(it => it.Level == LogLevel.Severe)
                                   //Exclude expected errors
                                   .Where(entry => !excludedErrors.Any(s => entry.Message.Contains(s)));


            //Logging NEW JS Errors
            foreach (var entry in previousStepJSerrors)
            {
                _JSerrorsList.AppendLine($"{DateTime.UtcNow.ToString("G", new CultureInfo("ru-ru"))}" +
                                         Environment.NewLine +
                                         ">>#" + entry + Environment.NewLine);
            }
        }
Exemplo n.º 3
0
        public void GivenUserClicksOnInGrid2(string value, string card)
        {
            switch (value)
            {
            case "Активировать":
                _context.Grid = MultiFormComponent.FindUIView();
                break;

            case "Заблокировать":
                WaitElementIsVisibleByCss(CardOptions);
                FindEpaCard(card).ClickOnElement(CardOptions);
                WaitElementWithTextByXpath(value);
                break;

            case "Разблокировать":
                WaitElementWithTextByXpath(value);
                _context.Grid = MultiFormComponent.FindUIView();
                break;
            }
            CommonComponentSteps.MakeScreenshot();
            FindEpaCard(card).ClickByText(value, "", ".");
        }
Exemplo n.º 4
0
 public void UserSeePartner(int rows)
 {
     memorizedPartnerTable = CreatePartnerLinkList(_context.Grid.DataGridContent(BonusLinkGroup, rows));
     CommonComponentSteps.MakeScreenshot();
 }