Permalink
Browse files

Add support for running the testsuite in Opera

  • Loading branch information...
gsnedders committed Mar 5, 2012
1 parent 2166dbe commit 5130903cc509956a078e492f16861f88b720980b
Showing with 20 additions and 1 deletion.
  1. +3 −0 test/resources/opera/operaprefs.ini
  2. +17 −1 test/test.py
@@ -0,0 +1,3 @@
+[State]
+Accept License=1
+
View
@@ -280,14 +280,30 @@ def start(self, url):
"--no-first-run", "--disable-sync", url])
self.process = subprocess.Popen(cmds, stdout = self.browserLog, stderr = self.browserLog)
+class OperaBrowserCommand(BaseBrowserCommand):
+ def _fixupMacPath(self):
+ self.path = os.path.join(self.path, "Contents", "MacOS", "Opera")
+
+ def setup(self):
+ super(OperaBrowserCommand, self).setup()
+ shutil.copytree(os.path.join(DOC_ROOT, "test", "resources", "opera"),
+ self.profileDir)
+
+ def start(self, url):
+ cmds = [self.path]
+ cmds.extend(["-pd", self.profileDir, "-nosession", url])
+ print repr(cmds)
+ self.process = subprocess.Popen(cmds, stdout = self.browserLog, stderr = self.browserLog)
+
def makeBrowserCommand(browser):
path = browser["path"].lower()
name = browser["name"]
if name is not None:
name = name.lower()
types = {"firefox": FirefoxBrowserCommand,
- "chrome": ChromeBrowserCommand }
+ "chrome": ChromeBrowserCommand,
+ "opera": OperaBrowserCommand }
command = None
for key in types.keys():
if (name and name.find(key) > -1) or path.find(key) > -1:

0 comments on commit 5130903

Please sign in to comment.