Exemple #1
0
        public void GivenUserClicksOnAddIcon(string item, string opt)
        {
            switch (item)
            {
            case "ADD":
                _context.Grid.ClickOnElement(Icons);
                _context.Grid = SupportPage.FindCreateTicketForm();
                break;

            case "Отправить":
                _context.StartDate = DateTime.UtcNow;
                if (opt.Contains("with attachment"))
                {
                    WaitElementIsVisibleByCss(FileIsUploaded);
                }

                _context.Grid.ClickOnElement(SendButton);
                CommonComponentHelper.WaitPreloaderFinish(PreloaderTicketChat);
                _context.Grid = SupportPage.FindTicketChatForm();

                _context.TicketsIDList.Add(Convert.ToInt64(new Uri(DriverManager.GetWebDriver().Url).Fragment
                                                           .Split('/')
                                                           .Last()));

                break;

            case "Remove uploaded file":
                _context.Grid.ClickOnElement(removeUploadedFile);
                _context.Grid = SupportPage.FindTicketChatForm();
                break;

            default:
                throw new Exception("No any case -branch for " + item);
            }
        }
Exemple #2
0
        public void ThenTicketsGridContains(string location, string opt, string Title, Table table)
        {
            switch (location)
            {
            case "chat":
                _context.Grid = SupportPage.FindTicketChatForm();
                CheckChatList(table.CreateSet <ChatMessages>().ToList(), Title);
                break;

            case "overview":
                _context.Grid = SupportPage.FindTicketsGrid();
                CheckTicketsList(CommonComponentHelper.ReplaceTableWithList(table.CreateSet <TicketsList>().ToList(),
                                                                            _context.TicketsIDList));
                break;

            case "closed tickets":
                _context.Grid = SupportPage.FindTicketsGrid();
                CheckTicketsList(CommonComponentHelper.ReplaceTableWithList(table.CreateSet <TicketsList>().ToList(),
                                                                            new List <long> {
                    _context.TicketsIDList.ToList().Last()
                }));
                break;

            default:
                throw new Exception("No any case -branch for " + location);
            }
        }
        public void ReceivedAmountSection(String text)
        {
            WaitCssElementContainsText(amountBlock, "=");
            var ind = GetFeeAndLimitsSection().FindElement(".amount").Text.LastIndexOf(" ");

            _context.Rate = Decimal.Parse(GetFeeAndLimitsSection().FindElement(amountBlock).Text.Substring(ind).Replace(")", ""));
            Assert.True(_context.Rate > 0, "Rate is less than 0");

            text = CommonComponentHelper.ReplaceString(text, _context.Rate, _context.Amount);

            GetFeeAndLimitsSection().FindElement(amountBlock).Text.Replace("\r\n", " ")
            .Should().Be(text);
        }