Open in a new tab.

This commit is contained in:
Florian Bruhin 2015-10-13 07:14:32 +02:00
parent 4bf6359205
commit 6e786ff9b7
2 changed files with 6 additions and 3 deletions

View File

@ -29,7 +29,7 @@ def set_setting(quteproc, sect, opt, value):
@bdd.given(bdd.parsers.parse("I open {path}"))
def open_path(quteproc, path):
quteproc.open_path(path)
quteproc.open_path(path, new_tab=True)
@bdd.when(bdd.parsers.parse("I open {path}"))

View File

@ -142,10 +142,13 @@ class QuteProc(testprocess.Process):
with self._wait_signal(self.setting_done):
self.send_cmd(':set "{}" "{}" "{}"'.format(sect, opt, value))
def open_path(self, path):
def open_path(self, path, new_tab=False):
url = 'http://localhost:{}/{}'.format(self._httpbin.port, path)
with self._wait_signal(self.url_loaded):
self.send_cmd(':open ' + url)
if new_tab:
self.send_cmd(':open -t ' + url)
else:
self.send_cmd(':open ' + url)
@pytest.yield_fixture(scope='session', autouse=True)