Allows you to use Bootstrap Tours with SeleniumBase http://bootstraptour.com/
(driver)
| 15 | |
| 16 | |
| 17 | def activate_bootstrap(driver): |
| 18 | """Allows you to use Bootstrap Tours with SeleniumBase |
| 19 | http://bootstraptour.com/ |
| 20 | """ |
| 21 | bootstrap_tour_css = constants.BootstrapTour.MIN_CSS |
| 22 | bootstrap_tour_js = constants.BootstrapTour.MIN_JS |
| 23 | |
| 24 | verify_script = """// Verify Bootstrap Tour activated |
| 25 | var tour2 = new Tour({ |
| 26 | });""" |
| 27 | |
| 28 | backdrop_style = style_sheet.get_bt_backdrop_style() |
| 29 | js_utils.add_css_style(driver, backdrop_style) |
| 30 | js_utils.wait_for_ready_state_complete(driver) |
| 31 | js_utils.wait_for_angularjs(driver) |
| 32 | for x in range(4): |
| 33 | js_utils.activate_jquery(driver) |
| 34 | js_utils.add_css_link(driver, bootstrap_tour_css) |
| 35 | js_utils.add_js_link(driver, bootstrap_tour_js) |
| 36 | time.sleep(0.1) |
| 37 | for x in range(int(settings.MINI_TIMEOUT * 2.0)): |
| 38 | # Bootstrap needs a small amount of time to load & activate. |
| 39 | try: |
| 40 | driver.execute_script(verify_script) |
| 41 | time.sleep(0.05) |
| 42 | return |
| 43 | except Exception: |
| 44 | time.sleep(0.15) |
| 45 | js_utils.raise_unable_to_load_jquery_exception(driver) |
| 46 | |
| 47 | |
| 48 | def is_bootstrap_activated(driver): |
no test coverage detected
searching dependent graphs…