Esempio n. 1
0
 def test_04a_see_account_info(self):
     driver = Login_Admin(self)
     with allure.step('Click  Tài Khoản'):
         driver.find_element_by_xpath(
             '//*[@id="wrapper"]/div[1]/ul/li[2]/a').click()
         time.sleep(1)
         self.assertEqual(driver.current_url,
                         'https://admin.myreales.tk/account/1')
     with allure.step('Click Random Account'):
         driver.find_element_by_xpath('//*[@id="content-wrapper"]/div/div[2]/div[2]/div/div/div/div/div/table/tbody/tr[3]').click()
         time.sleep(1)
         bodyText = driver.find_element_by_tag_name('body').text
         self.assertTrue("Thông tin chi tiết tài khoản" in bodyText)
         driver.save_screenshot(admin_images+"/test_04a_see_account_info.png")
Esempio n. 2
0
 def test_04d_same_description_account_info(self):
     driver = Login_Admin(self)
     with allure.step('Click  Tài Khoản'):
         driver.find_element_by_xpath(
             '//*[@id="wrapper"]/div[1]/ul/li[2]/a').click()
         time.sleep(1)
         self.assertEqual(driver.current_url,
                         'https://admin.myreales.tk/account/1')
     with allure.step('Click Random Account'):
         driver.find_element_by_xpath('//*[@id="content-wrapper"]/div/div[2]/div[2]/div/div/div/div/div/table/tbody/tr[3]').click()
         time.sleep(1)
         bodyText = driver.find_element_by_tag_name('body').text
         self.assertTrue("Thông tin chi tiết tài khoản" in bodyText)
     with allure.step('Update description'):
         driver.find_element_by_xpath('//*[@id="description"]').send_keys(Keys.SPACE)
         driver.find_element_by_xpath('//*[@id="description"]').send_keys(Keys.BACK_SPACE)
         driver.find_element_by_xpath('//*[@id="content-wrapper"]/div/div[2]/div[2]/div[1]/div[2]/form/div[4]/div[1]/button').click()
         time.sleep(3)
         test=driver.find_elements_by_class_name("ant-message")
         text=test[0].text
         self.assertEqual(text,'Update Error, please try again')
         driver.save_screenshot(admin_images+"/test_04d_same_description_account_info.png")
Esempio n. 3
0
 def test_04e_update_status_account_info(self):
     driver = Login_Admin(self)
     with allure.step('Click  Tài Khoản'):
         driver.find_element_by_xpath(
             '//*[@id="wrapper"]/div[1]/ul/li[2]/a').click()
         time.sleep(1)
         self.assertEqual(driver.current_url,
                         'https://admin.myreales.tk/account/1')
     with allure.step('Click Random Account'):
         driver.find_element_by_xpath('//*[@id="content-wrapper"]/div/div[2]/div[2]/div/div/div/div/div/table/tbody/tr[3]').click()
         time.sleep(1)
         bodyText = driver.find_element_by_tag_name('body').text
         self.assertTrue("Thông tin chi tiết tài khoản" in bodyText)
     with allure.step('Update status'):
         statusAccount=Select(driver.find_element_by_id('statusAccount'))
         statusAccount.select_by_index(1)
         driver.find_element_by_xpath('//*[@id="content-wrapper"]/div/div[2]/div[2]/div[1]/div[2]/form/div[4]/div[1]/button').click()
         time.sleep(3)
         test=driver.find_elements_by_class_name("ant-message")
         text=test[0].text
         self.assertEqual(text,'Update Done')
         driver.save_screenshot(admin_images+"/test_04e_update_status_account_info.png")
Esempio n. 4
0
 def test_04c_update_address_account_info(self):
     driver = Login_Admin(self)
     with allure.step('Click  Tài Khoản'):
         driver.find_element_by_xpath(
             '//*[@id="wrapper"]/div[1]/ul/li[2]/a').click()
         time.sleep(1)
         self.assertEqual(driver.current_url,
                         'https://admin.myreales.tk/account/1')
     with allure.step('Click Random Account'):
         driver.find_element_by_xpath('//*[@id="content-wrapper"]/div/div[2]/div[2]/div/div/div/div/div/table/tbody/tr[3]').click()
         time.sleep(1)
         bodyText = driver.find_element_by_tag_name('body').text
         self.assertTrue("Thông tin chi tiết tài khoản" in bodyText)
     with allure.step('Update address'):
         i=random.randint(1,10)
         driver.find_element_by_xpath('//*[@id="address"]').clear()
         driver.find_element_by_xpath('//*[@id="address"]').send_keys('Ho Chi Minh',i)
         driver.find_element_by_xpath('//*[@id="content-wrapper"]/div/div[2]/div[2]/div[1]/div[2]/form/div[4]/div[1]/button').click()
         time.sleep(3)
         test=driver.find_elements_by_class_name("ant-message")
         text=test[0].text
         self.assertEqual(text,'Update Done')
         driver.save_screenshot(admin_images+"/test_04c_update_phone_account_info.png")