Skip to content

Page-content assertions (such as those in assertResponse()) needs clarification #17

Open
@brodriguez8774

Description

@brodriguez8774

Applies when given a page and testing multiple content items in a row, while ALSO not disabling the enforce ordering logic.

In such a case, if testing for text that appears at multiple points for a page, it seems to always remove the largest amount of content possible out of future search-spaces.

FOR EXAMPLE, given a page with something like:

<ul>
  <li><p>Bob Brown<p></li>
  <li><p>John Kerry<p></li>
  <li><p>Jim Smith<p></li>
  <li><p>Jenny Johnson<p></li>
  <li><p>Samantha Applestien<p></li>
</ul>

Adding a content check for "john" seems to eliminate all values from future search spaces up to the "John" part of "Jenny Johnson". When in reality, a user might expect it to only go to the "John" part of "John Kerry".

Thus, if you add another content check in the same assertion of "Jim Smith", the test will fail because "ordering is wrong". Which seems potentially a bit misleading.


In reality, there should probably be a project-setting that allows "searching the largest possible range" or "searching the smallest possible range". That way, handling can at least be determined on a per-project basis. Probably with the "least inclusive" option being the default?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions