public AddInvoiceWithTwoRateSteps(ScenarioContext scenarioContext) { _webDriver = scenarioContext["WEB_DRIVER"] as IWebDriver; invoiceModel = new InvoiceModel(_webDriver); invoicePage = new InvoicePage(_webDriver); homePage = new HomePage(_webDriver); projectPage = new ProjectPage(_webDriver); authenticatePage = new AuthenticatePage(_webDriver); }
public void ThenInvoicePageWithCorrectDataIsDisplayed(Table table) { InvoicePage invoicePage = new InvoicePage(driver); var depositNow = table.Rows[0]["DepositNow"]; var taxAndVat = table.Rows[0]["Tax&VAT"]; var TotalAmount = table.Rows[0]["TotalAmount"]; var depositActual = invoicePage.InvoiceData("Deposit Now", depositNow).Text; var taxAndVatActual = invoicePage.InvoiceData("Tax & VAT", taxAndVat).Text; var TotalAmountActual = invoicePage.InvoiceData("Total Amount", TotalAmount).Text; Assert.IsTrue(depositActual.Contains(depositNow), "Incorrect value is displayed. It should be {0} instead of {1}", depositNow, depositActual); Assert.IsTrue(taxAndVatActual.Contains(taxAndVat), "Incorrect value is displayed. It should be {0} instead of {1}", taxAndVat, taxAndVatActual); Assert.IsTrue(TotalAmountActual.Contains(TotalAmount), "Incorrect value is displayed. It should be {0} instead of {1}", TotalAmount, TotalAmountActual); }
private void InvoicePageBtn(object sender, RoutedEventArgs e) { InvoicePage page = new InvoicePage(); this.NavigationService.Navigate(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; }); }
// GET: Invoice public ActionResult Index(InvoicePage page) { return(View(page)); }