def class_setup(self): self.ts = TestStatus(self.driver) self.lp = LoginPage(self.driver) self.nav = NavigatePage(self.driver) self.sup_info_fev = FindExistingValuePage(self.driver) self.sup_info_anv = SupplierInformationANV(self.driver) self.summary = SummaryPage(self.driver) self.id_info = IdentifyingInformationPage(self.driver) self.addr = AddressPage(self.driver) self.loc = LocationPage(self.driver) self.procurement = ProcurementOptionsWindow(self.driver)
def class_setup(self): self.ts = TestStatus(self.driver) self.lp = LoginPage(self.driver) self.nav = NavigatePage(self.driver) self.sup_info_fev = FindExistingValuePage(self.driver) self.sup_info_anv = SupplierInformationANV(self.driver) self.summary = SummaryPage(self.driver) self.id_info = IdentifyingInformationPage(self.driver) self.addr = AddressPage(self.driver) self.clean_addr = CleanAddressPage(self.driver) self.loc = LocationPage(self.driver) self.payable_options = PayablesOptionsWindow(self.driver) self.procurement = ProcurementOptionsWindow(self.driver) self.sup_xref = SupplierXrefWindow(self.driver) self.preview = PreviewSupplierAuditWindow(self.driver)
def test6_sign_in_valid_account(self): self.sign_page.input_email_registered.input_text('[email protected]') self.sign_page.input_passwd.input_text('aaaaa') self.sign_page.btn_sign_in.click() self.address_page = AddressPage(driver=self.driver) assert self.address_page.page_heading.text == 'Addresses', 'Wrong page displayed'
def test2_submit_valid_form(self): # YOUR PERSONAL INFORMATION self.create_account_page.get_client_title_mr.click() self.create_account_page.get_client_first_name.input_text('John') self.create_account_page.get_client_lastName.input_text('John') #email row pre-filled self.create_account_page.get_client_passwd.input_text('12345') # date of bird # YOUR ADDRESS #self.create_account_page.get_firstName_field.input_text('John') #self.create_account_page.get_last_name_field.input_text('John') self.create_account_page.get_company_field.input_text('Company') self.create_account_page.get_address_field.input_text('Address') #self.create_account_page.get_address_second_field.text('Address') self.create_account_page.get_city_field.input_text('City') #state self.create_account_page.dropdown_state_field.option('Alabama') self.create_account_page.get_postalcode_field.input_text('10000') #country self.create_account_page.get_homephone_field.input_text('0700001221') self.create_account_page.get_mobilephone_field.input_text('0700000000') #self.create_account_page.get_address_alias_field.input_text('Address') self.create_account_page.btn_register.click() self.address_page = AddressPage(driver=self.driver) assert self.address_page.page_heading.text == 'Addresses', 'Wrong page header'
def test02(self): mysql_host = ReadExcelData().returnExcelData('data.xlsx', 'mysql', 0, 1) mysql_user = ReadExcelData().returnExcelData('data.xlsx', 'mysql', 1, 1) mysql_password = ReadExcelData().returnExcelData( 'data.xlsx', 'mysql', 2, 1) mysql_port = ReadExcelData().returnExcelData('data.xlsx', 'mysql', 3, 1) mysql_database = ReadExcelData().returnExcelData( 'data.xlsx', 'mysql', 4, 1) _sql1 = ReadExcelData().returnExcelData('data.xlsx', 'mysql', 6, 1) _sql2 = ReadExcelData().returnExcelData('data.xlsx', 'mysql', 7, 1) count = MysqlConnection().count_mysql(mysql_host, int(mysql_port), mysql_user, mysql_password, mysql_database, "utf8", _sql1) print count[0] time.sleep(3) if count[0] == 10: MysqlConnection().del_mysql(mysql_host, int(mysql_port), mysql_user, mysql_password, mysql_database, "utf8", _sql2) else: pass time.sleep(3) count = MysqlConnection().count_mysql(mysql_host, int(mysql_port), mysql_user, mysql_password, mysql_database, "utf8", _sql1) print count[0] mylogger.debug("开始新增地址") #点击新增 AddressPage().click_add_address_class().click() time.sleep(3) #输入收货人 add_name = ReadExcelData().returnExcelData('data.xlsx', 'address', 3, 1) AddressPage().click_add_name().send_keys(add_name) self.driver.implicitly_wait(5) mylogger.debug("输入收货人") #选择省 AddressPage().click_add_province().click() time.sleep(2) mylogger.debug("选择省") #选择市 AddressPage().click_add_city().click() time.sleep(2) mylogger.debug("选择市") #选择区 AddressPage().click_add_county().click() time.sleep(2) mylogger.debug("选择区") #S输入详细地址 add_address = ReadExcelData().returnExcelData('data.xlsx', 'address', 4, 1) AddressPage().click_add_detailaddress().send_keys(add_address) self.driver.implicitly_wait(5) mylogger.debug("输入详细地址") #输入手机号 add_mobile = ReadExcelData().returnExcelData('data.xlsx', 'address', 5, 1) AddressPage().click_add_mobile().send_keys(str(add_mobile)) self.driver.implicitly_wait(5) self.driver.implicitly_wait(5) mylogger.debug("输入手机号") #点击提交按钮 AddressPage().click_add_button().click() self.driver.implicitly_wait(5) mylogger.debug("点击提交按钮") #截屏 CommonDef().get_windows_img() # CreateConnectionMysql().connection_mysql(mysql_host,int(mysql_port),mysql_user,mysql_password,mysql_database,"utf8") # CreateConnectionMysql().cureors() #数据库游标 _sql = ReadExcelData().returnExcelData('data.xlsx', 'mysql', 5, 1) MysqlConnection().connection_mysql(mysql_host, int(mysql_port), mysql_user, mysql_password, mysql_database, "utf8", _sql)
class TestForeignBV(unittest.TestCase): @pytest.fixture(autouse=True) def class_setup(self): self.ts = TestStatus(self.driver) self.lp = LoginPage(self.driver) self.nav = NavigatePage(self.driver) self.sup_info_fev = FindExistingValuePage(self.driver) self.sup_info_anv = SupplierInformationANV(self.driver) self.summary = SummaryPage(self.driver) self.id_info = IdentifyingInformationPage(self.driver) self.addr = AddressPage(self.driver) self.clean_addr = CleanAddressPage(self.driver) self.loc = LocationPage(self.driver) self.procurement = ProcurementOptionsWindow(self.driver) self.sup_xref = SupplierXrefWindow(self.driver) @pytest.mark.run(order=1) @data((os.environ.get('PSFT_USER_ID'), "wrongpassword")) # @data(("AUTOTEST3", "wrongpassword")) @unpack def test_invalid_password(self, username, password): self.lp.login(username, password) result = self.lp.verify_login_failed() self.ts.mark(result, "Login Failed!") @pytest.mark.run(order=2) @data((os.environ.get('PSFT_USER_ID'), os.environ.get('PSFT_USER_PWD'))) # @data(("AUTOTEST3", "Psoft1234$")) @unpack def test_foreign_master_and_branch_vendor_creation(self, username, password): # Login into PeopleSoft with CREATOR credentials self.lp.login(username, password) result_1 = self.lp.verify_title() self.ts.mark(result_1, "Title is incorrect") self.nav.navigate_to_supplier_info() self.sup_info_fev.add_a_new_value() self.sup_info_anv.click_add_button() self.id_info.enter_identifying_info() """ FOREIGN CORPORATE INFO ADDRESS """ self.id_info.click_address_tab() self.clean_addr.clean_japanese_address() self.addr.enter_email_id() self.addr.enter_business_phone() self.addr.enter_fax() self.addr.enter_trilogie_dm_fax() # """ FOREIGN REMIT ADDRESS """ # self.addr.click_add_new_address_btn() # self.addr.enter_foreign_master_vendor_address("Remit", "GBR") # self.addr.enter_email_id() # self.addr.enter_business_phone() # self.addr.enter_fax() # """ FOREIGN TRILOGIE PO ADDRESS """ # self.addr.click_add_new_address_btn() # self.addr.enter_foreign_master_vendor_address("Trilogie PO Address", "GBR") # self.addr.enter_email_id() # self.addr.enter_business_phone() # self.addr.enter_fax() """ ADD LOCATIONS AND BRANCH VENDORS """ self.addr.click_location_tab() self.loc.add_location("MAIN", "Remit to Main") # Add Procurement Options self.loc.click_procurement_link() self.procurement.select_random_payment_terms_id() # Add Branch Vendor(s) self.loc.click_fei_trilogie_xref_link() self.sup_xref.select_random_account() """ SAVE RECORD """ self.loc.click_save_btn() self.loc.click_summary_tab() self.summary.get_supplier_id() self.summary.search_for_created_supplier() result2 = self.summary.verify_supplier_id_created() self.ts.mark(result2, "Successfully Created Foreign Master Vendor.") @pytest.mark.run(order=3) def test_sign_out(self): self.summary.sign_out_summary_page() result = self.lp.verify_title_of_log_out_page() self.ts.mark_final("Test Create Master and Branch Vendor", result, "Successfully Signed Out of Application.")
class TestCreateDomesticMV(unittest.TestCase): @pytest.fixture(autouse=True) def class_setup(self): self.ts = TestStatus(self.driver) self.lp = LoginPage(self.driver) self.nav = NavigatePage(self.driver) self.sup_info_fev = FindExistingValuePage(self.driver) self.sup_info_anv = SupplierInformationANV(self.driver) self.summary = SummaryPage(self.driver) self.id_info = IdentifyingInformationPage(self.driver) self.addr = AddressPage(self.driver) self.loc = LocationPage(self.driver) self.procurement = ProcurementOptionsWindow(self.driver) @pytest.mark.run(order=1) def test_invalid_password(self): self.lp.login("AUTOTEST3", "wrongpassword") result = self.lp.verify_login_failed() self.ts.mark(result, "Verified Login Failed!") @pytest.mark.run(order=2) def test_domestic_master_vendor_creation(self): # Login into PeopleSoft with CREATOR credentials self.lp.login("AUTOTEST3", "Psoft1234$") result_1 = self.lp.verify_title() self.ts.mark(result_1, "Title is incorrect") self.nav.navigate_to_supplier_info() self.sup_info_fev.add_a_new_value() self.sup_info_anv.click_add_button() self.id_info.enter_identifying_info("DNS") """ REMIT CleanAddressPage """ self.id_info.click_address_tab() self.addr.enter_domestic_master_vendor_address("REMIT", "Remit") self.addr.enter_business_phone() self.addr.enter_fax() """ CORPORATE INFORMATION """ self.addr.click_add_new_address_btn() self.addr.enter_domestic_master_vendor_address("CORPORATE INFO", "Corporate Info") self.addr.expand_alternate_names() self.addr.enter_pmnt_alt_name_1() self.addr.enter_business_phone() self.addr.enter_fax() """ TRILOGIE PO ADDRESS """ self.addr.click_add_new_address_btn() self.addr.enter_domestic_master_vendor_address("TRL PO ADDR", "Trilogie PO Address") self.addr.enter_pmnt_alt_name_1() self.addr.enter_business_phone() self.addr.enter_fax() # Add a location self.addr.click_location_tab() self.loc.add_location("MAIN", "Remit to Main") # Add Procurement self.loc.click_procurement_link() self.procurement.select_payment_terms_id("COD") # Save record self.loc.click_save_btn() self.loc.click_summary_tab() self.summary.get_supplier_id() result2 = self.summary.verify_supplier_id_created() self.ts.mark(result2, "Successfully Created Domestic Master Vendor.") @pytest.mark.run(order=3) def test_sign_out(self): self.summary.sign_out_summary_page() result = self.lp.verify_title_of_log_out_page() self.ts.mark_final("Test Create Master and Branch Vendor", result, "Successfully Signed Out of Application.")
class TestDomesticBVMultiLocationsMultiLogons(unittest.TestCase): @pytest.fixture(autouse=True) def class_setup(self): self.ts = TestStatus(self.driver) self.lp = LoginPage(self.driver) self.nav = NavigatePage(self.driver) self.sup_info_fev = FindExistingValuePage(self.driver) self.sup_info_anv = SupplierInformationANV(self.driver) self.summary = SummaryPage(self.driver) self.id_info = IdentifyingInformationPage(self.driver) self.addr = AddressPage(self.driver) self.loc = LocationPage(self.driver) self.procurement = ProcurementOptionsWindow(self.driver) self.sup_xref = SupplierXrefWindow(self.driver) @pytest.mark.run(order=1) # @data((os.environ.get('PSFT_USER_ID'), "wrongpassword")) @data(("AUTOTEST3", "wrongpassword")) @unpack def test_invalid_password(self, username, password): self.lp.login(username, password) result = self.lp.verify_login_failed() self.ts.mark(result, "Login Failed!") @pytest.mark.run(order=2) # @data((os.environ.get('PSFT_USER_ID'), os.environ.get('PSFT_USER_PWD'))) @data(("AUTOTEST3", "Psoft1234$")) @unpack def test_domestic_master_and_branch_vendor_creation_multi_loc_multi_logon(self, username, password): # Login into PeopleSoft with CREATOR credentials self.lp.login(username, password) result_1 = self.lp.verify_title() self.ts.mark(result_1, "Title is CORRECT") self.nav.navigate_to_supplier_info() self.sup_info_fev.add_a_new_value() self.sup_info_anv.click_add_button() self.id_info.enter_identifying_info("DNS") """ CORPORATE INFORMATION """ self.id_info.click_address_tab() self.addr.clean_domestic_us_addresses() self.addr.enter_email_id() self.addr.enter_business_phone() self.addr.enter_fax() """ REMIT ADDRESS """ self.addr.click_add_new_address_btn() self.addr.enter_domestic_master_vendor_address("Remit") self.addr.enter_email_id() self.addr.enter_business_phone() self.addr.enter_fax() """ TRILOGIE PO ADDRESS """ self.addr.click_add_new_address_btn() self.addr.enter_domestic_master_vendor_address("Trilogie PO Address") self.addr.enter_email_id() self.addr.enter_business_phone() self.addr.enter_fax() """ ADD LOCATIONS AND BRANCH VENDORS """ """ Add LOC_1 """ self.addr.click_location_tab() self.loc.add_location("LOC_1", "Remit to LOC_1") # Add Procurement Options self.loc.click_procurement_link() self.procurement.select_payment_terms_id("COD") # Add Branch Vendor(s) self.loc.click_fei_trilogie_xref_link() self.sup_xref.select_two_accounts("HOUSTONWW", "LAHVAC") """ Add LOC_2 """ self.loc.click_add_location_btn() self.loc.add_location("LOC_2", "Remit to LOC_2") # Add Procurement Options self.loc.click_procurement_link() self.procurement.select_payment_terms_id("NET30") # Add Branch Vendor(s) self.loc.click_fei_trilogie_xref_link() self.sup_xref.select_two_accounts("OHIOHVAC", "PLYMOUTH") """ Add LOC_3 """ self.loc.click_add_location_btn() self.loc.add_location("LOC_3", "Remit to LOC_3") # Add Procurement Options self.loc.click_procurement_link() self.procurement.select_payment_terms_id("NET90") # Add Branch Vendor(s) self.loc.click_fei_trilogie_xref_link() self.sup_xref.select_two_accounts("SACRAMENTO", "SANTAROSAWW") """ SAVE RECORD """ self.loc.click_save_btn() self.loc.click_summary_tab() self.summary.get_supplier_id() result2 = self.summary.verify_supplier_id_created() self.ts.mark(result2, "Successfully Created Domestic Master Vendor.")
class TestForeignBVMultiLocationsMultiLogons(unittest.TestCase): @pytest.fixture(autouse=True) def class_setup(self): self.ts = TestStatus(self.driver) self.lp = LoginPage(self.driver) self.nav = NavigatePage(self.driver) self.sup_info_fev = FindExistingValuePage(self.driver) self.sup_info_anv = SupplierInformationANV(self.driver) self.summary = SummaryPage(self.driver) self.id_info = IdentifyingInformationPage(self.driver) self.addr = AddressPage(self.driver) self.clean_addr = CleanAddressPage(self.driver) self.contacts = ContactsPage(self.driver) self.loc = LocationPage(self.driver) self.procurement = ProcurementOptionsWindow(self.driver) self.sup_xref = SupplierXrefWindow(self.driver) @pytest.mark.run(order=1) # @data((os.environ.get('PSFT_USER_ID'), "wrongpassword")) @data(("AUTOTEST3", "wrongpassword")) @unpack def test_invalid_password(self, username, password): self.lp.login(username, password) result = self.lp.verify_login_failed() self.ts.mark(result, "Login Failed!\n") @pytest.mark.run(order=2) # @data((os.environ.get('PSFT_USER_ID'), os.environ.get('PSFT_USER_PWD'))) @data(("AUTOTEST3", "Psoft1234!")) @unpack def test_foreign_master_and_branch_vendor_creation_multi_loc_multi_logon( self, username, password): # Login into PeopleSoft with CREATOR credentials self.lp.login(username, password) result_1 = self.lp.verify_title() self.ts.mark(result_1, "Title is CORRECT") self.nav.navigate_to_supplier_info() self.sup_info_fev.add_a_new_value() self.sup_info_anv.click_add_button() """ IDENTIFYING INFORMATION """ self.id_info.enter_identifying_info() """ ADDRESS(ES)""" """ FOREIGN CORPORATE INFO ADDRESS """ self.id_info.click_address_tab() self.clean_addr.clean_canadian_address("CANADA", "Corporate Info") self.addr.enter_email_id() # self.addr.enter_payment_withholding_alt_names() self.addr.enter_business_phone() self.addr.enter_fax() self.addr.enter_trilogie_dm_fax() """ FOREIGN REMIT INFORMATION """ self.addr.click_add_new_address_btn() self.clean_addr.clean_brazilian_address("BRAZIL", "Remit") self.addr.enter_email_id() # self.addr.enter_payment_withholding_alt_names() self.addr.enter_business_phone() self.addr.enter_fax() self.addr.enter_trilogie_dm_fax() """ FOREIGN TRILOGIE PO ADDRESS ONE """ self.addr.click_add_new_address_btn() self.clean_addr.clean_singapore_address("SINGAPORE", "Trilogie PO Address") self.addr.enter_email_id() # self.addr.enter_payment_withholding_alt_names() self.addr.enter_business_phone() self.addr.enter_fax() self.addr.enter_trilogie_dm_fax() """ CONTACTS PAGE""" self.addr.click_contacts_tab() self.contacts.enter_contacts_details("Testing Contacts", "Accountant") """ ADD LOCATIONS AND BRANCH VENDORS """ """ Add a LOC_1 """ self.addr.click_location_tab() self.loc.add_location("LOC_1", "Remit to LOC_1") # Add Procurement Options self.loc.click_procurement_link() self.procurement.change_ordering_address("3") self.procurement.change_returning_address("3") self.procurement.change_ship_from_address("3") self.procurement.select_payment_terms_id("NET30") # Add Branch Vendor(s) self.loc.click_fei_trilogie_xref_link() self.sup_xref.select_two_accounts("HOUSTONWW", "LAHVAC") """ Add LOC_2 """ self.loc.click_add_location_btn() self.loc.add_location("LOC_2", "Remit to LOC_2") # Add Procurement Options self.loc.click_procurement_link() self.procurement.select_payment_terms_id("NET60") # Add Branch Vendor(s) self.loc.click_fei_trilogie_xref_link() self.sup_xref.select_two_accounts("OHIOHVAC", "PLYMOUTH") """ Add LOC_3 """ self.loc.click_add_location_btn() self.loc.add_location("LOC_3", "Remit to LOC_3") # Add Procurement Options self.loc.click_procurement_link() self.procurement.change_ordering_address("2") self.procurement.change_returning_address("2") self.procurement.change_ship_from_address("2") self.procurement.select_payment_terms_id("NET90") # Add Branch Vendor(s) self.loc.click_fei_trilogie_xref_link() self.sup_xref.select_two_accounts("SACRAMENTO", "SANTAROSAWW") """ Save record """ self.loc.click_save_btn() self.loc.click_summary_tab() self.summary.get_supplier_id() self.summary.search_for_created_supplier() result2 = self.summary.verify_supplier_id_created() self.ts.mark(result2, "Successfully Created Foreign Master Vendor.\n") @pytest.mark.run(order=3) def test_sign_out(self): self.summary.sign_out_summary_page() result = self.lp.verify_title_of_log_out_page() self.ts.mark_final("Test Create Master and Branch Vendor", result, "Successfully Signed Out of Application.\n")
class TestCreateForeignMVCleanAddress(unittest.TestCase): @pytest.fixture(autouse=True) def class_setup(self): self.ts = TestStatus(self.driver) self.lp = LoginPage(self.driver) self.nav = NavigatePage(self.driver) self.sup_info_fev = FindExistingValuePage(self.driver) self.sup_info_anv = SupplierInformationANV(self.driver) self.summary = SummaryPage(self.driver) self.id_info = IdentifyingInformationPage(self.driver) self.addr = AddressPage(self.driver) self.loc = LocationPage(self.driver) self.procurement = ProcurementOptionsWindow(self.driver) @pytest.mark.run(order=1) # @data((os.environ.get('PSFT_USER_ID'), "wrongpassword")) @data(("AUTOTEST3", "wrongpassword")) @unpack def test_invalid_password(self, username, password): self.lp.login(username, password) result = self.lp.verify_login_failed() self.ts.mark(result, "Login Failed!") @pytest.mark.run(order=2) # @data((os.environ.get('PSFT_USER_PWD'), os.environ.get('PSFT_USER_ID'))) @data(("AUTOTEST3", "Psoft1234$")) @unpack def test_foreign_master_vendor_creation(self, username, password): self.lp.login(username, password) result_1 = self.lp.verify_title() self.ts.mark(result_1, "Title is incorrect") self.nav.navigate_to_supplier_info() self.sup_info_fev.add_a_new_value() self.sup_info_anv.click_add_button() self.id_info.enter_identifying_info("DNS") self.id_info.click_address_tab() """ SELECT COUNTRY """ self.addr.clean_anguillian_address() """ SELECT COUNTRY """ self.addr.enter_email_id() self.addr.enter_business_phone() self.addr.enter_fax() """ ADD LOCATIONS """ self.addr.click_location_tab() self.loc.add_location("MAIN", "Remit to Main") # Add Procurement self.loc.click_procurement_link() self.procurement.select_random_payment_terms_id() """ SAVE RECORD """ self.loc.click_save_btn() self.loc.click_summary_tab() self.summary.get_supplier_id() result2 = self.summary.verify_supplier_id_created() self.ts.mark(result2, "Successfully Created Foreign Master Vendor.") @pytest.mark.run(order=3) def test_sign_out(self): self.summary.sign_out_summary_page() result = self.lp.verify_title_of_log_out_page() self.ts.mark_final("Test Create Master and Branch Vendor", result, "Successfully Signed Out of Application.")
class TestDomesticBVWithCSVData(unittest.TestCase): @pytest.fixture(autouse=True) def class_setup(self): self.ts = TestStatus(self.driver) self.lp = LoginPage(self.driver) self.nav = NavigatePage(self.driver) self.sup_info_fev = FindExistingValuePage(self.driver) self.sup_info_anv = SupplierInformationANV(self.driver) self.summary = SummaryPage(self.driver) self.id_info = IdentifyingInformationPage(self.driver) self.addr = AddressPage(self.driver) self.loc = LocationPage(self.driver) self.procurement = ProcurementOptionsWindow(self.driver) self.sup_xref = SupplierXrefWindow(self.driver) @pytest.mark.run(order=1) @data(*get_csv_data( "C:\\Users\\AAO8676\\Documents\\workspace-python\\VMDM_PeopleSoft\\invalid_password.csv" )) @unpack def test_invalid_password(self, username, password): self.lp.login(username, password) result = self.lp.verify_login_failed() self.ts.mark(result, "Login Failed!") @pytest.mark.run(order=2) @data(*get_csv_data("bv_dom_test.csv")) @unpack def test_domestic_master_and_branch_vendor_creation( self, username, password): # Login into PeopleSoft with CREATOR credentials self.lp.login(username, password) result_1 = self.lp.verify_title() self.ts.mark(result_1, "Title is Correct") self.nav.navigate_to_supplier_info() self.sup_info_fev.add_a_new_value() self.sup_info_anv.click_add_button() self.id_info.enter_identifying_info("DNS") """ REMIT CleanAddressPage """ self.id_info.click_address_tab() self.addr.enter_domestic_master_vendor_address("REMIT", "Remit") self.addr.enter_business_phone() self.addr.enter_fax() """ CORPORATE INFORMATION """ self.addr.click_add_new_address_btn() self.addr.enter_domestic_master_vendor_address("CORPORATE INFO", "Corporate Info") self.addr.expand_alternate_names() self.addr.enter_pmnt_alt_name_1() self.addr.enter_business_phone() self.addr.enter_fax() """ TRILOGIE PO ADDRESS """ self.addr.click_add_new_address_btn() self.addr.enter_domestic_master_vendor_address("TRL PO ADDRESS", "Trilogie PO Address") self.addr.enter_pmnt_alt_name_1() self.addr.enter_business_phone() self.addr.enter_fax() """ ADD LOCATIONS """ # Add a location self.addr.click_location_tab() self.loc.add_location("MAIN", "Remit to Main") # Add Procurement Options self.loc.click_procurement_link() self.procurement.select_payment_terms_id("COD") # Add Branch Vendor(s) self.loc.click_fei_trilogie_xref_link() self.sup_xref.select_two_accounts("OHIOHVAC", "PLYMOUTH") """ SAVE RECORD """ self.loc.click_save_btn() self.loc.click_summary_tab() self.summary.get_supplier_id() result2 = self.summary.verify_supplier_id_created() self.ts.mark(result2, "Successfully Created Domestic Master Vendor.") @pytest.mark.run(order=3) def test_sign_out(self): self.summary.sign_out_summary_page() result = self.lp.verify_title_of_log_out_page() self.ts.mark_final("Test Create Master and Branch Vendor", result, "Successfully Signed Out of Application.")
def add_comment_in_address_page(self): address_page = AddressPage(self.driver) address_page.write_message("Handle Carefully") address_page.proceed_to_checkout()
class TestCreateForeignMV(unittest.TestCase): @pytest.fixture(autouse=True) def class_setup(self): self.ts = TestStatus(self.driver) self.lp = LoginPage(self.driver) self.nav = NavigatePage(self.driver) self.sup_info_fev = FindExistingValuePage(self.driver) self.sup_info_anv = SupplierInformationANV(self.driver) self.summary = SummaryPage(self.driver) self.id_info = IdentifyingInformationPage(self.driver) self.addr = AddressPage(self.driver) self.clean_addr = CleanAddressPage(self.driver) self.loc = LocationPage(self.driver) self.payable_options = PayablesOptionsWindow(self.driver) self.procurement = ProcurementOptionsWindow(self.driver) self.preview = PreviewSupplierAuditWindow(self.driver) @pytest.mark.run(order=1) # @data((os.environ.get('PSFT_USER_ID'), "wrongpassword")) @data(("AUTOTEST3", "wrongpassword")) @unpack def test_invalid_password(self, username, password): self.lp.login(username, password) result_1 = self.lp.verify_login_failed() self.ts.mark(result_1, "Login Failed!\n") @pytest.mark.run(order=2) # @data((os.environ.get('PSFT_USER_ID'), os.environ.get('PSFT_USER_PWD'))) @data(("AUTOTEST3", "Psoft1234!")) @unpack def test_foreign_master_vendor_creation(self, username, password): self.lp.login(username, password) result_1 = self.lp.verify_title() self.ts.mark(result_1, "Title is CORRECT\n") self.nav.navigate_to_supplier_info() self.sup_info_fev.add_a_new_value() self.sup_info_anv.click_add_button() self.id_info.enter_identifying_info() """ FOREIGN CORPORATE INFORMATION """ self.id_info.click_address_tab() self.clean_addr.clean_germany_address("GERMANY", "Corporate Info") self.addr.enter_email_id() self.addr.enter_business_phone() self.addr.enter_fax() self.addr.enter_trilogie_dm_fax() """ FOREIGN REMIT ADDRESS """ self.addr.click_add_new_address_btn() self.clean_addr.clean_french_address("FRANCE", "Remit") self.addr.enter_email_id() self.addr.enter_business_phone() self.addr.enter_fax() self.addr.enter_trilogie_dm_fax() """ FOREIGN TRILOGIE PO ADDRESS """ self.addr.click_add_new_address_btn() self.clean_addr.clean_australian_address("AUSTRALIA", "Trilogie PO Address") self.addr.enter_email_id() self.addr.enter_business_phone() self.addr.enter_fax() self.addr.enter_trilogie_dm_fax() """ ADD LOCATIONS """ self.addr.click_location_tab() self.loc.add_location("MAIN", "Remit to Main") # Add Procurement self.loc.click_procurement_link() self.procurement.select_random_payment_terms_id() """ SAVE RECORD """ self.loc.click_save_btn() self.loc.click_summary_tab() self.summary.get_supplier_id() self.summary.search_for_created_supplier() result_2 = self.summary.verify_supplier_id_created() self.ts.mark(result_2, "Successfully Created Foreign Master Vendor.\n") @pytest.mark.run(order=3) def test_sign_out(self): self.summary.sign_out_summary_page() result_1 = self.lp.verify_title_of_log_out_page() self.ts.mark(result_1, "Successfully Signed Out of Application.\n") @pytest.mark.run(order=4) @data(("AUTOTEST4", "Psoft1234!")) @unpack def test_adding_bank_account_data(self, username, password): self.lp.login(username, password) result_1 = self.lp.verify_title() self.ts.mark(result_1, "Title is CORRECT\n") self.nav.navigate_to_supplier_info() self.driver.switch_to.frame("ptifrmtgtframe") self.sup_info_fev.search_for_supplier("0002000006") self.summary.click_correct_history_btn() self.summary.click_location_tab() self.loc.click_payables_link() self.payable_options.enter_and_save_supplier_bank_account_details() """ Preview Audit, Enter Reason Codes/Comments and Finalize """ self.preview.close_preview_supplier_audit_window_ok() result_1 = self.lp.verify_title_of_log_out_page() # self.ts.mark(result_1, "Successfully Signed Out of Application.\n") self.ts.mark_final( "Test Create Master Vendor", result_1, "Successfully added Banking Information to Master Vendor.\n")
class TestDomesticBVMultiLocationsMultiLogons(unittest.TestCase): @pytest.fixture(autouse=True) def class_setup(self): self.ts = TestStatus(self.driver) self.lp = LoginPage(self.driver) self.nav = NavigatePage(self.driver) self.sup_info_fev = FindExistingValuePage(self.driver) self.sup_info_anv = SupplierInformationANV(self.driver) self.summary = SummaryPage(self.driver) self.id_info = IdentifyingInformationPage(self.driver) self.addr = AddressPage(self.driver) self.contacts = ContactsPage(self.driver) self.loc = LocationPage(self.driver) self.procurement = ProcurementOptionsWindow(self.driver) self.sup_xref = SupplierXrefWindow(self.driver) @pytest.mark.run(order=1) # @data((os.environ.get('PSFT_USER_ID'), "wrongpassword")) @data(("AUTOTEST3", "wrongpassword")) @unpack def test_invalid_password(self, username, password): self.lp.login(username, password) result = self.lp.verify_login_failed() self.ts.mark(result, "Login Failed!") @pytest.mark.run(order=2) # @data((os.environ.get('PSFT_USER_ID'), os.environ.get('PSFT_USER_PWD'))) @data(("AUTOTEST3", "Psoft1234$")) @unpack def test_domestic_master_and_branch_vendor_creation_multi_loc_multi_logon( self, username, password): # Login into PeopleSoft with CREATOR credentials self.lp.login(username, password) result_1 = self.lp.verify_title() self.ts.mark(result_1, "Title is CORRECT\n") self.nav.navigate_to_supplier_info() self.sup_info_fev.add_a_new_value() self.sup_info_anv.click_add_button() """ IDENTIFYING INFORMATION PAGE """ self.id_info.enter_identifying_info() """ ADDRESS(ES)""" self.id_info.click_address_tab() """ DOMESTIC CORPORATE INFO ADDRESS """ self.addr.enter_corporate_info_address_domestic() """ DOMESTIC REMIT INFORMATION """ self.addr.click_add_new_address_btn() self.addr.enter_remit_address_domestic() """ DOMESTIC TRILOGIE PO ADDRESS ONE """ self.addr.click_add_new_address_btn() self.addr.enter_po_address_domestic() """ CONTACTS PAGE """ self.addr.click_contacts_tab() self.contacts.enter_contacts_details("TEST DESCRIPTION", "TEST TITLE") """ ADD LOCATIONS AND BRANCH VENDORS """ """ Add a LOC_1 """ self.addr.click_location_tab() self.loc.add_location("LOC_1", "Remit to LOC_1") # Add Procurement Options self.loc.click_procurement_link() self.procurement.change_ordering_address("3") self.procurement.change_returning_address("3") self.procurement.change_ship_from_address("3") self.procurement.select_payment_terms_id("NET30") # Add Branch Vendor(s) # self.loc.click_fei_trilogie_xref_link() # self.sup_xref.select_two_accounts("HOUSTONWW", "LAHVAC") """ Add LOC_2 """ self.loc.click_add_location_btn() self.loc.add_location("LOC_2", "Remit to LOC_2") # Add Procurement Options self.loc.click_procurement_link() self.procurement.select_payment_terms_id("NET60") # Add Branch Vendor(s) # self.loc.click_fei_trilogie_xref_link() # self.sup_xref.select_two_accounts("OHIOHVAC", "PLYMOUTH") """ Add LOC_3 """ self.loc.click_add_location_btn() self.loc.add_location("LOC_3", "Remit to LOC_3") # Add Procurement Options self.loc.click_procurement_link() self.procurement.change_ordering_address("2") self.procurement.change_returning_address("2") self.procurement.change_ship_from_address("2") self.procurement.select_payment_terms_id("NET90") # Add Branch Vendor(s) # self.loc.click_fei_trilogie_xref_link() # self.sup_xref.select_two_accounts("SACRAMENTO", "SANTAROSAWW") """ Save record """
def test01(self): mylogger.debug("开始编辑地址") #点击编辑 mylogger.debug("点击编辑") try: AddressPage().click_edit_address().click() except Exception: assert False, "未能成功点击编辑按钮" self.driver.implicitly_wait(5) #清空收货人原有内容 mylogger.debug("清空收货人原有内容") AddressPage().input_edit_name_id().clear() try: AddressPage().input_edit_name_id().clear() except Exception: assert False, "未能成功清空收货人原有信息" time.sleep(4) #编辑收货人 mylogger.debug("编辑收货人") try: edit_name = ReadExcelData().returnExcelData( 'data.xlsx', 'address', 0, 1) AddressPage().input_edit_name_id().send_keys(edit_name) except Exception: assert False, "未能成功编辑收货人" self.driver.implicitly_wait(5) #选择地址_省 mylogger.debug("选择地址_省") try: AddressPage().select_edit_province_id().click() except Exception: assert False, "未能成功选择地址_省" time.sleep(2) #选择地址_市 mylogger.debug("选择地址_市") try: AddressPage().select_edit_city_id().click() except Exception: assert False, "未能成功选择地址_省" time.sleep(2) #选择地址_区 mylogger.debug("选择地址_区") try: AddressPage().select_edit_county_id().click() except Exception: assert False, "未能成功选择地址_区" time.sleep(2) #清空详细地址原有内容 mylogger.debug("清空详细地址原有内容") try: AddressPage().input_edit_detailaddress_id().clear() except Exception: assert False, "未能成功清空详细地址原有内容" #编辑详细地址 mylogger.debug("编辑详细地址") try: edit_address = ReadExcelData().returnExcelData( 'data.xlsx', 'address', 1, 1) AddressPage().input_edit_detailaddress_id().send_keys(edit_address) except Exception: assert False, "未能成功编辑详细地址" self.driver.implicitly_wait(5) #清空手机号原有内容 mylogger.debug("清空手机号原有内容") try: AddressPage().input_edit_mobile_id().clear() except Exception: assert False, "未能成功清空手机号原有内容" #编辑手机号 mylogger.debug("编辑手机号") try: edit_mobile = ReadExcelData().returnExcelData( 'data.xlsx', 'address', 2, 1) AddressPage().input_edit_mobile_id().send_keys(str(edit_mobile)) except Exception: assert False, "未能成功编辑手机号" time.sleep(5) #截屏 CommonDef().get_windows_img() #点击保存收货地址 mylogger.debug("点击保存收货地址") # JavascriptExecutor executor = (JavascriptExecutor) driver; # executor.executeScript("arguments[0].click();",AddressPage().click_edit_button()); try: AddressPage().click_edit_button().click() except Exception: assert False, "未能成功点击确认修改按钮" time.sleep(2) #截屏 CommonDef().get_windows_img() time.sleep(2)
def setUp(self): # create new Chrome session self.driver = webdriver.Chrome( "C:/Users/cristian.prepelita/projects/drivers/chromedriver.exe") url = 'http://automationpractice.com/index.php' # navigate to the application cart self.driver.get(url) # add product to cart product = self.driver.find_element_by_xpath( '//*[@id="homefeatured"]/li[1]/div/div[2]/div[2]/a[1]') product.click() self.driver.implicitly_wait(7) # go to cart checkout = self.driver.find_element_by_css_selector( "a[title='Proceed to checkout']") checkout.click() # initiate summary page self.summary_page = SummaryPage(driver=self.driver) # proceed to the next step self.summary_page.btn_proceed_to_checkout.click() # initiate sign page self.sign_page = SignPage(driver=self.driver) # generate valid email name = random.choice(string.ascii_letters) address = random.choice(string.ascii_letters) domain = random.choice(string.ascii_letters) email = name + '@' + address + '.' + domain # insert the email and submit the button self.sign_page.input_email_create.input_text(email) self.sign_page.btn_submit_create.click() # initiate create_account_page (form page) self.create_account_page = CreateAccountPage(driver=self.driver) # YOUR PERSONAL INFORMATION self.create_account_page.get_client_title_mr.click() self.create_account_page.get_client_first_name.input_text('John') self.create_account_page.get_client_lastName.input_text('John') # email row pre-filled self.create_account_page.get_client_passwd.input_text('123467') # date of bird # YOUR ADDRESS # self.create_account_page.get_firstName_field.input_text('John') # self.create_account_page.get_last_name_field.input_text('John') self.create_account_page.get_company_field.input_text('Company') self.create_account_page.get_address_field.input_text('Address') self.create_account_page.get_city_field.input_text('City') # state self.create_account_page.dropdown_state_field.option('Alabama') self.create_account_page.get_postalcode_field.input_text('10000') # country self.create_account_page.get_homephone_field.input_text('070000122') self.create_account_page.get_mobilephone_field.input_text('0700000000') self.create_account_page.get_address_alias_field.input_text('Address') self.create_account_page.btn_register.click() self.address_page = AddressPage(driver=self.driver) self.address_page.btn_submit.click() self.shipping_page = ShippingPage(driver=self.driver)
class TestCreateDomesticMV(unittest.TestCase): @pytest.fixture(autouse=True) def class_setup(self): self.ts = TestStatus(self.driver) self.get_pass = GetPassWarning(self.driver) self.lp = LoginPage(self.driver) self.nav = NavigatePage(self.driver) self.sup_info_fev = FindExistingValuePage(self.driver) self.sup_info_anv = SupplierInformationANV(self.driver) self.summary = SummaryPage(self.driver) self.id_info = IdentifyingInformationPage(self.driver) self.addr = AddressPage(self.driver) self.loc = LocationPage(self.driver) self.procurement = ProcurementOptionsWindow(self.driver) @pytest.mark.run(order=1) # @data((os.environ.get('PSFT_USER_ID'), "wrongpassword")) @data(("AUTOTEST3", "wrongpassword")) @unpack def test_invalid_password(self, username, password): self.lp.login(username, password) result = self.lp.verify_login_failed() self.ts.mark(result, "Login Failed!") @pytest.mark.run(order=2) # @data((os.environ.get('PSFT_USER_ID'), os.environ.get('PSFT_USER_PWD'))) @data(("AUTOTEST3", "Psoft1234$")) @unpack def test_domestic_master_vendor_creation(self, username, password): self.lp.login(username, password) result_1 = self.lp.verify_title() self.ts.mark(result_1, "Title is CORRECT") self.nav.navigate_to_supplier_info() self.sup_info_fev.add_a_new_value() self.sup_info_anv.click_add_button() self.id_info.enter_identifying_info("DNS") """ CORPORATE INFO """ self.id_info.click_address_tab() self.addr.clean_domestic_us_addresses() self.addr.enter_email_id() self.addr.enter_business_phone() self.addr.enter_fax() # """ REMIT """ # self.addr.click_add_new_address_btn() # self.addr.click_override_address_verification_chkbx() # self.addr.enter_domestic_master_vendor_address("Remit") # self.addr.enter_email_id() # self.addr.enter_business_phone() # self.addr.enter_fax() # # """ TRILOGIE PO ADDRESS """ # self.addr.click_add_new_address_btn() # self.addr.click_override_address_verification_chkbx() # self.addr.enter_domestic_master_vendor_address("Trilogie PO Address") # self.addr.enter_email_id() # self.addr.enter_business_phone() # self.addr.enter_fax() # Add a location self.addr.click_location_tab() self.loc.add_location("MAIN", "Remit to Main") # Add Procurement self.loc.click_procurement_link() self.procurement.select_random_payment_terms_id() # Save record self.loc.click_save_btn() self.loc.click_summary_tab() self.summary.get_supplier_id() result2 = self.summary.verify_supplier_id_created() self.ts.mark(result2, "Successfully Created Domestic Master Vendor.") @pytest.mark.run(order=3) def test_sign_out(self): self.summary.sign_out_summary_page() result = self.lp.verify_title_of_log_out_page() self.ts.mark_final("Test Create Master and Branch Vendor", result, "Successfully Signed Out of Application.")
class TestDomesticBV(unittest.TestCase): @pytest.fixture(autouse=True) def class_setup(self): self.ts = TestStatus(self.driver) self.lp = LoginPage(self.driver) self.nav = NavigatePage(self.driver) self.sup_info_fev = FindExistingValuePage(self.driver) self.sup_info_anv = SupplierInformationANV(self.driver) self.summary = SummaryPage(self.driver) self.id_info = IdentifyingInformationPage(self.driver) self.addr = AddressPage(self.driver) self.clean_addr = CleanAddressPage(self.driver) self.loc = LocationPage(self.driver) self.payable_options = PayablesOptionsWindow(self.driver) self.procurement = ProcurementOptionsWindow(self.driver) self.sup_xref = SupplierXrefWindow(self.driver) self.preview = PreviewSupplierAuditWindow(self.driver) @pytest.mark.run(order=1) # @data((os.environ.get('PSFT_USER_ID'), "wrongpassword")) @data(("AUTOTEST3", "wrongpassword")) @unpack def test_invalid_password(self, username, password): self.lp.login(username, password) result = self.lp.verify_login_failed() self.ts.mark(result, "Login Failed!\n") @pytest.mark.run(order=2) # @data((os.environ.get('PSFT_USER_ID'), os.environ.get('PSFT_USER_PWD'))) @data(("AUTOTEST3", "Psoft1234!")) @unpack def test_domestic_master_and_branch_vendor_creation( self, username, password): self.lp.login(username, password) result_1 = self.lp.verify_title() self.ts.mark(result_1, "Title is CORRECT") self.nav.navigate_to_supplier_info() self.sup_info_fev.add_a_new_value() self.sup_info_anv.click_add_button() self.id_info.enter_identifying_info() """ CORPORATE INFORMATION """ self.id_info.click_address_tab() self.addr.enter_domestic_master_vendor_address("Remit") self.addr.enter_email_id() self.addr.enter_business_phone() self.addr.enter_fax() self.addr.enter_trilogie_dm_fax() """ REMIT ADDRESS """ self.addr.click_add_new_address_btn() self.clean_addr.clean_australian_address() self.addr.enter_email_id() self.addr.enter_business_phone() self.addr.enter_fax() self.addr.enter_trilogie_dm_fax() """ TRILOGIE PO ADDRESS """ self.addr.click_add_new_address_btn() self.addr.enter_domestic_master_vendor_address("Trilogie PO Address") self.addr.enter_email_id() self.addr.enter_business_phone() self.addr.enter_fax() self.addr.enter_trilogie_dm_fax() """ LOCATIONS PAGE """ # Add a location self.addr.click_location_tab() self.loc.add_location("MAIN", "Remit to Main") # Add Procurement Options self.loc.click_procurement_link() self.procurement.select_random_payment_terms_id() # Add Branch Vendor(s) self.loc.click_fei_trilogie_xref_link() self.sup_xref.select_random_account() """ SAVE RECORD """ self.loc.click_save_btn() self.loc.click_summary_tab() self.summary.get_supplier_id() self.summary.search_for_created_supplier() result2 = self.summary.verify_supplier_id_created() self.ts.mark( result2, "Successfully Created Domestic Master and Branch Vendor.\n") @pytest.mark.run(order=3) def test_sign_out(self): self.summary.sign_out_summary_page() result_1 = self.lp.verify_title_of_log_out_page() self.ts.mark(result_1, "Successfully Signed Out of Application.\n")