[meta] Add tests for the WebAssert class

Created on 17 July 2020, over 4 years ago
Updated 2 August 2023, over 1 year ago

Testing for methods in the WebAssert class are either missing or spread around (some testing happens in BrowserTestBaseTest).

#3133355: Introduce PHPUnit-compliant WebAssert::responseHeaderExists() method, and its negative introduced a dedicated WebAssertTest test class.

That class should be enriched by adding/moving specific WebAssert methods' tests.

This meta tracks sub-issues to get there.

Sub-issues:

📌 Task
Status

Active

Version

11.0 🔥

Component
PHPUnit 

Last updated about 5 hours ago

Created by

🇮🇹Italy mondrake 🇮🇹

Live updates comments and jobs are added and updated live.
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 Kingdom nlisgo

    Once 📌 Move BrowserTestBaseTest tests checking WebAssert methods to WebAssertTest Fixed is in we will have coverage for the following methods in WebAssertTest:

    • addressEquals
    • addressNotEquals
    • assertEscaped
    • assertNoEscaped
    • buttonExists
    • buttonNotExists
    • elementTextEquals
    • linkExists
    • linkExistsExact
    • linkNotExistsExact
    • pageContainsNoDuplicateId
    • pageTextContainsOnce
    • pageTextMatchesCount
    • responseContains
    • responseHeaderDoesNotExist
    • responseHeaderExists
    • responseNotContains

    We are still lacking tests for the following:

    • assert
    • buildXPathQuery
    • fieldDisabled
    • fieldEnabled
    • hiddenFieldExists
    • hiddenFieldNotExists
    • hiddenFieldValueEquals
    • hiddenFieldValueNotEquals
    • linkByHrefExists
    • linkByHrefNotExists
    • linkNotExists
    • optionExists
    • optionNotExists
    • responseNotContains
    • selectExists
    • statusMessageContains
    • statusMessageExists
    • statusMessageNotContains
    • statusMessageNotExists
    • titleEquals

    We should create an issue for these but I suggest that it will be easier to get them in if we break them down into a few MR's.

Production build 0.71.5 2024