Opened 11 years ago
Closed 10 years ago
#11635 closed enhancement (fixed)
BetterTwill: Output path to HTML file as followable link
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.2 |
Component: | general | Version: | |
Severity: | normal | Keywords: | twill functional tests |
Cc: | Branch: | ||
Release Notes: |
When an HTML page is created due to an exception in the functional test suite, the URL of the file is used in the exception message so the terminal can create a clickable link. |
||
API Changes: | |||
Internal Changes: |
Description
When a twill test fails, we get output such as the following:
====================================================================== FAIL: runTest (__main__.TestDefaultHandler) Set default handler from the Basic Settings page. ---------------------------------------------------------------------- Traceback (most recent call last): File "trac/admin/tests/functional.py", line 133, in runTest tc.find(r'<option value="BatchModifyModule">BatchModifyModule' File "/home/user/Workspace/tracdev/teo-rjollos.git/trac/tests/functional/better_twill.py", line 225, in better_find raise twill.errors.TwillAssertionError(*args) TwillAssertionError: ('no match to \'<option value="BatchModifyModule">BatchModifyModule</option>\'', '/home/user/Workspace/tracdev/teo-rjollos.git/testenv/trac/log/TestDefaultHandler.html')
I've wondered whether /home/user/Workspace/tracdev/teo-rjollos.git/testenv/trac/log/TestDefaultHandler.html
can be rendered in the terminal as a followable link for all OSs that we support, or at least for the most widely used ones (sh
and Windows Command Prompt, at least).
Attachments (0)
Change History (6)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
I don't use URL detection (I'm using PuTTY on Windows), but that's okay. Because Vim can open the file:///
resource. Also, I tried with ConEmu. The terminal detects file:///....html')
as a link.
I think the detection and message would be good to apply the following.
-
trac/tests/functional/better_twill.py
a b if twill: 221 223 tcfind(what, flags) 222 224 except twill.errors.TwillAssertionError as e: 223 225 filename = twill_write_html() 224 args = e.args + (filename,)225 raise twill.errors.TwillAssertionError(*args)226 raise twill.errors.TwillAssertionError('%s at %s' % 227 (unicode(e), filename))
Traceback (most recent call last): File "trac\admin\tests\functional.py", line 73, in runTest tc.find('https://my.example.com/something') File "C:\usr\src\trac\trac.git\trac\tests\functional\better_twill.py", line 227, in better_find (unicode(e), filename)) TwillAssertionError: no match to 'https://my.example.com/something' at file:///C:/usr/src/trac/trac.git/testenv/trac/log/TestBasicSettings.html
The link can open the html file on Firefox by clicking.
comment:3 by , 11 years ago
Milestone: | → 1.0.2 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:6 by , 10 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
I typically use Gnome Terminal. The feature I wish to take advantage of is URL detection. This could be accomplished with a change such as the following:
trac/tests/functional/better_twill.py
from os.path import abspath, dirname, joinfilenameThe output would be:
rather than:
and a CTRL+click while hovering over the file URL opens the file in the default web browser.
However, I've not evaluated the cross-platform or cross-terminal usability of the change.