Skip to content

Commit d07e772

Browse files
committed
Update DriverJS tours
1 parent f76ccdd commit d07e772

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3211,16 +3211,17 @@ def create_driverjs_tour(self, name=None):
32113211
"""
32123212
// DriverJS Tour
32133213
var tour = new Driver({
3214-
animate: false, // Animate while changing highlighted element
3215-
opacity: 0.15, // Background opacity (0: no popover / overlay)
3214+
opacity: 0.24, // Background opacity (0: no popover / overlay)
3215+
padding: 6, // Distance of element from around the edges
32163216
allowClose: false, // Whether clicking on overlay should close
32173217
overlayClickNext: false, // Move to next step on overlay click
3218-
doneBtnText: 'Done', // Text on the final button
3219-
closeBtnText: 'Close', // Text on the close button
3220-
nextBtnText: 'Next', // Next button text for this step
3221-
prevBtnText: 'Previous', // Previous button text for this step
3222-
showButtons: true, // Do not show control buttons in footer
3218+
doneBtnText: 'Done', // Text that appears on the Done button
3219+
closeBtnText: 'Close', // Text appearing on the Close button
3220+
nextBtnText: 'Next', // Text that appears on the Next button
3221+
prevBtnText: 'Previous', // Text appearing on Previous button
3222+
showButtons: true, // This shows control buttons in the footer
32233223
keyboardControl: true, // (escape to close, arrow keys to move)
3224+
animate: true, // Animate while changing highlighted element
32243225
});
32253226
tour.defineSteps([
32263227
""")
@@ -3441,8 +3442,6 @@ def __add_driverjs_tour_step(self, message, selector=None, name=None,
34413442
alignment - Choose from "top", "bottom", "left", and "right".
34423443
("top" is the default alignment).
34433444
"""
3444-
if not selector:
3445-
selector = "html"
34463445
message = (
34473446
'<font size=\"3\" color=\"#33477B\"><b>' + message + '</b></font>')
34483447
title_row = ""
@@ -3452,21 +3451,24 @@ def __add_driverjs_tour_step(self, message, selector=None, name=None,
34523451
else:
34533452
title_row = "title: '%s'," % title
34543453
align_row = "position: '%s'," % alignment
3455-
if selector == "html":
3454+
ani_row = "animate: true,"
3455+
if not selector or selector == "html" or selector == "body":
34563456
selector = "body"
3457-
align_row = "position: '%s'," % "bottom"
3457+
ani_row = "animate: false,"
3458+
align_row = "position: '%s'," % "mid-center"
34583459
element_row = "element: '%s'," % selector
3459-
description_row = "description: '%s'," % message
3460+
desc_row = "description: '%s'," % message
34603461

34613462
step = ("""{
3463+
%s
34623464
%s
34633465
popover: {
34643466
className: 'popover-class',
34653467
%s
34663468
%s
34673469
%s
34683470
}
3469-
},""" % (element_row, title_row, description_row, align_row))
3471+
},""" % (element_row, ani_row, title_row, desc_row, align_row))
34703472

34713473
self._tour_steps[name].append(step)
34723474

0 commit comments

Comments
 (0)