Skip to content

Commit 798f9a9

Browse files
authored
Merge pull request #164 from seleniumbase/add-messenger
Add Messenger and update versions of selenium, pytest, and ipython
2 parents 8ca1165 + 438cf5b commit 798f9a9

File tree

7 files changed

+348
-26
lines changed

7 files changed

+348
-26
lines changed

help_docs/method_summary.md

+7
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ self.maximize_window()
8585

8686
self.activate_jquery()
8787

88+
self.activate_messenger()
89+
90+
self.post_message(message, style="info", duration=None)
91+
92+
self.set_messenger_theme(theme="default", location="default",
93+
max_messages="default")
94+
8895
self.get_property_value(selector, property, by=By.CSS_SELECTOR,
8996
timeout=settings.SMALL_TIMEOUT)
9097

requirements.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
pip
22
setuptools
3-
ipython==5.5.0
4-
selenium==3.8.1
3+
ipython==5.6.0
4+
selenium==3.11.0
55
nose==1.3.7
6-
pytest==3.5.0
7-
pytest-html==1.16.1
6+
pytest==3.5.1
7+
pytest-html==1.17.0
88
pytest-xdist==1.22.2
99
six==1.10.0
1010
flake8==3.5.0

seleniumbase/config/settings.py

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@
6666
# Each loop is about 0.18 seconds. (Override by using "--highlights=TIMES".)
6767
HIGHLIGHTS = 4
6868

69+
# Default time to keep messenger notifications visible (in seconds).
70+
# Messenger notifications appear when reaching assert statements in Demo Mode.
71+
DEFAULT_MESSAGE_DURATION = 2.55
6972

7073
# #####>>>>>----- MasterQA SETTINGS -----<<<<<#####
7174
# ##### (Used when importing MasterQA as the parent class)

seleniumbase/fixtures/base_case.py

+315-17
Large diffs are not rendered by default.

seleniumbase/plugins/pytest_plugin.py

+6
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ def pytest_addoption(parser):
107107
default=None,
108108
help="""Setting this overrides the default number of
109109
highlight animation loops to have per call.""")
110+
parser.addoption('--message_duration', action="store",
111+
dest='message_duration',
112+
default=None,
113+
help="""Setting this overrides the default time that
114+
messenger notifications remain visible when reaching
115+
assert statements during Demo Mode.""")
110116
parser.addoption('--ad_block', action="store_true",
111117
dest='ad_block_on',
112118
default=False,

seleniumbase/plugins/selenium_plugin.py

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class SeleniumBrowser(Plugin):
2222
self.options.demo_mode -- the option to slow down Selenium (--demo_mode)
2323
self.options.demo_sleep -- Selenium action delay in DemoMode (--demo_sleep)
2424
self.options.highlights -- # of highlight animations shown (--highlights)
25+
self.options.message_duration -- Messenger alert time (--message_duration)
2526
self.options.ad_block -- the option to block some display ads (--ad_block)
2627
self.options.verify_delay -- delay before MasterQA checks (--verify_delay)
2728
self.options.timeout_multiplier -- increase defaults (--timeout_multiplier)
@@ -85,6 +86,12 @@ def options(self, parser, env):
8586
dest='highlights', default=None,
8687
help="""Setting this overrides the default number of
8788
highlight animation loops to have per call.""")
89+
parser.add_option(
90+
'--message_duration', action="store",
91+
dest='message_duration', default=None,
92+
help="""Setting this overrides the default time that
93+
messenger notifications remain visible when reaching
94+
assert statements during Demo Mode.""")
8895
parser.add_option(
8996
'--ad_block', action="store_true",
9097
dest='ad_block_on',
@@ -119,6 +126,7 @@ def beforeTest(self, test):
119126
test.test.demo_mode = self.options.demo_mode
120127
test.test.demo_sleep = self.options.demo_sleep
121128
test.test.highlights = self.options.highlights
129+
test.test.message_duration = self.options.message_duration
122130
test.test.ad_block_on = self.options.ad_block_on
123131
test.test.verify_delay = self.options.verify_delay # MasterQA
124132
test.test.timeout_multiplier = self.options.timeout_multiplier

setup.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name='seleniumbase',
10-
version='1.9.0',
10+
version='1.10.0',
1111
description='Web Automation & Testing Framework - http://seleniumbase.com',
1212
long_description='Web Automation and Testing Framework - seleniumbase.com',
1313
platforms='Mac * Windows * Linux * Docker',
@@ -19,11 +19,11 @@
1919
install_requires=[
2020
'pip',
2121
'setuptools',
22-
'ipython==5.5.0',
23-
'selenium==3.8.1',
22+
'ipython==5.6.0',
23+
'selenium==3.11.0',
2424
'nose==1.3.7',
25-
'pytest==3.5.0',
26-
'pytest-html==1.16.1',
25+
'pytest==3.5.1',
26+
'pytest-html==1.17.0',
2727
'pytest-xdist==1.22.2',
2828
'six==1.10.0',
2929
'flake8==3.5.0',

0 commit comments

Comments
 (0)