def test_delete_new_record(self):
        self.login_page
        add_new_lnk = PageNavi(self.driver)
        add_new_lnk.add_lnk()  #click on add new link

        page_add_new = AddNew(self.driver)
        # filling Address on second page on Add new page
        page_add_new.fill_address(
            random_test_data.random_letters(5)) and self.assertTrue(
                random_test_data.random_letters(5))  # fill the address field
        page_add_new.click_next  # navigate to next page

        # Filling user data
        page_add_new.fill_user_name(properties.f_name, properties.m_name,
                                    properties.l_name)
        self.assertTrue(properties.f_name) and self.assertTrue(
            properties.m_name) and self.assertTrue(properties.l_name)
        page_add_new.set_email(properties.e_mail) and self.assertTrue(
            properties.e_mail)
        page_add_new.set_phone('+' +
                               properties.phone_number) and self.assertTrue(
                                   '+' + properties.phone_number)

        page_add_new.click_enter()
        self.driver.implicitly_wait(10)

        # Search on the main page
        main_page = MainPage(self.driver)
        main_page.search_element(properties.phone_number) and self.assertTrue(
            properties.phone_number)
        #self.driver.implicitly_wait(10)
        main_page.select_all_element()
        main_page.delete_bttn()

        main_page.accept_alert()
예제 #2
0
    def test_add_new_record_and_delete_it(self):
        self.test_login_page()  # login to addressbook
        add_new_lnk = page.PageNavi(self.driver)
        add_new_lnk.add_lnk()  #click on add new link

        page_add_new = page.AddNew(self.driver)
        # filling Address on second page on Add new page
        addr = random_test_data.random_letters(5)
        page_add_new.fill_address(addr)
        self.assertIn(addr, addr)  # fill the address field
        page_add_new.click_next  # navigate to next page

        # Filling user data
        page_add_new.fill_user_name(self.f_name, self.m_name, self.l_name)
        self.assertIs(self.f_name, self.f_name) or self.assertIs(
            self.m_name, self.m_name) or self.assertIs(self.l_name,
                                                       self.l_name)
        page_add_new.set_email(self.e_mail)
        self.assertIs(self.e_mail, self.e_mail)

        page_add_new.set_phone('+' + self.phone_number)
        self.assertIs(self.phone_number, self.phone_number)

        page_add_new.click_enter()
        self.driver.implicitly_wait(10)

        # Search on the main page
        main_page = page.MainPage(self.driver)
        main_page.search_element(self.phone_number)
        self.assertIs(self.phone_number, self.phone_number)
        self.driver.implicitly_wait(10)
        main_page.select_element()
        main_page.delete_bttn()

        main_page.accept_alert()
예제 #3
0
 def test_add_new_record_and_delete_it(self): 
     self.test_login_page() # login to addressbook
     add_new_lnk = page.PageNavi(self.driver)
     add_new_lnk.add_lnk() #click on add new link 
     
     page_add_new = page.AddNew(self.driver)
     # filling Address on second page on Add new page
     addr=random_test_data.random_letters(5)
     page_add_new.fill_address(addr) 
     self.assertIn(addr,addr) # fill the address field
     page_add_new.click_next # navigate to next page
     
     # Filling user data
     page_add_new.fill_user_name(self.f_name,self.m_name,self.l_name) 
     self.assertIs(self.f_name,self.f_name) or self.assertIs(self.m_name, self.m_name) or self.assertIs(self.l_name,self.l_name) 
     page_add_new.set_email(self.e_mail) 
     self.assertIs(self.e_mail, self.e_mail)
     
     page_add_new.set_phone('+' + self.phone_number) 
     self.assertIs(self.phone_number,self.phone_number)
     
     page_add_new.click_enter() 
     self.driver.implicitly_wait(10)
            
     # Search on the main page        
     main_page = page.MainPage(self.driver)
     main_page.search_element(self.phone_number)
     self.assertIs(self.phone_number,self.phone_number)
     self.driver.implicitly_wait(10)
     main_page.select_element()
     main_page.delete_bttn()
     
     main_page.accept_alert()
 def test_delete_new_record(self): 
     self.login_page 
     add_new_lnk = PageNavi(self.driver)
     add_new_lnk.add_lnk() #click on add new link 
    
     page_add_new = AddNew(self.driver)
     # filling Address on second page on Add new page
     page_add_new.fill_address(random_test_data.random_letters(5)) and self.assertTrue(random_test_data.random_letters(5)) # fill the address field
     page_add_new.click_next # navigate to next page
     
     # Filling user data
     page_add_new.fill_user_name(properties.f_name, properties.m_name, properties.l_name) 
     self.assertTrue(properties.f_name) and self.assertTrue(properties.m_name) and self.assertTrue(properties.l_name) 
     page_add_new.set_email(properties.e_mail) and self.assertTrue(properties.e_mail) 
     page_add_new.set_phone('+' + properties.phone_number) and self.assertTrue('+' + properties.phone_number)
     
     page_add_new.click_enter() 
     self.driver.implicitly_wait(10)
            
     # Search on the main page        
     main_page = MainPage(self.driver)
     main_page.search_element(properties.phone_number) and self.assertTrue(properties.phone_number)
     #self.driver.implicitly_wait(10)
     main_page.select_all_element()
     main_page.delete_bttn()
     
     main_page.accept_alert()
예제 #5
0
 def setUp(self):
     self.driver = browser()
     self.driver.get(_url)   
     
     ''' login to addressbook ''' 
     #self.user = user #'admin' # user name login
     #self.password = password #'secret' # user password login 
     self.login_page = page.LoginPage(self.driver)
     self.login_page.login(user, password)
     self.login_page.click_submit()
             
     ''' random data'''
     self.e_mail = (random_test_data.random_letters(6) + '@' + random_test_data.random_letters(5) + '.com') # generate random email
     self.phone_number = random_test_data.random_number(11)  # generate random phone number
     self.f_name = random_test_data.random_letters(6) # generate First name
     self.m_name = random_test_data.random_letters(5) # generate Middle name
     self.l_name = random_test_data.random_letters(7) # generate Last name
 def setUp(self):
     self.driver = browser()
     self.driver.set_window_size(1380, 880)
     self.driver.get(properties._url)   
     ''' login to addressbook ''' 
     
     self.login_page = page.LoginPage(self.driver)
     self.login_page.login(properties.user, properties.password)
     self.login_page.click_submit()
     
     #random data
     ''' random data'''
     self.e_mail = (random_test_data.random_letters(6) + '@' + random_test_data.random_letters(5) + '.com') # generate random email
     self.phone_number = random_test_data.random_number(11)  # generate random phone number
     self.f_name = random_test_data.random_letters(6) # generate First name
     self.m_name = random_test_data.random_letters(5) # generate Middle name
     self.l_name = random_test_data.random_letters(7) # generate Last name
예제 #7
0
 def setUp(self):
     self.driver = browser()
     self.driver.get(_url)
     ''' login to addressbook '''
     #self.user = user #'admin' # user name login
     #self.password = password #'secret' # user password login
     self.login_page = page.LoginPage(self.driver)
     self.login_page.login(user, password)
     self.login_page.click_submit()
     ''' random data'''
     self.e_mail = (random_test_data.random_letters(6) + '@' +
                    random_test_data.random_letters(5) + '.com'
                    )  # generate random email
     self.phone_number = random_test_data.random_number(
         11)  # generate random phone number
     self.f_name = random_test_data.random_letters(6)  # generate First name
     self.m_name = random_test_data.random_letters(
         5)  # generate Middle name
     self.l_name = random_test_data.random_letters(7)  # generate Last name
예제 #8
0
    def setUp(self):
        self.driver = browser()
        self.driver.set_window_size(1380, 880)
        self.driver.get(properties._url)
        ''' login to addressbook '''

        self.login_page = page.LoginPage(self.driver)
        self.login_page.login(properties.user, properties.password)
        self.login_page.click_submit()

        #random data
        ''' random data'''
        self.e_mail = (random_test_data.random_letters(6) + '@' +
                       random_test_data.random_letters(5) + '.com'
                       )  # generate random email
        self.phone_number = random_test_data.random_number(
            11)  # generate random phone number
        self.f_name = random_test_data.random_letters(6)  # generate First name
        self.m_name = random_test_data.random_letters(
            5)  # generate Middle name
        self.l_name = random_test_data.random_letters(7)  # generate Last name
예제 #9
0
import random_test_data


user="******"
password="******"
_url="http://localhost/index.php"

e_mail = (random_test_data.random_letters(6) + '@' + random_test_data.random_letters(5) + '.com') # generate random email
phone_number = random_test_data.random_number(11)  # generate random phone number
f_name = random_test_data.random_letters(6) # generate First name
m_name = random_test_data.random_letters(5) # generate Middle name
l_name = random_test_data.random_letters(7) # generate Last name
예제 #10
0
import random_test_data

user = "******"
password = "******"
_url = "http://localhost/index.php"

e_mail = (random_test_data.random_letters(6) + '@' +
          random_test_data.random_letters(5) + '.com')  # generate random email
phone_number = random_test_data.random_number(
    11)  # generate random phone number
f_name = random_test_data.random_letters(6)  # generate First name
m_name = random_test_data.random_letters(5)  # generate Middle name
l_name = random_test_data.random_letters(7)  # generate Last name