コード例 #1
0
        public static void FormInvoke()
        {
            //File.AppendAllText(@"E:\Orbit\Hello.txt.txt", "VinayForm" + DateTime.Now.ToString("yyyyMMddHHmmss"));

            //DateTime.Now.ToString("yyyyMMddHHmmss"); // case sensitive
            // MessageBox.Show(DateTime.Now.ToString("MMddyyyy"));
            //string readText = File.ReadAllText(@"..\\..\\..\\ExecutionID.txt");

            string brwname          = ReadXmlData.GetAttributeTestDataValue("//Setting/Data[@Info='Browser']");
            string instance         = ReadXmlData.GetAttributeTestDataValue("//Setting/Data[@Info='Instance']");
            string timestamp        = ReadXmlData.GetAttributeTestDataValue("//Setting/Data[@Info='Timestamp']");
            string currentTimeStamp = DateTime.Now.ToString("yyyyMMdd");

            if (!string.IsNullOrEmpty(timestamp) && !string.IsNullOrEmpty(brwname) && !string.IsNullOrEmpty(instance))
            {
                if (!currentTimeStamp.Equals(timestamp))
                {
                    ExecutionStartUpForm form;
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(form = new ExecutionStartUpForm());
                    appShortName         = form.appShortName;
                    bName = form.browserName;
                }
            }
            else
            {
                ExecutionStartUpForm form;
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(form = new ExecutionStartUpForm());
                appShortName         = form.appShortName;
                bName = form.browserName;
            }
        }
コード例 #2
0
        public void GoTo()
        {
            // string Url = System.Configuration.ConfigurationManager.AppSettings[CommonBase.appShortName];
            string instance = ReadXmlData.GetAttributeTestDataValue("//Setting/Data[@Info='Instance']");
            string Url      = ReadXmlData.GetAttributeValue("//catalog/cd[@shortname='" + instance + "']/url");;

            Browser.Goto(Url);
            System.Threading.Thread.Sleep(5000);
            Browser.MaximizeBrowserPage();
        }
コード例 #3
0
        // private ILog Log = CommonBase.Log;
        public void loginToApplication()
        {
            Invoice_Pages.HomePage.GoTo();
            string instance = ReadXmlData.GetAttributeTestDataValue("//Setting/Data[@Info='Instance']");

            Invoice_Pages.HomePage.Login(ConfigurationManager.AppSettings.Get(AppConfigKeys.Username));
            Invoice_Pages.HomePage.Password(ConfigurationManager.AppSettings.Get(AppConfigKeys.Password));

            Invoice_Pages.HomePage.LoginButton();
            //Log.Info("logged in successfully");
        }
コード例 #4
0
        public void loginToApplication()
        {
            AccountPayablesPages.HomePage.GoTo();
            string instance = ReadXmlData.GetAttributeTestDataValue("//Setting/Data[@Info='Instance']");

            AccountPayablesPages.HomePage.Login(ReadXmlData.GetAttributeValue("//catalog/cd[@shortname='" + instance + "']/username"));
            AccountPayablesPages.HomePage.Password(ReadXmlData.GetAttributeValue("//catalog/cd[@shortname='" + instance + "']/password"));

            AccountPayablesPages.HomePage.LoginButton();
            Log.Info("logged in successfully");
        }
コード例 #5
0
        public void CreateInvoice_Test(Dictionary <string, string> data)
        {
            Log.Info("Started scenario  execution");


            if (!DataUtil.isTestRunnable(xls, testName) || data["Runmode"].Equals("N"))
            {
                Assert.Ignore("the scenario is Ignored from the current exdcution ");
            }
            string brwname = ReadXmlData.GetAttributeTestDataValue("//Setting/Data[@Info='Browser']");

            Browser.GetDriver(brwname);
            // SeleniumTests.OracleTestBase.Singleton.GetInstance().Show();
            //Arrange (data)
            Random rnd      = new Random();
            int    rnd_num  = rnd.Next(1000, 2000);
            string LastName = "TestUser" + rnd_num;


            // Arrange(modules)
            InvoiceCreationModule invoice = new InvoiceCreationModule();

            //Act

            /*
             * login to application
             *
             */

            Log.Info("login to application");
            invoice.loginToApplication();

            /*
             * Entering Invoice page
             */
            invoice.InvoicPage();

            invoice.InvoicWorknenchNav();

            //Assert
            Log.Info("Verification Employee Creation");
            //Assert.IsTrue(invoice.verificationEmployeeCreation(LastName), "Employeee created successful, pleas check!!");


            /*
             * logout from application
             */
            invoice.logoutFromApplication();
        }
コード例 #6
0
        public void Create_Supplier(Dictionary <string, string> data)
        {
            if (!DataUtil.isTestRunnable(xls, testName) || data["Runmode"].Equals("N"))
            {
                Assert.Ignore("the scenario is Ignored from the current exdcution ");
            }
            string brwname = ReadXmlData.GetAttributeTestDataValue("//Setting/Data[@Info='Browser']");

            Browser.GetDriver(brwname);
            //Arrange(Module)CreateSupplierModule
            CreateSupplierModule supplierCreation = new CreateSupplierModule();

            supplierCreation.loginToApplication();
            supplierCreation.Navigation_Details();
            supplierCreation.CreateSupplier("Supplier" + GetRandomNumber(), data["BusinessRelationship"], data["TaxOrganizationType"], data["SupplierType"]);

            supplierCreation.AddressCreation(data["Address"], data["CountryName"], data["AddressLine1"], data["Pincode"]);
            supplierCreation.SiteCreation(data["Procurement"]);
            //supplierCreation.TransactionTax();
            supplierCreation.SiteAssignment(data["Client"]);
            supplierCreation.ContactDetails(data["FirstName"], data["LastName"]);
        }
コード例 #7
0
        public void HR_Hire_an_Employee_Test(Dictionary <string, string> data)
        {
            Log.Info("Started scenario  execution");


            if (!DataUtil.isTestRunnable(xls, testName) || data["Runmode"].Equals("N"))
            {
                Assert.Ignore("the scenario is Ignored from the current exdcution ");
            }
            string brwname = ReadXmlData.GetAttributeTestDataValue("//Setting/Data[@Info='Browser']");

            Browser.GetDriver(brwname);
            // SeleniumTests.OracleTestBase.Singleton.GetInstance().Show();
            //Arrange (data)
            Random rnd      = new Random();
            int    rnd_num  = rnd.Next(1000, 2000);
            string LastName = "TestUser" + rnd_num;


            // Arrange(modules)
            EmployeeCreationModule employee = new EmployeeCreationModule();

            //Act

            /*
             * login to application
             *
             */

            Log.Info("login to application");
            employee.loginToApplication();

            /*
             * Entering Identification Details
             */

            Log.Info("Entering Identification details");
            employee.Identification_details(data["LegalEmployer"], LastName);

            /*
             * Entering PersonInformation Details
             */
            Log.Info("Entering PersonInformation details");
            employee.PersonInformation_details(data["AddressLine1"], data["Zipcode"]);

            /*
             * Entering EmployementInformation Details
             */
            Log.Info("Entering EmployementInformation details");
            employee.EmployementInformation_Details(data["BusinessUnit"]);

            /*
             * Business validation - verifying whether Employee has created successfully or not
             * Expected Result: Employee should create successfully
             */
            Log.Info("Entering SearchPersonName");
            employee.SearchPersonName(LastName);


            //Assert
            Log.Info("Verification Employee Creation");
            // Assert.IsTrue(employee.verificationEmployeeCreation(LastName), "Employeee created successful, pleas check!!");

            /*
             * Fluent Assertions
             */
            CoreHR_Pages.SearchPerson.getEmployeeName().Should().StartWith(LastName);

            /*
             * logout from application
             */
            employee.logoutFromApplication();
        }
コード例 #8
0
 private void Awake()
 {
     _instance = this;
     //  LoadXmlData();
 }