public void Verify_new_order_creation() { string testname = TestContext.CurrentContext.Test.MethodName; extenttest = extentreport.CreateTest(testname); Dictionary <string, string> testdata = excelreader.getdata(testname); LoginPage loginpage = new LoginPage(driver.getDriver()); loginpage.loginAs("admin"); extenttest.Log(Status.Info, "Login is successfull"); HomePage homepage = new HomePage(driver.getDriver()); homepage.clickOrders(); extenttest.Log(Status.Info, "Clicked on the Orders link."); OrdersPage orderspage = new OrdersPage(driver.getDriver()); orderspage.enterdetails(testdata["quantity"], testdata["custname"], testdata["street"], testdata["city"], testdata["state"], testdata["zip"], testdata["cardno"], testdata["expdate"]); extenttest.Log(Status.Info, "Entered all data into the application"); orderspage.clickProcessbtn(); extenttest.Log(Status.Info, "Clicked on Process button."); System.Threading.Thread.Sleep(10000); Assert.IsTrue(driver.getDriver().PageSource.Contains("New order has been successfully added.")); extenttest.Log(Status.Pass, "User orders is processed correctly."); System.Threading.Thread.Sleep(10000); homepage.logout(); }
public void BindPagesToTabs() { Thickness plugC = new Thickness(0); salesFrame = new Frame(); ordersFrame = new Frame(); archiveFrame = new Frame(); stockFrame = new Frame(); statsFrame = new Frame(); salesPage = new SalesPage(); ordersPage = new OrdersPage(); archivePage = new ArchivePage(); stockPage = new StockPage(); statsPage = new StatsPage(); salesFrame.Content = salesPage; SalesTab.Content = salesFrame; ordersFrame.Content = ordersPage; OrdersTab.Content = ordersFrame; statsFrame.Content = statsPage; StatsTab.Content = statsFrame; stockFrame.Content = stockPage; StockTab.Content = stockFrame; archiveFrame.Content = archivePage; ArchiveTab.Content = archiveFrame; }
static void Main(string[] args) { LoginTest Exe = new LoginTest(); Exe.Login(); OrdersPage Op = new OrdersPage(); Op.CatalogOrderAddToCart(); }
public static void ToDate(IWebDriver driver, int day, string month, string year) { var currentMonth = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Today.Month); var currentYear = DateTime.Today.Year.ToString(); Click.Button(driver, OrdersPage.ToDateOpenCalendarSelector()); Click.Element(driver, OrdersPage.ToDateMonthYearSelector($"{currentMonth} {currentYear}")); Click.Element(driver, OrdersPage.ToDateMonthYearSelector($"{currentYear}")); SelectYearToDate(driver, year); SelectMonthToDate(driver, month); SelectDayToDate(driver, day); }
public static void OpenOrderDetailsPage(IWebDriver driver) { int i = 0; // By OrderDetailsPageLink = By.XPath($"//div[text()='DMI Order ID']/following::a[contains(text(),'{i}')]"); By OrderDetailsPageLink = OrdersPage.OrderDetailsLink(i); while (Find.ElementIfExists(driver, OrderDetailsPageLink) == false && i < 10) { LogR.Info($"Attempt to find an order on the page with a DMI Order ID containing the digit: {i}"); OrderDetailsPageLink = By.XPath($"//div[text()='DMI Order ID']/following::a[contains(text(),'{i}')]"); LogR.Info($"Attempting to look for: {OrderDetailsPageLink}"); i += 1; } Click.Element(driver, OrderDetailsPageLink); }
public static ContentPage PageParser(PageNavigateEnums data) { ContentPage page = new MainPage(); switch (data) { case PageNavigateEnums.CookersPage: page = new CookersPage() { Title = AppResources.ResourceManager.GetString("cookersPageTitle") }; break; case PageNavigateEnums.MainPage: page = new MainPage() { Title = AppResources.ResourceManager.GetString("mainPageTitle") }; break; case PageNavigateEnums.NotificationsPage: page = new NotificationsPage() { Title = AppResources.ResourceManager.GetString("notifactionsPageTitle") }; break; case PageNavigateEnums.OrdersPage: page = new OrdersPage() { Title = AppResources.ResourceManager.GetString("ordersPageTitle") }; break; case PageNavigateEnums.UserPage: page = new UserPage() { Title = AppResources.ResourceManager.GetString("userPageTitle") }; break; case PageNavigateEnums.AddressesPage: page = new AddressesPage() { Title = AppResources.ResourceManager.GetString("addressesPageTitle") }; break; case PageNavigateEnums.RecipesPage: page = new RecipesPage() { Title = AppResources.ResourceManager.GetString("recipesPageTitle") }; break; } return(page); }
public void TestChangeStatusReasonToRejected() { /** * var url = ObjectRepository.FromAppConfig.GetCrmUrl(); * var password = ObjectRepository.FromEnviron.GetCrmPassword(); * var username = ObjectRepository.FromEnviron.GetCrmUsername(); * * //Login * NavigationHelper.LoginAndOpenDynamicsApp("Kentico CRM App", url, username, password); **/ var url = ObjectRepository.FromAppConfig.GetCrmUrl(); var password = ObjectRepository.FromEnviron.GetPassword(); var username = ObjectRepository.FromEnviron.GetUsername(); NavigationHelper.LoginToDynamics("Kentico CRM App", url, username, password); //Create order OrdersPage ordersPage = new OrdersPage(); ordersPage.Open(); OrderPage order = ordersPage.CreateOrder(); order.Fill("Name", "TestSeleniumCreateOrderWithProduct"); order.Fill("Purchaser", "Test 2"); order.Fill("Moved From", "Perpetual"); order.Fill("Customer", "Test 2"); order.Fill("Price List", "Kentico USD - 2020/07/01"); order.Fill("Billing Office", "Kentico Software, LLC - USA Office"); order.Fill("Delivery Contact", "jan"); order.Save(); //Add product to order var product = order.AddProduct(); product.Fill("Existing Product", "Business - 1 Website Auto-Scalable License"); ObjectRepository.XrmApp.ThinkTime(2000); product.Fill("Pricing", "false"); product.Fill("Quantity", "1"); order = product.SaveAndClose(); order.SwitchStatusReason("Rejected"); order.Save(); }
public void TestCreateOrder() { var url = ObjectRepository.FromAppConfig.GetCrmUrl(); var password = ObjectRepository.FromEnviron.GetCrmPassword(); var username = ObjectRepository.FromEnviron.GetCrmUsername(); //Login NavigationHelper.LoginAndOpenDynamicsApp("Kentico CRM App", url, username, password); //Create order OrdersPage ordersPage = new OrdersPage(); ordersPage.Open(); OrderPage order = ordersPage.CreateOrder(); order.Fill("Name", "TestSeleniumCreateOrderWithProduct"); order.Fill("Purchaser", "Test 2"); order.Fill("Moved From", "Perpetual"); order.Fill("Customer", "Test 2"); order.Fill("Price List", "Kentico USD - 2020/07/01"); order.Fill("Billing Office", "Kentico Software, LLC - USA Office"); order.Fill("Delivery Contact", "jan"); order.Save(); //Add product to order var product = order.AddProduct(); product.Fill("Existing Product", "Business - 1 Website Auto-Scalable License"); ObjectRepository.XrmApp.ThinkTime(2000); product.Fill("Pricing", "false"); product.Fill("Quantity", "1"); order = product.SaveAndClose(); var orderId = order.GetRecordId(); //order.Fill("Name", "TestSeleniumCreateOrderWith"); ordersPage = order.SaveAndClose(); Assert.IsTrue(ordersPage.RecordExists(order, orderId), "Order hasn´t been created."); }
public ActionResult Orders() { try { int nPage = Convert.ToInt32(Request.QueryString["p"]); if (nPage < 1) { nPage = 1; } CreateRepos(); OrdersPage Model = ProductRepos.GetOrdersAffiliatePage(nPage, int.Parse(Session["UserId"].ToString())); return(View(Model)); } catch (Exception ex) { Console.Write(ex); return(Content("Xảy ra lỗi hệ thống ! Vui lòng thử lại.")); } finally { DisposeRepos(); } }
public OrderPageContorller(OrdersPage page) { _page = page; FillSaleModelList(); }
private void PageChanged(int pageIndex) { this.pageIndex = pageIndex; switch (pageIndex) { case 0: newClientPage = new NewClientPage(CloseFrame); MainFrame.Content = newClientPage; break; case 1: newOrderPage = new NewOrderPage(CloseFrame); MainFrame.Content = newOrderPage; break; case 2: newProjectPage = new NewProjectPage(CloseFrame); MainFrame.Content = newProjectPage; break; case 3: newEmployeePage = new NewEmployeePage(CloseFrame); MainFrame.Content = newEmployeePage; break; case 4: clientsPage = new ClientsPage(CloseFrame); MainFrame.Content = clientsPage; break; case 5: ordersPage = new OrdersPage(CloseFrame); MainFrame.Content = ordersPage; break; case 6: employeesPage = new EmployeesPage(CloseFrame); MainFrame.Content = employeesPage; break; case 7: allprojectsPage = new AllProjectsPage(CloseFrame); MainFrame.Content = allprojectsPage; break; case 8: lifeprojectsPage = new ProjectLifePage(CloseFrame); MainFrame.Content = lifeprojectsPage; break; case 9: notopened = new NotOpenedProjectsPage(CloseFrame); MainFrame.Content = notopened; break; case 10: alltasksPage = new TasksPage(CloseFrame); MainFrame.Content = alltasksPage; break; case 11: newTaskPage = new NewTaskPage(CloseFrame); MainFrame.Content = newTaskPage; break; case 12: newItemPage = new NewItemPage(CloseFrame); MainFrame.Content = newItemPage; break; case 13: itemsPage = new ItemsPage(CloseFrame); MainFrame.Content = itemsPage; break; } }
public GetUserPassword(OrdersPage rvp) { InitializeComponent(); OrdersPage = rvp; passwordText.Focus(); }
private void inventoryToOrders_Click(object sender, System.EventArgs e) { OrdersPage ToOrders = new OrdersPage(); ToOrders.ShowDialog(); // Shows Orders Page }
/// <summary> /// Every application in Starcounter works like a console application. They have an .EXE ending. They have a Main() function and /// they can do console output. However, they are run inside the scope of a database rather than connecting to it. /// </summary> static void Main() { // Handle.POST("/init-demo-data", () => { // The Handle class is where you register new handlers for incomming requests. // DemoData.Create(); // Will create some demo data. // return 201; // Returning an integer is the shortcut for returning a response with a status code. // }); // Handle.GET("/master", () => // { // Master m = new Master() // { // This is the root view model for our application. A view model is a JSON object/tree. // Html = "/master.html", // This is just a field we added to allow the client to know what Html to load. No magic. // }; // m.Session = new Session(); // Save the JSON on the server to be accessed using GET/PATCH to allow it to be used as a view model in web components. // return m; // Return the JSON or the HTML depending on the type asked for. See Page.json on how Starcounter knowns what to return. // }); // Handle.GET("/", () => { // The root page of our website. // return PrimaryApp.GET("/primary"); // Redirecting root to Tab 1 // }); // Handle.GET("/primary", () => // The main screen of the app // { // var m = Master.GET("/master"); // Create the view model for the main application frame. // PrimaryApp p = new PrimaryApp(); // The email application also consists of a view model. // p.Html = "/primary.html"; // Starcounter is a generic server and does not know of Html, so this is a variable we create in Page.json // p.AddSomeNiceMenuItems(m); // Adds some menu items in the main menu (by modifying the master view model) // m.ApplicationPage = p; // Place the email applications view model inside the main application frame as its subpage. // m.TabName = "My Form"; // Used to highlight the current tab in the client // return p; // Returns the home page. As you can see in Page.json, we taught it how to serve both HTML and the JSON view model without any extra work. // }); // Handle.GET("/primary/create", () => // { // var p = PrimaryApp.GET("/primary"); // p.FocusedPage = new PrimaryPage() // { // Html = "/primary-create.html" // }; // return p; // }); // Polyjuice hadlers // Note that all handlers could be mapped so serve content for different URLs // Dashboard // Usually brief summary, or basic feature to be shown on a main screen. /*Handle.GET("/dashboard", () => { var page = new DashboardPage() { //Html = "/dashboard.html" // will fail as other app does also use `/dashboard.html` Html = "/boilerplate-dashboard.html" }; var ingredients = SQL<PolyjuiceBoilerplate.Ingredient>("SELECT i FROM PolyjuiceBoilerplate.Ingredient i"); page.Ingredients.Data = ingredients; page.Transaction = new Transaction(); return page; });*/ // Menu // Launcher navigation menu Handle.GET("/menu", () => { var p = new Page() { Html = "/billing-menu.html" }; return p; }); Handle.GET("/billing/vendables", () => { var page = new VentablesPage() { Html = "/billing-vendables.html" }; page.Transaction = new Transaction(); //page.Session = Session.Current; var vendables = SQL<Billing.Vendable>("SELECT v FROM Billing.Vendable v"); page.Vendables.Data = vendables; return page; }); Handle.GET("/billing/offers", () => { var page = new OffersPage() { Html = "/billing-offers.html" }; page.Transaction = new Transaction(); //page.Session = Session.Current; var offers = SQL<Billing.Offer>("SELECT o FROM Billing.Offer o"); page.Offers.Data = offers; var vendables = SQL<Billing.Vendable>("SELECT v FROM Billing.Vendable v"); page.Vendables.Data = vendables; return page; }); Handle.GET("/billing/buy", () => { var page = new BuyPage() { Html = "/billing-buy.html" }; page.Transaction = new Transaction(); //page.Session = Session.Current; var offers = SQL<Billing.Offer>("SELECT o FROM Billing.Offer o"); page.Offers.Data = offers; return page; }); Handle.GET("/billing/orders", () => { var page = new OrdersPage() { Html = "/billing-orders.html" }; page.Transaction = new Transaction(); //page.Session = Session.Current; var orders = SQL<Billing.Order>("SELECT o FROM \"Billing.Order\" o WHERE invoice IS NULL"); page.Orders.Data = orders; return page; }); Handle.GET("/billing/invoices", () => { var page = new InvoicesPage() { Html = "/billing-invoices.html" }; page.Transaction = new Transaction(); //page.Session = Session.Current; var invoices = SQL<Billing.Invoice>("SELECT i FROM Billing.Invoice i ORDER BY \"DateTime\" DESC"); page.Invoices.Data = invoices; return page; }); Handle.GET("/billing/invoices/{?}", (string ObjectID) => { var page = new InvoicePage() { Html = "/billing-invoice.html" }; page.Transaction = new Transaction(); //page.Session = Session.Current; var invoice = SQL<Billing.Invoice>("SELECT i FROM Billing.Invoice i WHERE ObjectID = ?", ObjectID); page.Invoice.Data = invoice.First; return page; }); }
static void SelectDayFromDate(IWebDriver driver, int day) { Click.Element(driver, OrdersPage.FromDateDaySelector($"{day}")); // eg 9 }
static void SelectMonthFromDate(IWebDriver driver, string month) { Click.Element(driver, OrdersPage.FromDateMonthYearSelector(month)); // eg Nov }
static void SelectYearFromDate(IWebDriver driver, string year) { Click.Element(driver, OrdersPage.FromDateMonthYearSelector(year)); // eg 2010 }