コード例 #1
0
        public void OrderEntry_NSANet_US()
        {
            Driver.WebDriver.Navigate().GoToUrl(Driver.GetUrl("NSANet"));
            LoginPage.Login("autodevsvcacct", "Juiceplus123");
            MainPage.NavigateToOrderEntry();
            OrderEntryPage.InitiateNewOrder("USA", "USM0025620");
            OrderEntryPage.InputDeliveryAddressInformation("Test Tester", "140 Crescent Dr.", "38017", "Collierville", "9018503000", "9018503000", "*****@*****.**", "UPS - Ground");
            OrderEntryPage.InputProductIformation("2000", "RO", "1");
            OrderEntryPage.InputPaymentType("Visa", "4242424242424242", "12", "2025");
            OrderEntryPage.FinishOrderEntry();

            var SuccessMessageRegex = new Regex(@"USO\d{5,9}");

            if (SuccessMessageRegex.Matches(Driver.WebDriver.PageSource).Count > 0)
            {
                Console.Write("Sales Order ID: " + SuccessMessageRegex.Matches(Driver.WebDriver.PageSource)[0].Value);
            }
            Thread.Sleep(5000);
            Assert.IsTrue(SuccessMessageRegex.Matches(Driver.WebDriver.PageSource).Count > 0);
            Assert.IsTrue(Driver.WebDriver.PageSource.Contains("Transaction Completed Successfully") || Driver.WebDriver.PageSource.Contains("Order Added"));
            Thread.Sleep(5000);
            Driver.Pause();
        }