Ejemplo n.º 1
0
 public SupportViewModel(
     DlsSubApplication dlsSubApplication,
     SupportPage currentPage,
     string currentSystemBaseUrl
     ) : base(dlsSubApplication, currentPage, currentSystemBaseUrl)
 {
 }
Ejemplo n.º 2
0
        public ActionResult Index(int?pPage)
        {
            SupportPage mSupportPage = new SupportPage();

            if (pPage == null)
            {
                if (Session["LoaiHoTroPage"] != null)
                {
                    pPage = (int)Session["LoaiHoTroPage"];
                }
                else
                {
                    pPage = 1;
                }
            }
            else
            {
                Session["LoaiHoTroPage"] = pPage;
            }
            #endregion
            /*Lay danh sach cac tin theo page*/
            var mSupportTypeList = SupportService.LaySupportTypeTheoTrang((int)pPage, 10);
            if (mSupportTypeList.Count < 10)
            {
                mSupportPage.IsEnd = true;
            }
            //Tao Html cho danh sach tin nay
            mSupportPage.Html = V308HTMLHELPER.TaoDanhSachSupportType(mSupportTypeList, (int)pPage);
            mSupportPage.Page = (int)pPage;
            return(View("Index", mSupportPage));
        }
Ejemplo n.º 3
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);
            }
        }
Ejemplo n.º 4
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);
            }
        }
        public void SupportNavigation()
        {
            try
            {
                homePage.NavigateToSubMenu(homePage.WeAreWabashMenu, homePage.SupportSubMenu);
                supportPage = new SupportPage();

                actualUrl = WindowHelper.GetUrl();
                Assert.AreEqual(supportPage.Url, actualUrl,
                                string.Format("Actual url: <{0}> is not equal to expected: <{1}>", actualUrl, supportPage.Url));
                Logger.Info("ASSERT - Url is correct");

                actualBreadcrumb = supportPage.GetBreadcrumbString();
                Assert.AreEqual(supportPage.Breadcrumb, actualBreadcrumb,
                                string.Format("Actual breadcrumb: <{0}> is not equal to expected: <{1}>", actualBreadcrumb, supportPage.Breadcrumb));
                Logger.Info("ASSERT - Breadcrumb is correct");
            }
            catch (Exception exception)
            {
                GenericHelper.TakeScreenShot();
                Logger.Error(exception.Message);
                Logger.Error(exception.StackTrace);
                throw;
            }
        }
Ejemplo n.º 6
0
 public void FillTest()
 {
     Header.Search.SearchButton.Click();
     Header.Search.Find("something");
     Header.Search.SearchButonActive.Click();
     SupportPage.CheckOpened();
 }
 public static void Init()
 {
     Home          = new HomePage();
     ServiceStatus = new ServiceStatusPage();
     Standings     = new StandingsPage();
     Support       = new SupportPage();
     Tickets       = new TicketsPage();
 }
Ejemplo n.º 8
0
        public ActionResult Create()
        {
            SupportPage mSupportPage = new SupportPage();
            var         mSupportType = SupportService.LaySupportTypeAll();

            mSupportPage.HtmlNhom = V308HTMLHELPER.TaoDanhSachSupportType2(mSupportType, 0);
            return(View("Create", mSupportPage));
        }
 public ResourcesViewModel(
     DlsSubApplication dlsSubApplication,
     SupportPage currentPage,
     string currentSystemBaseUrl,
     IEnumerable <ResourceGroup> resourceGroups
     ) : base(dlsSubApplication, currentPage, currentSystemBaseUrl)
 {
     Categories = resourceGroups.Select(rc => new ResourceGroupViewModel(rc, currentSystemBaseUrl));
 }
        public void ClickSupportButton_IsOpenSupportPage()
        {
            SigninAccount();

            this.authorizeFormPopup = homePage.OpenLogedinAccountForm();
            SupportPage supportPage = authorizeFormPopup.ClickSupportButton();

            Assert.IsTrue(supportPage.IsFAQFormDisplayed());
        }
        public void ClickSupportButton_IsOpenSupportPage()
        {
            SigninAccount();

            this.authorizeFormPopup = homePage.OpenLogedinAccountForm();
            SupportPage supportPage = authorizeFormPopup.ClickSupportButton();

            AllureLifecycle.Instance.Verify.That("FAQ form displayed", () => supportPage.IsFAQFormDisplayed(), Is.True);
        }
Ejemplo n.º 12
0
        public void TestNav()
        {
            var mainPage = new MainPage(driver);

            mainPage.supportLink.Click();
            var supPage = new SupportPage(driver);
            var text    = supPage.supportHeader.GetAttribute("innerText");

            Assert.AreEqual(text, "SUPPORT US");
        }
 protected BaseSupportViewModel(
     DlsSubApplication dlsSubApplication,
     SupportPage currentPage,
     string currentSystemBaseUrl
     )
 {
     CurrentPage          = currentPage;
     DlsSubApplication    = dlsSubApplication;
     CurrentSystemBaseUrl = currentSystemBaseUrl;
 }
Ejemplo n.º 14
0
        public FaqsPageViewModel(
            DlsSubApplication dlsSubApplication,
            SupportPage currentPage,
            string currentSystemBaseUrl,
            SearchSortFilterPaginationResult <SearchableFaq> result
            ) : base(result, false, searchLabel: "Search faqs")
        {
            CurrentPage          = currentPage;
            DlsSubApplication    = dlsSubApplication;
            CurrentSystemBaseUrl = currentSystemBaseUrl;

            Faqs = result.ItemsToDisplay.Select(f => new SearchableFaqViewModel(DlsSubApplication, f));
        }
Ejemplo n.º 15
0
        public void Setup()
        {
            // TODO: Preconditions
            Logger.Info("Navigating to Support page");
            SupportPage.Open();
            SupportPage.CheckTitle();
            SupportPage.IsOpened();
            Logger.Info("Setup method finished");
            Logger.Info($"Start test: {TestContext.CurrentContext.Test.Name}");
            // End preconditions

            Table.Clear();
        }
Ejemplo n.º 16
0
        public ActionResult Edit(int pId = 0)
        {
            SupportPage mSupportPage = new SupportPage();
            var         mSupportType = SupportService.LaySupportTypeTheoId(pId);

            if (mSupportType != null)
            {
                mSupportPage.pSupportType = mSupportType;
            }
            else
            {
                mSupportPage.Html = "Không tìm thấy tin tức cần sửa.";
            }
            return(View("Edit", mSupportPage));
        }
Ejemplo n.º 17
0
        public ActionResult Edit(int pId = 0)
        {
            SupportPage mSupportPage = new SupportPage();
            var         mSupport     = SupportService.LayTheoId(pId);

            if (mSupport != null)
            {
                var mSupportType = SupportService.LaySupportTypeAll();
                mSupportPage.HtmlNhom = V308HTMLHELPER.TaoDanhSachSupportType3(mSupportType, (int)mSupport.TypeID);
                mSupportPage.pSupport = mSupport;
            }
            else
            {
                mSupportPage.Html = "Không tìm thấy tin tức cần sửa.";
            }
            return(View("Edit", mSupportPage));
        }
Ejemplo n.º 18
0
        public void GivenUserClicksOnInGrid(string value, string grid)
        {
            SearchElementByTextXpath(grid).Click();
            SearchElementByTextXpath(value).Click();
            WaitPreloaderFinish(Preloader);
            WaitPreloaderFinish(PreloaderGrid);

            switch (grid)
            {
            case "Служба поддержки":
                _context.Grid = SupportPage.FindTicketsGrid();
                break;

            default:
                throw new Exception("No any case -branch for " + grid);
            }
        }
Ejemplo n.º 19
0
        public FaqsPageViewModel(
            DlsSubApplication dlsSubApplication,
            SupportPage currentPage,
            string currentSystemBaseUrl,
            IEnumerable <SearchableFaq> faqs,
            int page,
            string?searchString
            ) : base(searchString, page, false, FaqSortBy, Descending, searchLabel: "Search faqs")
        {
            CurrentPage          = currentPage;
            DlsSubApplication    = dlsSubApplication;
            CurrentSystemBaseUrl = currentSystemBaseUrl;

            var searchedItems = GenericSearchHelper.SearchItemsUsingTokeniseScorer(faqs, SearchString, MatchCutOffScore).ToList();
            var faqsToShow    = SortFilterAndPaginate(searchedItems);

            Faqs = faqsToShow.Select(f => new SearchableFaqViewModel(DlsSubApplication, f));
        }
Ejemplo n.º 20
0
        public async Task <IActionResult> Create([Bind("Message")] SupportTicket supportTicket)
        {
            if (ModelState.IsValid)
            {
                AppUser currentUser = await _userManager.FindByIdAsync(User.FindFirstValue(ClaimTypes.NameIdentifier));

                SupportPage newSupportPage = new SupportPage
                {
                    UserId        = Guid.Parse(currentUser.Id),
                    OwnerEmail    = currentUser.Email,
                    OwnerUsername = currentUser.UserName
                };
                supportTicket.UserId        = Guid.Parse(currentUser.Id);
                supportTicket.SupportPageId = newSupportPage.Id;

                _context.SupportPages.Add(newSupportPage);
                _context.SupportTickets.Add(supportTicket);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(supportTicket));
        }
Ejemplo n.º 21
0
        public void HelpForm()
        {
            try
            {
                homePage.NavigateToSubMenu(homePage.WeAreWabashMenu, homePage.SupportSubMenu);

                supportPage = new SupportPage();
                supportPage.FillOutForm(ExcelReaderHelper.GetCellData(excelPath, 1, 0),
                                        ExcelReaderHelper.GetCellData(excelPath, 1, 1),
                                        ExcelReaderHelper.GetCellData(excelPath, 1, 2),
                                        ExcelReaderHelper.GetCellData(excelPath, 1, 3),
                                        ExcelReaderHelper.GetCellData(excelPath, 1, 4),
                                        ExcelReaderHelper.GetCellData(excelPath, 1, 5),
                                        ExcelReaderHelper.GetCellData(excelPath, 1, 6));
                supportPage.SubmitForm();

                if (supportPage.GetSuccessMessage() != null)
                {
                    actualMessage = supportPage.GetSuccessMessage();
                }
                else
                {
                    throw new Exception("Success message isn't present on the page");
                }
                Assert.AreEqual(supportPage.ExpectedMessage, actualMessage,
                                string.Format("Actual message: <{0}> is not equal to expected message: <{1}>", actualMessage, supportPage.ExpectedMessage));
                Logger.Info("ASSERT - Form completed successfuly");
            }
            catch (Exception exception)
            {
                GenericHelper.TakeScreenShot();
                Logger.Error(exception.Message);
                Logger.Error(exception.StackTrace);
                throw;
            }
        }
Ejemplo n.º 22
0
 public void CellWaitMatchTextTest()
 {
     HomePage.IsOpened();
     RunParallel(() => SupportPage.IsOpened());
     CheckText(() => Table.Cell(2, 2).WaitMatchText("[a-zA-Z, ]*JUnit,[a-zA-Z ]*"), "TestNG, JUnit, Custom");
 }
Ejemplo n.º 23
0
 public void WaitTextParallelTest()
 {
     SupportPage.IsOpened();
     RunParallel(() => HomePage.IsOpened());
     Assert.AreEquals(_textItem.WaitText(_contains), _expectedText);
 }
Ejemplo n.º 24
0
 public void WaitRowsTimeoutTest()
 {
     HomePage.IsOpened();
     RunParallel(() => SupportPage.IsOpened());
     Assert.IsFalse(Table.WaitRows(7));
 }
Ejemplo n.º 25
0
 async void ImageButton_Clicked(object sender, EventArgs e)
 {
     var supportPage = new SupportPage();
     await Navigation.PushAsync(supportPage);
 }
Ejemplo n.º 26
0
 public void ClickTest()
 {
     _link.Click();
     SupportPage.IsOpened();
 }
Ejemplo n.º 27
0
 public void WaitRowsTest()
 {
     HomePage.IsOpened();
     RunParallel(() => SupportPage.IsOpened());
     Assert.IsTrue(Table.WaitRows(6));
 }