Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _1_(self):
with apiritif.smart_transaction('/'):
self.driver.get('http://blazedemo.com/')
var_loc_wait = self.loc_mng.get_locator([{
'xpath': "//input[@type='submit']",
}])
WebDriverWait(self.driver, 3.5).until(econd.presence_of_element_located((
var_loc_wait[0],
var_loc_wait[1])), 'Element \'xpath\':"//input[@type=\'submit\']" failed to appear within 3.5s')
self.assertEqual(self.driver.title, 'BlazeDemo')
body = self.driver.page_source
re_pattern = re.compile('contained_text')
self.assertEqual(0, len(re.findall(re_pattern, body)), "Assertion: 'contained_text' found in BODY")
def _1_t1(self):
with apiritif.smart_transaction('t1'):
self.driver.get('http://blazedemo.com/purchase.php')
self.driver.find_element(By.CSS_SELECTOR, 'input.btn.btn-primary').click()
def _3_t2(self):
with apiritif.smart_transaction('t_2'):
response = apiritif.http.get('url_2.0')
sleep(2.0)
with apiritif.transaction('t_22'):
response = apiritif.http.get('url_22.0')
sleep(3.0)
def _2_t2(self):
with apiritif.smart_transaction('t2'):
self.driver.get('https://www.belarus.by/en/')
body = self.driver.page_source
re_pattern = re.compile('In God we trust')
self.assertNotEqual(0, len(re.findall(re_pattern, body)), "Assertion: 'In God we trust' not found in BODY")
def _1_just_get(self):
with apiritif.smart_transaction('just get'):
response = self.target.get('/')
def _2_empty(self):
with apiritif.smart_transaction('empty'):
pass
def _2_t1(self):
with apiritif.smart_transaction('t_1'):
response = apiritif.http.get('url_1.0')
response = apiritif.http.get('url_1.1', headers={
'o': 'ne',
't': 'wo',
})
def _1_an(self):
with apiritif.smart_transaction(self.vars['an']):
response = self.target.get(self.vars['an'])