예제 #1
0
        public void DeleteInvoice(TestData data, string invoiceId)
        {
            Log.Information("In DeleteInvoice...");

            WaitForProgressToComplete(10);
            HoverElement(AddInvoiceBtn); // Workaround

            TestDataSheet      invoiceSheet    = data.Get("Invoice");
            List <TestDataRow> invoiceDataRows = invoiceSheet.FilterRows("InvoiceId=" + invoiceId);
            TestDataRow        invoiceData     = invoiceDataRows[0];

            // To get data from table
            DataTable dt = GetElement(InvoicesTable).GetTableData();

            foreach (DataRow dr in dt.Rows)
            {
                foreach (DataColumn dc in dt.Columns)
                {
                    Log.Information(dr[dc].ToString());
                }
            }

            /* To delete an invoice
             * var searchCriteria = String.Format("Inv Num={0}", invoiceData.Value("InvoiceNum"));
             * GetElement(InvoicesTable).GetTableCell("Actions", searchCriteria).GetElement(DeleteInv).ClickIt();
             * GetElement(OkButton).ClickIt();*/
            Log.Information("End of DeleteInvoice");
        }
예제 #2
0
 public void AddClientProjects(TestDataSheet clientData)
 {
     Log.Information("AddClientProjects...Start");
     WaitForProgressToComplete();
     GetElement(OthersTab).ClickIt();
     GetElement(ProjectsAccordion).ClickIt();
     WaitForProgressToComplete(10);
     foreach (TestDataRow dataRow in clientData.FilterRows())
     {
         GetElement(AddProjectLink).ClickIt();
         Project project = new Project(this.DriverManager);
         project.CreateNewProject(clientData);
     }
     Log.Information("AddClientProjects...End");
 }
예제 #3
0
        public void EditInvoice(TestData data, string invoiceId)
        {
            Log.Information("In EditInvoice...");

            WaitForProgressToComplete(10);
            HoverElement(AddInvoiceBtn); // Workaround

            TestDataSheet      invoiceSheet    = data.Get("Invoice");
            List <TestDataRow> invoiceDataRows = invoiceSheet.FilterRows("InvoiceId=" + invoiceId);
            TestDataRow        invoiceData     = invoiceDataRows[0];

            GetElement(InvoicesAccordion).ClickIt();
            var searchCriteria = String.Format("Inv Num={0}", invoiceData.Value("InvoiceNum"));

            GetElement(InvoicesTable).GetTableCell("Actions", searchCriteria).GetElement(EditInv).ClickIt();
            //GetElement(OkButton).ClickIt();
            GetElement(DiscountValue).EnterText("15", Keys.Tab);
            GetElement(Save).ClickIt();

            Log.Information("End of EditInvoice");
        }
예제 #4
0
 public void AddClientContacts(TestDataSheet clientData)
 {
     Log.Information("AddClientContact...Start");
     WaitForProgressToComplete();
     GetElement(OthersTab).ClickIt();
     GetElement(ContactsAccordion).ClickIt();
     foreach (TestDataRow dataRow in clientData.FilterRows())
     {
         GetElement(AddContactLink).ClickIt();
         WaitForProgressToComplete(10);
         GetElement(ContactType).EnterText(dataRow.Value("ContactType"));
         WaitForProgressToComplete();
         GetElement(ContactEmail).EnterText(dataRow.Value("ContactEmail"));
         GetElement(ContactType).EnterText(dataRow.Value("ContactType")); // Bug
         WaitForProgressToComplete();
         GetElement(ContactFirstName).ClickIt();
         WaitForProgressToComplete(5);
         GetElement(ContactFirstName).EnterText(dataRow.Value("ContactFirstName"));
         WaitForProgressToComplete();
         GetElement(ContactLastName).EnterText(dataRow.Value("ContactLastName"));
         GetElement(ContactSave).ClickIt();
     }
     Log.Information("AddClientContact...End");
 }
예제 #5
0
        public void AddInvoice(TestData data, String invoiceId)
        {
            Log.Information("In AddInvoice()...start");
            TestDataSheet      invoiceSheet    = data.Get("Invoice");
            List <TestDataRow> invoiceDataRows = invoiceSheet.FilterRows("InvoiceId=" + invoiceId);
            TestDataRow        invoiceData     = invoiceDataRows[0];

            WaitForProgressToComplete(5);
            GetElement(InvoiceNum).EnterText(invoiceData.Value("InvoiceNum"));
            GetElement(Client).SelectComboValue(invoiceData.Value("Client"));
            GetElement(Project).SelectComboValue(invoiceData.Value("Project"));
            GetElement(Employee).SelectComboValue(invoiceData.Value("Employee"));
            //GetElement(PaymentTerms).SelectComboValue(invoiceData.Value("PaymentTerms"));
            WaitForProgressToComplete(5);
            //GetElement(InvoiceDate).EnterText(invoiceData.Value("InvoiceDate"));
            //GetElement(InvoiceDueDate).EnterText(invoiceData.Value("InvoiceDueDate"));
            GetElement(StartDate).EnterText(invoiceData.Value("StartDate"));
            GetElement(EndDate).EnterText(invoiceData.Value("EndDate"));
            GetElement(EndDate).SendKeys(Keys.Tab);

            WaitForProgressToComplete(5);

            /*if (IsElementPresent(AlertOkBtn)) // workaround
             *  GetElement(AlertOkBtn).ClickIt();*/

            GetInlineSwitchElement("Apply Discount", invoiceData.Value("ApplyDiscount")).ClickIt();

            List <TestDataRow> othRows = data.Get("OtherCharges").FilterRows("InvoiceId=" + invoiceId);

            AddOtherCharges(othRows);

            List <TestDataRow> dedRows = data.Get("Deductions").FilterRows("InvoiceId=" + invoiceId);

            AddDeductions(dedRows);

            GetElement(DiscountValue).EnterText(invoiceData.Value("DiscountValue"), Keys.Tab);

            //GetElement(Tax1).EnterText(invoiceData.Value("Tax1"));
            //GetElement(Tax2).EnterText(invoiceData.Value("Tax2"));
            //GetElement(Tax2).SendKeys(Keys.Tab);

            var otherChargesGrandTotal = GetElement(OtherChargesGrandTotal).GetText();

            otherChargesGrandTotal.ShouldBe(invoiceData.Value("OtherChargesGrandTotal"));

            var deductionsGrandTotal = GetElement(DeductionsGrandTotal).GetText();

            deductionsGrandTotal.ShouldBe(invoiceData.Value("DeductionsGrandTotal"));

            //var totalValue = GetElement(Total).GetText();
            //totalValue.ShouldBe(invoiceData.Value("Total"));

            //var discountApplied = GetElement(DiscountApplied).GetText();
            //discountApplied.ShouldBe(invoiceData.Value("DiscountApplied"));

            //var grandTotal = GetElement(GrandTotal).GetText();
            //grandTotal.ShouldBe(invoiceData.Value("GrandTotal"));

            GetElement(Save).ClickIt();

            //if (IsElementPresent(AlertOkBtn))
            //    GetElement(AlertOkBtn).ClickIt();

            Log.Information("In AddInvoice()...end");
        }