def locate_a_store(location): """steps for find a store by city zipcode. @param : instance of browser to automate @param location: location of "Find a retailer" link on page. """ sel = selenium if location == "tab" or location == "header": wait_element("xpath=//*[@id='header-links']//a[.='find a retailer']") sel.click("xpath=//*[@id='header-links']//a[.='find a retailer']") elif location == 'footer': wait_element("xpath=//div[@id='ag-interest-products']//a[.='Find a Retailer']") sel.click("xpath=//div[@id='ag-interest-products']//a[.='Find a Retailer']") wait_element("id=storelocator_zip") sel.click("id=storelocator_zip") sel.type("id=storelocator_zip", zip_code()) verify_element_text(zip_code(), "id=storelocator_zip") sel.click("id=storelocator_go") sel.wait_for_page_to_load("60000") verify_element_text("WALMART", "xpath=//*[@id='results-list']/li[1]/a/h2")
def pof(credit_card_type): """ Validate the change payment information functionality of AG intractive site. @param : instance of browser to automate @param credit_card_type: It's shortform of credit card name. """ sel = selenium card_security_code = "187" # Updating payment information. wait_element("name=_cc_name") sel.click("name=_cc_name") sel.type("name=_cc_name", "TestMastercard") verify_element_text("TestMastercard", "name=_cc_name") sel.click("name=_cc_num") sel.type("name=_cc_num", credit(credit_card_type)) verify_element_text(credit(credit_card_type), "name=_cc_num") sel.click("name=_cvv2") sel.type("name=_cvv2", card_security_code) verify_element_text(card_security_code, "name=_cvv2") sel.click("id=agi-update") sel.wait_for_page_to_load("90000") verify_text("You have successfully changed your payment information")