How to use the apiritif.smart_transaction function in apiritif

To help you get started, we’ve selected a few apiritif examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Blazemeter / taurus / tests / resources / selenium / generated_from_requests_remote.py View on Github external
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")
github Blazemeter / taurus / tests / resources / selenium / test_new_flow.py View on Github external
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()
github Blazemeter / taurus / tests / resources / apiritif / test_transactions.py View on Github external
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)
github Blazemeter / taurus / tests / resources / selenium / test_new_flow.py View on Github external
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")
github Blazemeter / taurus / tests / resources / apiritif / test_codegen.py View on Github external
def _1_just_get(self):
        with apiritif.smart_transaction('just get'):
            response = self.target.get('/')
github Blazemeter / taurus / tests / resources / apiritif / test_transactions.py View on Github external
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',
            })
github Blazemeter / taurus / tests / resources / apiritif / test_data_sources.py View on Github external
def _1_an(self):
        with apiritif.smart_transaction(self.vars['an']):
            response = self.target.get(self.vars['an'])