How to use __add_driverjs_tour_step method in SeleniumBase

Best Python code snippet using SeleniumBase

base_case.py

Source:base_case.py Github

copy

Full Screen

...3371 self.__add_bootstrap_tour_step(3372 message, selector=selector, name=name, title=title,3373 alignment=alignment, duration=duration)3374 elif "DriverJS" in self._tour_steps[name][0]:3375 self.__add_driverjs_tour_step(3376 message, selector=selector, name=name, title=title,3377 alignment=alignment)3378 elif "Hopscotch" in self._tour_steps[name][0]:3379 self.__add_hopscotch_tour_step(3380 message, selector=selector, name=name, title=title,3381 alignment=alignment)3382 elif "IntroJS" in self._tour_steps[name][0]:3383 self.__add_introjs_tour_step(3384 message, selector=selector, name=name, title=title,3385 alignment=alignment)3386 else:3387 self.__add_shepherd_tour_step(3388 message, selector=selector, name=name, title=title,3389 theme=theme, alignment=alignment)3390 def __add_shepherd_tour_step(self, message, selector=None, name=None,3391 title=None, theme=None, alignment=None):3392 """ Allows the user to add tour steps for a website.3393 @Params3394 message - The message to display.3395 selector - The CSS Selector of the Element to attach to.3396 name - If creating multiple tours at the same time,3397 use this to select the tour you wish to add steps to.3398 title - Additional header text that appears above the message.3399 theme - (NON-Bootstrap Tours ONLY) The styling of the tour step.3400 Choose from "light"/"arrows", "dark", "default", "square",3401 and "square-dark". ("arrows" is used if None is selected.)3402 alignment - Choose from "top", "bottom", "left", and "right".3403 ("top" is the default alignment).3404 """3405 if theme == "default":3406 shepherd_theme = "shepherd-theme-default"3407 elif theme == "dark":3408 shepherd_theme = "shepherd-theme-dark"3409 elif theme == "light":3410 shepherd_theme = "shepherd-theme-arrows"3411 elif theme == "arrows":3412 shepherd_theme = "shepherd-theme-arrows"3413 elif theme == "square":3414 shepherd_theme = "shepherd-theme-square"3415 elif theme == "square-dark":3416 shepherd_theme = "shepherd-theme-square-dark"3417 else:3418 shepherd_base_theme = re.search(3419 r"[\S\s]+classes: '([\S\s]+)',[\S\s]+",3420 self._tour_steps[name][0]).group(1)3421 shepherd_theme = shepherd_base_theme3422 shepherd_classes = shepherd_theme3423 if selector == "html":3424 shepherd_classes += " shepherd-orphan"3425 buttons = "firstStepButtons"3426 if len(self._tour_steps[name]) > 1:3427 buttons = "midTourButtons"3428 step = ("""3429 tour.addStep('%s', {3430 title: '%s',3431 classes: '%s',3432 text: '%s',3433 attachTo: {element: '%s', on: '%s'},3434 buttons: %s,3435 advanceOn: '.docs-link click'3436 });""" % (3437 name, title, shepherd_classes, message, selector, alignment,3438 buttons))3439 self._tour_steps[name].append(step)3440 def __add_bootstrap_tour_step(self, message, selector=None, name=None,3441 title=None, alignment=None, duration=None):3442 """ Allows the user to add tour steps for a website.3443 @Params3444 message - The message to display.3445 selector - The CSS Selector of the Element to attach to.3446 name - If creating multiple tours at the same time,3447 use this to select the tour you wish to add steps to.3448 title - Additional header text that appears above the message.3449 alignment - Choose from "top", "bottom", "left", and "right".3450 ("top" is the default alignment).3451 duration - (Bootstrap Tours ONLY) The amount of time, in seconds,3452 before automatically advancing to the next tour step.3453 """3454 if selector != "html":3455 selector = self.__make_css_match_first_element_only(selector)3456 element_row = "element: '%s'," % selector3457 else:3458 element_row = ""3459 if not duration:3460 duration = "0"3461 else:3462 duration = str(float(duration) * 1000.0)3463 step = ("""{3464 %s3465 title: '%s',3466 content: '%s',3467 orphan: true,3468 placement: 'auto %s',3469 smartPlacement: true,3470 duration: %s,3471 },""" % (element_row, title, message, alignment, duration))3472 self._tour_steps[name].append(step)3473 def __add_driverjs_tour_step(self, message, selector=None, name=None,3474 title=None, alignment=None):3475 """ Allows the user to add tour steps for a website.3476 @Params3477 message - The message to display.3478 selector - The CSS Selector of the Element to attach to.3479 name - If creating multiple tours at the same time,3480 use this to select the tour you wish to add steps to.3481 title - Additional header text that appears above the message.3482 alignment - Choose from "top", "bottom", "left", and "right".3483 ("top" is the default alignment).3484 """3485 message = (3486 '<font size=\"3\" color=\"#33477B\"><b>' + message + '</b></font>')3487 title_row = ""...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run SeleniumBase automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful