예제 #1
0
        public void CreateNewReportWithNoExpenses()
        {
            string reportName = "Evolve 2014 Expenses";

            new ReportsPage(app, platform).BeginNewReport();

            var reportDetailPage = new ReportDetailPage(app, platform);

            reportDetailPage.EnterNewReportName(reportName);
            reportDetailPage.PressSaveReportButton();

            var token = app.Invoke("getReportName:", reportName).ToString();

            Assert.AreEqual(reportName, token);
            Assert.AreEqual(1, app.Query(x => x.Marked("reportsPage")).Length);
        }
예제 #2
0
        public void CreateNewReportWithExpenses()
        {
            app.Invoke("addPhotosToGallery:", "");

            string reportName = "Evolve 2014 Expenses";

            new ReportsPage(app, platform).BeginNewReport();

            var reportDetailPage = new ReportDetailPage(app, platform);

            reportDetailPage.EnterNewReportName(reportName);
            reportDetailPage.AddExpenseToReport();

            var newExpenseReportPage = new ExpenseActionPage(app, platform);

            newExpenseReportPage.EnterExpenseName("Evolve Expense 1");
            newExpenseReportPage.ChangeExpensePrice(5.56);
            //Figure out how to change date
            newExpenseReportPage.EnterShortDescription("Evolve was so much fun!!");

            var date = DateTime.Now.Subtract(TimeSpan.FromDays(40));

            newExpenseReportPage.ChangeExpenseDate(date);
            newExpenseReportPage.PickReceiptForExpense();
            newExpenseReportPage.PressSaveExpenseButton();

            reportDetailPage.AddExpenseToReport();

            newExpenseReportPage.EnterExpenseName("Evolve Expense 2");
            newExpenseReportPage.ChangeExpensePrice(105234.35);
            //Figure out how to change date
            newExpenseReportPage.EnterShortDescription("Evolve was so much fun!!");
            newExpenseReportPage.PickReceiptForExpense();
            newExpenseReportPage.PressSaveExpenseButton();

            reportDetailPage.PressSaveReportButton();

            var reportNameFromDatabase = app.Invoke("getReportName:", reportName);

            Assert.AreEqual(reportName, reportNameFromDatabase.ToString());

            var expenseCount = app.Invoke("getReportExpensesCount:", reportName);

            Assert.AreEqual("2", expenseCount.ToString());
        }