class Post_Test(unittest.TestCase): post_req = Request_Post response = post_req.send_post_request( readExcel('../Data/data_webservices.xlsx', 'Sheet1', 'B3'), json.loads(readExcel('../Data/data_webservices.xlsx', 'Sheet1', 'C3'))) print(response.status_code) assert response.status_code == 200
class Get_Test(unittest.TestCase): get_req = Request_Get response = get_req.send_get_request( readExcel('../Data/data_webservices.xlsx', 'Sheet1', 'B2')) assert response['City'] == readExcel('../Data/data_webservices.xlsx', 'Sheet1', 'D2') assert response['Humidity'] == readExcel('../Data/data_webservices.xlsx', 'Sheet1', 'E2')
class Get_Test(unittest.TestCase): get_req = Request_Get response = get_req.send_get_request(readExcel('../Data/data.xlsx','Sheet1','B2')) assert response['City'] == readExcel('../Data/data.xlsx','Sheet1','D2') assert response['Humidity'] == readExcel('../Data/data.xlsx','Sheet1','E2') response = get_req.send_get_request_with_Auth ('https://api.github.com/user','lanka', 'jaya' ) assert response['message'] == 'Must specify two-factor authentication OTP code.'
def test_search_in_python_org(self): with open('./Data/data.json', encoding='utf-8') as data_file: data = json.loads(data_file.read()) driver = self.driver str1 = readExcel('./Data/data.xlsx', 'Sheet1', 'A2') driver.get(str1) speechReporting("Navigated to the web site") scr = takeScreenShot('sc2.png', self.driver) driver.save_screenshot('./ScreenShots/sc1.png') driver.set_page_load_timeout(20) m = Home(driver) m.getRegister().click() r = Register(driver) r.setFirstName(readExcel('./Data/data.xlsx', 'Sheet1', 'B2')) r.setLastName(readExcel('./Data/data.xlsx', 'Sheet1', 'C2')) r.setPhone(readExcel('./Data/data.xlsx', 'Sheet1', 'G2')) r.setCountry(readExcel('./Data/data.xlsx', 'Sheet1', 'D2')) r.setEmail(readExcel('./Data/data.xlsx', 'Sheet1', 'H2')) r.setUserName(readExcel('./Data/data.xlsx', 'Sheet1', 'E2')) r.setPassword(readExcel('./Data/data.xlsx', 'Sheet1', 'I2')) r.setConfirmPassword(readExcel('./Data/data.xlsx', 'Sheet1', 'I2')) scr = takeScreenShot('sc3.png', self.driver) speechReporting("Data entered and registration completed") r.submitRegistration() if __name__ == "__main__": unittest.main()
def step_impl(context): r = Register(driver) r.setFirstName(readExcel('./Data/data.xlsx', 'Sheet1', 'B2')) r.setLastName(readExcel('./Data/data.xlsx', 'Sheet1', 'C2')) r.setPhone(readExcel('./Data/data.xlsx', 'Sheet1', 'G2')) r.setCountry(readExcel('./Data/data.xlsx', 'Sheet1', 'D2')) r.setEmail(readExcel('./Data/data.xlsx', 'Sheet1', 'H2')) r.setUserName(readExcel('./Data/data.xlsx', 'Sheet1', 'E2')) r.setPassword(readExcel('./Data/data.xlsx', 'Sheet1', 'I2')) r.setConfirmPassword(readExcel('./Data/data.xlsx', 'Sheet1', 'I2')) r.submitRegistration()
def setUp(self): with pytest.allure.step("Launch site"): if readExcel('./Data/data.xlsx', 'Browser_Conf', 'A2') == "Yes": chrome_options = Options() chrome_options.add_argument("--headless") self.driver = webdriver.Chrome(ChromeDriverManager().install(), chrome_options=chrome_options) else: self.driver = webdriver.Chrome(ChromeDriverManager().install())
def setUp(self): if readExcel('../Data/data.xlsx', 'Browser_Conf', 'A2') == "Yes": self.driver = webdriver.Chrome(ChromeDriverManager().install()) else: self.driver = webdriver.Chrome(ChromeDriverManager().install())
def step_impl(context): driver.get(readExcel('./Data/data.xlsx', 'A2')) driver.set_page_load_timeout(20) m = Home(driver) m.getRegister().click()
class Get_Test(unittest.TestCase): get_req = DeleteRequest response = get_req.send_delete_request( readExcel('../Data/data.xlsx', 'Sheet1', 'B4')) assert response.status_code == 204
def step_impl(context): assert response['City'] == readExcel( 'D:\code\Raccoon_Python_WebServices_Automation_Framework_V2\Data\data.xlsx', 'Sheet1', 'D2')
def step_impl(context): request_url = readExcel( 'D:\code\Raccoon_Python_WebServices_Automation_Framework_V2\Data\data.xlsx', 'Sheet1', 'B2')