Skip to content

Commit

Permalink
Opera driver (#92)
Browse files Browse the repository at this point in the history
* [qacode] adding opera browser support+test #85

* [qacode] missing lane
  • Loading branch information
netzulo committed Dec 12, 2017
1 parent 63a47e1 commit bcd392a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
6 changes: 5 additions & 1 deletion qacode/configs/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
"iexplorerdriver_32.exe",
"iexplorerdriver_64.exe",
"edgedriver_32.exe",
"edgedriver_64.exe"
"edgedriver_64.exe",
"operadriver_32.exe",
"operadriver_64.exe",
"operadriver_32",
"operadriver_64"
],
"log_output_file": "logs",
"log_name": "qacode"
Expand Down
9 changes: 9 additions & 0 deletions qacode/core/bots/bot_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ def mode_local(self):
executable_path=self.curr_driver_path,
desired_capabilities=self.curr_caps
)
elif browser_name == "opera":
self.curr_caps = DesiredCapabilities.OPERA.copy()
self.curr_driver = WebDriver.Opera(
executable_path=self.curr_driver_path,
desired_capabilities=self.curr_caps
)
else:
raise CoreException(
message=("config file error, SECTION=bot, KEY=browser isn't "
Expand Down Expand Up @@ -158,6 +164,9 @@ def mode_remote(self):

elif browser_name == 'edge':
self.curr_caps = DesiredCapabilities.EDGE.copy()

elif browser_name == 'opera':
self.curr_caps = DesiredCapabilities.OPERA.copy()
else:
raise CoreException(message='Bad browser selected')

Expand Down
15 changes: 15 additions & 0 deletions tests/001_functionals/suite_000_botbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,18 @@ def test_010_bot_remote_edge(self):
self.assertEqual(bot.curr_caps['browserName'], 'MicrosoftEdge')
bot.close()
self.log.debug("TestBotBase: REMOTE terminated for EDGE")

@skipIf(True, 'Issue opened on official opera chromium github')
def test_011_bot_remote_opera(self):
"""Testcase: test_011_bot_remote_opera
ISSUE OPENED : https://github.com/operasoftware/operachromiumdriver/issues/9
"""
self.log.debug("TestBotBase: REMOTE started for OPERA")
self.bot_config.config['browser'] = 'opera'
self.bot_config.config['mode'] = 'remote'
bot = BotBase(self.bot_config)
self.timer(wait=WAIT_TO_CLOSE)
self.assertEqual(bot.curr_caps['browserName'], 'opera')
bot.close()
self.log.debug("TestBotBase: REMOTE terminated for OPERA")

0 comments on commit bcd392a

Please sign in to comment.