def test_login_to_portal(self, setup): self.driver = setup self.driver.maximize_window() self.driver.get(self.baseurl) self.lp = Login_Page(self.driver) self.lp.test_login_to_application(self.username, self.password) self.hp = Home_Page(self.driver) self.hp.test_click_campaign_link() self.cm = Create_Campaigns(self.driver) self.cm.test_click_add_campaign() time.sleep(4) sql_query = "select * from campaign" DB_Validation.db_validation_return_all_records(self.db_host, self.db_username, self.db_password, self.db_dbname, sql_query) my_items = DB_Validation.items_from_db self.addnew = Add_New_Campaign(self.driver) for elements in my_items: campaign_name = elements[0] body_message = elements[1] date = elements[3] email = elements[2] self.addnew.test_create_campaign(campaign_name,body_message,date,email) print("Items processed successfully!") self.driver.close()
def test_create_gift_card(self, setup): self.driver = setup self.driver.maximize_window() self.driver.get(self.baseurl) self.lp = Login_Page(self.driver) self.lp.test_login_to_application(self.username, self.password) self.hp = Home_Page(self.driver) self.hp.test_click_sales_giftcards_link() self.gcp = GiftCard_Page(self.driver) self.gcp.test_click_add_new_button() self.cgc = Create_Giftcard(self.driver) self.cgc.test_create_new_giftcard(self.gctype, self.gc_name) value_gc = Create_Giftcard.global_my_gift_card print(value_gc, "From Test Scenarios") update_query = "INSERT INTO gift_cards (cust_name,price,cupon_code) VALUES('Mike', '999' ,'" + value_gc + "')" self.bdv = DB_Validation() self.bdv.db_validation_update_query(self.db_host_name, self.db_user_name, self.db_password, self.db_database_name, update_query) print("Validated and Success !") self.driver.close()
def test_create_discounts(self, setup): self.driver = setup self.driver.maximize_window() self.driver.get(self.url) self.lp = Login_Page(self.driver) self.lp.test_login_to_application(self.user_name, self.user_password) self.hp = Home_Page(self.driver) self.hp.test_click_discounts_link() self.dlp = Discounts_Landing_Page(self.driver) self.dlp.test_click_add_button() print("Clicked Add Button") self.alnewdis = Add_New_Discount(self.driver) for elements in self.all_items_from_db: discount_name = elements[0] discount_type = elements[1] discount_start_date = elements[2] discount_end_date = elements[3] discount_content = elements[4] self.alnewdis.test_add_discount(discount_name, discount_type, discount_start_date, discount_end_date, discount_content) self.driver.close()
def test_create_customer_profiles(self, setup): self.driver = setup self.driver.maximize_window() self.driver.get(self.url) self.lp = Login_Page(self.driver) self.lp.test_login_to_application(self.user_name, self.user_password) self.hp = Home_Page(self.driver) self.hp.test_click_cusromers_link() self.clp = Customers_LandingPage(self.driver) self.clp.test_click_add_button() self.anc = Add_New_Customer(self.driver) rows = read_excel_data.get_row_count(self.path, self.sheet_name) print("My Rows = ", rows) for r in range(2, rows + 1): mail = read_excel_data.read_data(self.path, self.sheet_name, r, 1) fn = read_excel_data.read_data(self.path, self.sheet_name, r, 2) ln = read_excel_data.read_data(self.path, self.sheet_name, r, 3) company = read_excel_data.read_data(self.path, self.sheet_name, r, 4) self.anc.test_add_new_customer(mail, fn, ln, company) self.driver.close()
def test_login_to_portal(self, setup): self.driver = setup self.driver.maximize_window() self.driver.get(self.baseurl) self.lp = Login_Page(self.driver) self.lp.test_login_to_application(self.username, self.password) self.driver.close()
def test_login_to_portal(self, setup): self.driver = setup self.driver.maximize_window() self.driver.get(self.baseurl) self.lp = Login_Page(self.driver) self.lp.test_login_to_application(self.username, self.password) #query = "insert into sanity values ('"+self.test_case_id+"', '"+self.test_case_name+"', NOW(), 'PASS')" query = "update sanity set test_status = 'differed' where test_case_id = '" + self.test_case_id + "'" print(query) tcc = TestCase_Results() tcc.test_case_report_from_db(query) self.driver.close()
class Test_login_to_application: baseurl = Read_config.get_app_url() username = Read_config.get_user_name() password = Read_config.get_password() def test_login_to_portal(self, setup): self.driver = setup self.driver.maximize_window() self.driver.get(self.baseurl) self.lp = Login_Page(self.driver) self.lp.test_login_to_application(self.username, self.password) self.driver.close()
class Test_Add_Discounts: url = Read_config.get_app_url() user_name = Read_config.get_user_name() user_password = Read_config.get_password() readxml_insert_database db_hostname = Read_config.get_db_host() db_username = Read_config.get_db_username() db_password = Read_config.get_db_password() db_name = Read_config.get_db_name() db_query = "select * from discount limit 3" DB_Validation.db_validation_return_all_records(db_hostname, db_username, db_password, db_name, db_query) all_items_from_db = DB_Validation.items_from_db length_of_items = len(all_items_from_db) def test_create_discounts(self, setup): self.driver = setup self.driver.maximize_window() self.driver.get(self.url) self.lp = Login_Page(self.driver) self.lp.test_login_to_application(self.user_name, self.user_password) self.hp = Home_Page(self.driver) self.hp.test_click_discounts_link() self.dlp = Discounts_Landing_Page(self.driver) self.dlp.test_click_add_button() print("Clicked Add Button") self.alnewdis = Add_New_Discount(self.driver) for elements in self.all_items_from_db: discount_name = elements[0] discount_type = elements[1] discount_start_date = elements[2] discount_end_date = elements[3] discount_content = elements[4] self.alnewdis.test_add_discount(discount_name, discount_type, discount_start_date, discount_end_date, discount_content) self.driver.close()
class Test_Create_Giftcard: baseurl = Read_config.get_app_url() username = Read_config.get_user_name() password = Read_config.get_password() path = "C:\\Users\\Ram\Desktop\\testdata.xlsx" sheet_name = "GiftCards" gctype = read_excel_data.read_data(path, sheet_name, 2, 1) my_gc_price = read_excel_data.read_data(path, sheet_name, 2, 2) strmygc = str(my_gc_price) gc_name = read_excel_data.read_data(path, sheet_name, 2, 3) db_host_name = Read_config.get_db_host() db_user_name = Read_config.get_db_username() db_password = Read_config.get_db_password() db_database_name = Read_config.get_db_name() def test_create_gift_card(self, setup): self.driver = setup self.driver.maximize_window() self.driver.get(self.baseurl) self.lp = Login_Page(self.driver) self.lp.test_login_to_application(self.username, self.password) self.hp = Home_Page(self.driver) self.hp.test_click_sales_giftcards_link() self.gcp = GiftCard_Page(self.driver) self.gcp.test_click_add_new_button() self.cgc = Create_Giftcard(self.driver) self.cgc.test_create_new_giftcard(self.gctype, self.gc_name) value_gc = Create_Giftcard.global_my_gift_card print(value_gc, "From Test Scenarios") update_query = "INSERT INTO gift_cards (cust_name,price,cupon_code) VALUES('Mike', '999' ,'" + value_gc + "')" self.bdv = DB_Validation() self.bdv.db_validation_update_query(self.db_host_name, self.db_user_name, self.db_password, self.db_database_name, update_query) print("Validated and Success !") self.driver.close()
def test_login_to_portal(self, setup): self.driver = setup self.driver.maximize_window() self.driver.get(self.baseurl) self.lp = Login_Page(self.driver) self.lp.test_login_to_application(self.username, self.password) self.hp = Home_Page(self.driver) self.hp.test_click_more_info_orders() self.olp = Orders_LandingPage(self.driver) self.olp.test_process_the_orders("Processing") self.eo = Edit_Orders(self.driver) self.eo.test_order_status() self.driver.close()
class Test_Create_Customer_Profiles: Xml_to_ExcelSheet.xmldata_to_excel_sheet() url = Read_config.get_app_url() user_name = Read_config.get_user_name() user_password = Read_config.get_password() path = "E:\\NOP BO Automation\\test_data\\CustDetails.xlsx" sheet_name = "Sheet1" def test_create_customer_profiles(self,setup): self.driver = setup self.driver.maximize_window() self.driver.get(self.url) self.lp = Login_Page(self.driver) self.lp.test_login_to_application(self.user_name, self.user_password) self.hp = Home_Page(self.driver) self.hp.test_click_cusromers_link() self.clp = Customers_LandingPage(self.driver) self.clp.test_click_add_button() self.anc = Add_New_Customer(self.driver) rows = read_excel_data.get_row_count(self.path, self.sheet_name) print("My Rows = " , rows) for r in range(2,rows+1): mail = read_excel_data.read_data(self.path, self.sheet_name,r,1) fn = read_excel_data.read_data(self.path, self.sheet_name,r,2) ln = read_excel_data.read_data(self.path, self.sheet_name,r,3) company = read_excel_data.read_data(self.path, self.sheet_name,r,4) self.anc.test_add_new_customer(mail,fn,ln,company) self.driver.close()
class Test_login_to_application: class_name = (__qualname__) test_case_id = "101" test_case_name = "Login to application" baseurl = Read_config.get_app_url() username = Read_config.get_user_name() password = Read_config.get_password() def test_login_to_portal(self, setup): self.driver = setup self.driver.maximize_window() self.driver.get(self.baseurl) self.lp = Login_Page(self.driver) self.lp.test_login_to_application(self.username, self.password) #query = "insert into sanity values ('"+self.test_case_id+"', '"+self.test_case_name+"', NOW(), 'PASS')" query = "update sanity set test_status = 'differed' where test_case_id = '" + self.test_case_id + "'" print(query) tcc = TestCase_Results() tcc.test_case_report_from_db(query) self.driver.close()