Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved test stability and messaging #13434

Merged
merged 2 commits into from
Aug 10, 2023

Conversation

marcusmoore
Copy link
Collaborator

Description

This tiny PR simply improves some of our custom test response helpers by escaping the model property being checked and adding a help messages that are displayed during failures.

It was rare but I noticed sporadic failures running tests locally when faker generated a name within a factory that had punctuation in it. For example, looking for the generated name O'Shea would fail because API responses have the values escaped so we should actually be looking for O'Shea.

@what-the-diff
Copy link

what-the-diff bot commented Aug 10, 2023

PR Summary

  • Assertion Updates in CustomTestMacros.php
    The updates provide improvements to our system's testing process. Changes were made in our support file CustomTestMacros.php as follows:

    • Line 28 : Error Message Inclusion in Assertions
      We updated one of our positive check methods to provide an error message if the expected result isn't found. Now, it also safeguards against HTML character anomalies by wrapping the value it checks within a special function (e helper function).

    • ** Line 41 : Error Message Inclusion for When Unwanted Values Arise**
      Similarly, we updated one of our negative check methods to alert us by producing an error message if there's something in the response that should not have been there. This method now also wraps the checked value in a function (e helper function) to handle any HTML-specific characters.

    • Line 54 & 67 : Improvements to JSON response checks
      We applied similar changes for two methods that handle JSON responses, thereby making them more thorough and reliable. Like before, these methods will now generate error messages if they encounter something unexpected in the JSON response, and they also take special care of HTML characters by using the e helper function.

@snipe snipe merged commit a599f0c into snipe:develop Aug 10, 2023
@marcusmoore marcusmoore deleted the chore/improve-test-stability branch August 10, 2023 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants