def test030_Category_Name(self): FunctionCommon.smartsearch(self,"Ignition") Mutil_Selection.Products_ViewDetail(self) Verification.Verify_Category(self,"Ignition") AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") AddCart.CheckOut(self)
def test022_Brand_Name(self): FunctionCommon.smartsearch(self,"Extang") Mutil_Selection.Products_ViewDetail(self) Verification.Verify_Brand(self,"Extang") AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") AddCart.CheckOut(self)
def test012_Prod_SKU(self): FunctionCommon.smartsearch(self,"82016") Mutil_Selection.Products_ViewDetail(self) Verification.Verify_SKU(self,"82016") AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") AddCart.CheckOut(self)
def setUp(self): self.verificationErrors = [] self.selenium = selenium("localhost", 4444, "*firefox3 E:/Program Files/Mozilla Firefox/firefox.exe", "http://www.lofinc.net/login/account") sel=self.selenium sel.start() sel.set_timeout("0") sel.open("/") # Login for i in range(0, 30): if sel.is_element_present("login_email") == True: sel.type("login_email","*****@*****.**") sel.type("login_pass","123456") sel.click("LoginButton") break else : time.sleep(1) PublicFunctions.my_wait_text_present(self, "Quick Search") # If YMM have values, clean them. IsClean = True if sel.is_element_present("//span[@id='side_selected_year']/label") == True: IsClean = False elif sel.is_element_present("//span[@id='side_selected_make']/label") == True: IsClean = False elif sel.is_element_present("//span[@id='side_selected_model']/label") == True: IsClean = False if IsClean == False: FunctionCommon.Clear(self,"all")
def test030_MoreProd(self): Mutil_Selection.Make(self,"FORD") Mutil_Selection.Categories_QP(self,"Bed Mats") FunctionCommon.Browser(self) Mutil_Selection.SubCategories_Link(self,"category/68/subcategory/636/make/ford") Mutil_Selection.ProdList_AddToCart(self, "1") PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") AddCart.CheckOut(self)
def test032_MoreProd(self): Mutil_Selection.Year(self,"2005") Mutil_Selection.Brand(self,"Extang") FunctionCommon.Browser(self) Mutil_Selection.Series_options(self,"Extang EXPRESS Universal Tailgate Seal") Mutil_Selection.ProdList_AddToCart(self, "4") PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") AddCart.CheckOut(self)
def test031_MoreProd(self): Mutil_Selection.Year(self,"2006") Mutil_Selection.Make(self,"DODGE") Mutil_Selection.Categories_QP(self,"Nerf Bars") FunctionCommon.Browser(self) Mutil_Selection.SubCategories_Link(self,"category/57/subcategory/728/year/2006/make/dodge") Mutil_Selection.ProdList_AddToCart(self, "5") PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") AddCart.CheckOut(self)
def test021_MoreProd(self): Mutil_Selection.Year(self,"2009") Mutil_Selection.Brand(self,"K&N") FunctionCommon.Browser(self) Mutil_Selection.Series_options(self,"Air Filter Accessories") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") AddCart.UpdateQty(self,"3") AddCart.CheckOut(self)
def test020_MoreProd(self): Mutil_Selection.Make(self,"HONDA") Mutil_Selection.Categories_QP(self,"Mufflers") FunctionCommon.Browser(self) Mutil_Selection.SubCategories_Link(self,"category/224/subcategory/421/make/honda") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") AddCart.UpdateQty(self,"3") AddCart.CheckOut(self)
def test010_TwoSubCategories(self): Mutil_Selection.Year(self,"2010") Mutil_Selection.Categories_QP(self,"Tonneau Covers") time.sleep(3) Mutil_Selection.Categories_QP(self,"Nerf Bars") FunctionCommon.Browser(self) Mutil_Selection.TwoSubCategories_select(self,"Truck Champ Drop Step","Snap Tonneau Covers") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") AddCart.CheckOut(self)
def test022_TwoSeries(self): Mutil_Selection.Year(self,"2007") Mutil_Selection.Brand(self,"K&N") time.sleep(3) Mutil_Selection.Brand(self,"Lund") FunctionCommon.Browser(self) Mutil_Selection.TwoSeries_select(self,"//div[@id='subcatleftcolumn']/img","//div[5]/li[1]/div[1]/img") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") AddCart.CheckOut(self)
def test011_TwoSubCategories(self): Mutil_Selection.Make(self,"TOYOTA") Mutil_Selection.Categories_QP(self,"Bed Mats") time.sleep(3) Mutil_Selection.Categories_QP(self,"Oil Filters") FunctionCommon.Browser(self) Mutil_Selection.TwoSubCategories_select(self,"Universal Oil Filters","Harley Davidson Bed Mat") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") AddCart.CheckOut(self)
def test020_TwoSeries(self): Mutil_Selection.Year(self,"2010") Mutil_Selection.Brand(self,"Advantage") time.sleep(3) Mutil_Selection.Brand(self,"AEM") FunctionCommon.Browser(self) Mutil_Selection.TwoSeries_select(self,"//li[2]/div[1]/img","//div[2]/li[1]/div[1]/img") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") AddCart.CheckOut(self)
def test012_TwoSubCategories(self): Mutil_Selection.Year(self,"2009") Mutil_Selection.Categories_QP(self,"Fender Flares") time.sleep(3) Mutil_Selection.Categories_QP(self,"Gauges") FunctionCommon.Browser(self) Mutil_Selection.TwoSubCategories_select(self,"Edge Gauge","Extended Fender Flares") time.sleep(5) Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") AddCart.CheckOut(self)
def test110_Brand_BestInAUTO_3rdBrakeLights(self): Mutil_Selection.Year(self, "2009") Mutil_Selection.Make(self, "GMC") Mutil_Selection.Brand(self, "BestInAUTO") FunctionCommon.Browser(self) Mutil_Selection.SubCategories_Link(self, "brand/83/series/555/year/2009/make/gmc") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self, "Your Shopping Cart") AddCart.CheckOut(self) PublicFunctions.my_wait_text_present(self, "Express Checkout") Payment.Step1_ProceedCheckOut(self, False) Payment.Step3_ShippingMethod(self) Payment.Step4_OrderConfirm(self)
def test010_Cat_AirFilter_AirFilters(self): Mutil_Selection.Year(self, "2010") Mutil_Selection.Make(self, "FORD") Mutil_Selection.Categories_QP(self, "Air Filter") FunctionCommon.Browser(self) Mutil_Selection.SubCategories_Link(self, "category/15/subcategory/587/year/2010/make/ford") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self, "Your Shopping Cart") AddCart.CheckOut(self) PublicFunctions.my_wait_text_present(self, "Express Checkout") Payment.Step1_ProceedCheckOut(self, False) Payment.Step3_ShippingMethod(self) Payment.Step4_OrderConfirm(self)
def test031_Cat_TonneauCovers_ToolBox(self): Mutil_Selection.Year(self, "2009") Mutil_Selection.Make(self, "GMC") Mutil_Selection.Categories_QP(self, "Tonneau Covers") FunctionCommon.Browser(self) Mutil_Selection.SubCategories_Link(self, "category/4/subcategory/99/year/2009/make/gmc") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self, "Your Shopping Cart") AddCart.CheckOut(self) PublicFunctions.my_wait_text_present(self, "Express Checkout") Payment.Step1_ProceedCheckOut(self, False) Payment.Step3_ShippingMethod(self) Payment.Step4_OrderConfirm(self)
def test021_Cat_NerfBars_3WWRoundTube(self): Mutil_Selection.Year(self, "2009") Mutil_Selection.Make(self, "FORD") Mutil_Selection.Categories_QP(self, "Nerf Bars") FunctionCommon.Browser(self) Mutil_Selection.SubCategories_Link(self, "category/57/subcategory/257/year/2009/make/ford") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self, "Your Shopping Cart") AddCart.CheckOut(self) PublicFunctions.my_wait_text_present(self, "Express Checkout") Payment.Step1_ProceedCheckOut(self, False) Payment.Step3_ShippingMethod(self) Payment.Step4_OrderConfirm(self)
def test111_Brand_BestInAUTO_ValveStemExtensions(self): Mutil_Selection.Year(self, "2010") Mutil_Selection.Make(self, "FORD") Mutil_Selection.Brand(self, "BestInAUTO") time.sleep(3) FunctionCommon.Browser(self) Mutil_Selection.SubCategories_Link(self, "brand/83/series/531/year/2010/make/ford") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self, "Your Shopping Cart") AddCart.CheckOut(self) PublicFunctions.my_wait_text_present(self, "Express Checkout") Payment.Step1_ProceedCheckOut(self, False) Payment.Step3_ShippingMethod(self) Payment.Step4_OrderConfirm(self)
def test120_Brand_TruckChamp_StainlessSteelBullBars(self): Mutil_Selection.Year(self, "2009") Mutil_Selection.Make(self, "GMC") Mutil_Selection.Brand(self, "Truck Champ") time.sleep(3) FunctionCommon.Browser(self) Mutil_Selection.SubCategories_Link(self, "brand/7/series/42/year/2009/make/gmc") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self, "Your Shopping Cart") AddCart.CheckOut(self) PublicFunctions.my_wait_text_present(self, "Express Checkout") Payment.Step1_ProceedCheckOut(self, False) Payment.Step3_ShippingMethod(self) Payment.Step4_OrderConfirm(self)
def test121_Brand_TruckChamp_TCDropSteps(self): Mutil_Selection.Year(self, "2008") Mutil_Selection.Make(self, "CHEVROLET") Mutil_Selection.Brand(self, "Truck Champ") time.sleep(3) FunctionCommon.Browser(self) Mutil_Selection.SubCategories_Link(self, "brand/7/series/535/year/2008/make/chevrolet") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self, "Your Shopping Cart") AddCart.CheckOut(self) PublicFunctions.my_wait_text_present(self, "Express Checkout") Payment.Step1_ProceedCheckOut(self, False) Payment.Step3_ShippingMethod(self) Payment.Step4_OrderConfirm(self)
def test011_Cat_AitFilter_UniversalAirFitlerCleaner(self): Mutil_Selection.Year(self, "2009") Mutil_Selection.Make(self, "GMC") Mutil_Selection.Categories_QP(self, "Air Filter") ## time.sleep(3) FunctionCommon.Browser(self) Mutil_Selection.SubCategories_Link(self, "category/15/subcategory/380/year/2009/make/gmc") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self, "Your Shopping Cart") AddCart.CheckOut(self) PublicFunctions.my_wait_text_present(self, "Express Checkout") Payment.Step1_ProceedCheckOut(self, False) Payment.Step3_ShippingMethod(self) Payment.Step4_OrderConfirm(self)
def CheckOut(self): PublicFunctions.my_wait_title(self,"Click here to proceed to checkout") time.sleep(5) sel = self.selenium sel.click("//img[contains(@src, 'images/blue/CheckoutButton.gif') and @alt='']") time.sleep(5) for i in range(0, 8): if sel.get_title().find("Express Checkout")<0 or sel.is_element_present("//input[@value='Continue shopping']"):break else : time.sleep(1) if sel.is_element_present("//input[@value='Continue shopping']"): sel.click("//input[@value='Checkout']") PublicFunctions.my_wait_text_present(self,"Express Checkout")
def test010_MoreProd(self): Mutil_Selection.Year(self,"2010") Mutil_Selection.Categories_QP(self,"Tonneau Covers") FunctionCommon.Browser(self) Mutil_Selection.SubCategories_Link(self,"category/4/subcategory/6/year/2010") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") ## Go back homepage and clean all self.selenium.click("//div[@id='TopMenu']/ul/li[2]/a/span") PublicFunctions.my_wait_text_present(self, "Quick Search") FunctionCommon.Clear(self) ## Add another product Mutil_Selection.Year(self,"2010") Mutil_Selection.Brand(self,"Advantage") FunctionCommon.Browser(self) Mutil_Selection.Series_options(self,"Advantage Sure-Fit") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") AddCart.CheckOut(self)
def test012_MoreProd(self): Mutil_Selection.Year(self,"2007") Mutil_Selection.Make(self,"TOYOTA") Mutil_Selection.Categories_QP(self,"Bed Mats") FunctionCommon.Browser(self) Mutil_Selection.SubCategories_Link(self,"category/68/subcategory/675/year/2007/make/toyota") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") ## Go back homepage and clean all self.selenium.click("//div[@id='TopMenu']/ul/li[2]/a/span") time.sleep(8) PublicFunctions.my_wait_text_present(self, "Quick Search") FunctionCommon.Clear(self) ## Add another product Mutil_Selection.Year(self,"2007") Mutil_Selection.Make(self,"NISSAN") Mutil_Selection.Brand(self,"Edge") FunctionCommon.Browser(self) Mutil_Selection.Series_options(self,"Edge Plug-In") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") AddCart.CheckOut(self)
def test011_MoreProd(self): Mutil_Selection.Year(self,"2005") Mutil_Selection.Make(self,"CHEVROLET") Mutil_Selection.Brand(self,"AEM") FunctionCommon.Browser(self) Mutil_Selection.Series_options(self,"AEM Analog Guage") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") ## Go back homepage and clean all self.selenium.click("//div[@id='TopMenu']/ul/li[2]/a/span") time.sleep(8) PublicFunctions.my_wait_text_present(self, "Quick Search") FunctionCommon.Clear(self) ## Add another product time.sleep(5) Mutil_Selection.Year(self,"2007") Mutil_Selection.Categories_QP(self,"Oil Filters") FunctionCommon.Browser(self) Mutil_Selection.SubCategories_Link(self,"category/19/subcategory/419/year/2007") Mutil_Selection.Products_ViewDetail(self) AddCart.AddCart(self) PublicFunctions.my_wait_text_present(self,"Your Shopping Cart") AddCart.CheckOut(self)