MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / activate_bootstrap

Function activate_bootstrap

seleniumbase/core/tour_helper.py:17–45  ·  view source on GitHub ↗

Allows you to use Bootstrap Tours with SeleniumBase http://bootstraptour.com/

(driver)

Source from the content-addressed store, hash-verified

15
16
17def 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
48def is_bootstrap_activated(driver):

Callers 1

play_bootstrap_tourFunction · 0.85

Calls 8

add_css_styleMethod · 0.80
wait_for_angularjsMethod · 0.80
activate_jqueryMethod · 0.80
add_css_linkMethod · 0.80
add_js_linkMethod · 0.80
sleepMethod · 0.45
execute_scriptMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…