In run-tests.sh, add an --xml-verbose argument allowing saving screen captures as artifacts

Created on 20 August 2014, almost 11 years ago
Updated 31 July 2025, 5 days ago

Motivation

When running tests in the GUI, it is often useful to look at the screenshots (HTML code) as seen by the test, for example if a certain word should appear in the HTML and does not appear, examining the HTML code can give us a good idea why is it not appearing.

If you have a continuous integration server running something like:

php scripts/run-tests.sh --verbose --xml path/to/artifacts my_website

You will see the test results (passes) as console output for each build, and if you save path/to/artifacts for each build, you will have access to failure messages in XML format.

Currently, though, there seems to be no way to keep screen capture HTML files as artifacts. Doing so would be useful in case a continuous integration server detects a failure for a given commit: one could then have a further tool (screen capture HTML files) to diagnose the problem.

Proposed approach

An issue is currently open, #2253999: Provide a way to keep test results and verbose messages as artifacts β†’ , which proposes a new unified way to output test results for continuous integration servers to use as artifacts. I have also submitted a pull request to the drush project which allows this. The latter request has been closed because it's outside the scope of Drush. The former might take a while to be developed.

For those who need this functionality soon, a simple argument --xml-verbose to scripts/run-tests.sh might suffise, for now. So, running:

php scripts/run-tests.sh --verbose --xml path/to/artifacts --xml-verbose my_website

would do two things:

(1) add the xml file lines for the HTML screen captures, in the correct order.
(2) copy the HTML screen capture files from sites/default/files/simpletest/verbose/* to the xml directory (for example path/to/artifacts)

Once we have that, we can set our continuous integration server to save, for each build, whatever is in path/to/artifacts for later use in diagnostics.

✨ Feature request
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

simpletest.module

Created by

πŸ‡¨πŸ‡¦Canada alberto56

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for sharing your idea for improving Drupal.

    We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024