Пример #1
0
        public void ShippingAddressAdditionPositiveTest()
        {
            TestDataHandler dataHandler = new TestDataHandler(@".\ShippingAddressTestData");

            dataHandler.WriteTestData();

            ChromeOptions options = new ChromeOptions();

            options.PageLoadStrategy = PageLoadStrategy.None; // PageLoadStrategy.Eager not supported by Chrome

            using (ChromeDriver driver = new ChromeDriver(Directory.GetCurrentDirectory(), options))
            {
                driver.Manage().Window.Maximize();
                IWait <IWebDriver> wait = new WebDriverWait(driver, TimeSpan.FromSeconds(30));

                AliExpressHomePage homePage = new AliExpressHomePage(driver, wait);
                homePage.NavigateToAliExpressHomepage();
                homePage.LoginToAliExpress(dataHandler.ReadLoginData());
                MyOrdersPage        myOrdersPage        = homePage.NavigateToMyOrdersPage();
                ShippingAddressPage shippingAddressPage = myOrdersPage.OpenShippingAddressPage();

                Address adr = dataHandler.ReadAddressData();
                shippingAddressPage.AddNewShippingAddress();
                shippingAddressPage.FillShippingAddressForm(adr);
                shippingAddressPage.ShippingAddressFormSave();
                Assert.True(shippingAddressPage.IsAddressPresent(adr));
            }
        }
Пример #2
0
        public void Test1()
        {
            Helpers helper = new Helpers(driver);

            helper.NavigateToAliExpressHomepage();
            Thread.Sleep(5000); // why this works only here
            helper.LoginToAliExpress();

            // TODO: change this to JSON or random generation
            Address adr;

            adr.contactName         = "John Doe";
            adr.countryRegion       = "United States";
            adr.streetAddress       = "10 Test Ave";
            adr.apartment           = "15";
            adr.stateProvinceRegion = "New York";
            adr.city = "New york";
            adr.zip  = "11221";
            adr.mobileNoCountryCode = "+1";
            adr.mobileNumber        = "5417543111";

            ShippingAddressPage shippingAddressPage = new ShippingAddressPage(driver);

            shippingAddressPage.FillShippingAddressForm(adr);
            Assert.True(shippingAddressPage.IsAddressPresent(adr));
        }