The attached patch adds tiny links (actually 'v' characters that imitate down arrows) to the log messages list. You need to have some error rows to see any difference.

I find this an enormous help in working with long tests.

Comments

bleen’s picture

Not sure if this is better than a "v" character, but have you considered ↓(↓) instead?

Overall .. this is a nice improvement for simpletest

salvis’s picture

Thank you for your feedback, bleen18!

With default styling the ↓ is very thin. Is there a bolder down arrow hiding somewhere in the Unicode plainsplanes?

Also, I have no experience of how well these special characters are supported.

bleen’s picture

Hmm... what about this: ▼(▼) I suppose I'm just looking for something more semantically correct

salvis’s picture

Status: Active » Needs review
StatusFileSize
new2.97 KB

Yes, the ▼ looks pretty nice.

Here's a new patch (this is the only change).

salvis’s picture

This still applies to HEAD.

@bleen18: Care to RTBC this with the change that you requested?

bleen’s picture

I think this needs at one other look before it can be marked RTBC ... Everything looks good to me but I'm not familiar enough with the ins and outs of the simpletest module to know if there are any weird ramifications of this. I doubt it, but...

salvis’s picture

salvis’s picture

Version: 7.x-dev » 8.x-dev

Nice, it still applies.

I have seven tests that give me the following result:

#1: 3759 passes, 52 fails, and 0 exceptions
#2: 3495 passes, 39 fails, and 0 exceptions
#3: 3330 passes, 45 fails, and 8 exceptions
#4: 3052 passes, 29 fails, and 12 exceptions
#5: 3281 passes, 47 fails, and 8 exceptions
#6: 3024 passes, 25 fails, and 8 exceptions
#7: 949 passes, 36 fails, and 22 exceptions

The patch here adds anchors and links to the huge report so that I can easily jump from one fail/exception to the next. I find this pretty much indispensable...

The patch still applies to 8.x, too.

salvis’s picture

danillonunes’s picture

What about a title attribute or something like that explaining where the link goes to?

salvis’s picture

It's an arrow pointing downwards. If you have lots of fails/exceptions, you'd have thousands of title attributes that serve just about no purpose. This is intentionally lean.

There's no harm if someone doesn't find it. Besides, SimpleTest is only used by developers (and possibly site admins) — it does not need to cater to the dumbest possible user.

sun’s picture

Status: Needs review » Needs work
+++ modules/simpletest/simpletest.pages.inc	17 Oct 2010 16:44:05 -0000
@@ -225,6 +225,7 @@
+    '#title_tag' => simpletest_tag(),

@@ -252,8 +254,9 @@
     foreach ($assertions as $assertion) {
...
+      $row[] = ($ok ? '' : simpletest_tag(TRUE)) . $assertion->message;

It would be much more cleaner if the jump ID incrementing logic would be part of the theme function, instead of the helper function.

Furthermore, I don't think we want jump IDs and links for every single failing assertion in a row that merely point to the next line. That's too much clutter. Instead, we need some more intelligent logic that jumps to the next block of failed assertions. Possibly output that link for the last failed assertion of the last block of failed assertions.

+++ modules/simpletest/simpletest.pages.inc	17 Oct 2010 16:44:05 -0000
@@ -245,6 +246,7 @@
+      '#collapsed' => TRUE,

The change to reverse the #collapsed logic is not required for this patch.

+++ modules/simpletest/simpletest.pages.inc	17 Oct 2010 16:44:05 -0000
@@ -335,6 +344,19 @@
+  return '<a id="jump-' . $id . '" href="#jump-' . (++$id) . '" style="position: relative; left: ' . ($adjust ? '-1.8em' : '-1em') . '; top: ' . ($adjust ? '-4em' : '0') . ';">&#9660;</a>';

Obviously, inline styles are discouraged. That's what CSS classes are for.

13 days to next Drupal core point release.

salvis’s picture

Thank you for your review!

It would be much more cleaner if the jump ID incrementing logic would be part of the theme function, instead of the helper function.

Which theme function? Do you mean simpletest_result_form() rather than simpletest_tag()?

I'm not sure. Encapsulating this in simpletest_tag() is pretty clean IMHO, compared to handling it outside of the function.

Furthermore, I don't think we want jump IDs and links for every single failing assertion in a row that merely point to the next line. That's too much clutter. Instead, we need some more intelligent logic that jumps to the next block of failed assertions. Possibly output that link for the last failed assertion of the last block of failed assertions.

Let's discuss this. I like having the 'next' links in the top left corner of the browser window. This lets me click through every fail without ever having to move the mouse. Granted, I click more often, but you are still free to scroll and click only on the last link in a group if that's what you prefer.

The links are as unobtrusive as possible. Removing them diminishes the UX and removes a mode of operation for no good reason.

chx’s picture

Issue tags: +Novice

I like this patch too but I have my doubts over inline styles and even the inline HTML. Can you or someone else reroll using l() and a CSS file please? I do not think we need to move the counter -- having the counter in simpletest_tag() is better in the rare case you have several simpletest results on one screen. And, I do not think it's such a clutter either.

So I think this classifies as novice material now -- just convert the link to a proper Drupal link + CSS please. Thanks!

salvis’s picture

Status: Needs work » Needs review
StatusFileSize
new3.35 KB

Ok, rerolled according to #14.

chx’s picture

Status: Needs review » Reviewed & tested by the community

I like this. I will let the maintainers decide whether they like it too.

sun’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -Novice +DX (Developer Experience)
StatusFileSize
new91.06 KB
new273.38 KB

Hrm. The first attached screenshot shows what I see with this patch applied.

The resulting UI of this is not really great. The arrows/jump-links appear in very unusual positions - partially clashing with the UI patterns of existing page elements.


I spent quite some time thinking about this, since I investigated similar ideas for potential inclusion in http://drupal.org/project/admin_ux

Meanwhile, I think an actual improvement would be to have a "sticky test results navigator."

We not only want to navigate in test results. The next best most cumbersome UI operation is to run the failing tests again, or alternatively, get back to the test overview/list page. In both cases, that usually involves quite some page scrolling, too - which is the reason for why I see these issues to be closely related, or actually, to be the same UI/UX problem space.

Thus, I strongly believe we should implement this navigator instead. It behaves pretty much like the sticky table headers, but appears above them. The previous/next links are purely JS-driven and do not require any server-side changes at all.

Here is a quickly mocked screenshot for that:

simpletest-navigator.png

salvis’s picture

StatusFileSize
new4.55 KB

@sun: For some reason the CSS does not seem to work for you. Maybe you need to clear your cache? Here's what #15 looks like for me:

screenshot

The anchors need to be moved upwards to ensure that the message and the arrow is not obscured by the table header or a toolbar/admin_menu.

My idea is to make this as light and unobtrusive as possible. If you want to implement a navigator at some unknown time in the future, that's fine with me, but I need it now (actually two years ago and ever since) and it works just fine.

chi’s picture

Status: Needs work » Needs review
StatusFileSize
new141.3 KB
new5.75 KB

Let's try to fix the issue with js scrolling navigation.

Bojhan’s picture

I don't get why there insn't also just a toggle, to only see the fails.

chi’s picture

I don't get why there insn't also just a toggle, to only see the fails.

It isn't convenient for me. When error occurred I would like to know what happened before the fail. So I need to see green messages as well as verbose messages in close vicinity to the fail message.

dawehner’s picture

StatusFileSize
new3.3 KB
new5.69 KB
new40.21 KB

This is really really nice! Posting a screenshot to show.

error-list.png

This is just a cleanup of some pieces, though it feels that sun's idea seems to be the best in terms of experience and simplicity.

Status: Needs review » Needs work

The last submitted patch, 22: drupal-912460-22.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Project: Drupal core » SimpleTest
Version: 8.9.x-dev » 8.x-3.x-dev
Component: simpletest.module » Code
Issue summary: View changes

Triaging issues in simpletest.module to determine if they should be in the Simpletest Project or core.

This looks like it a simpletest module issue, changing the project.