Unit/System Tests bug PR-6.1-dev Pending

User tests: Successful: Unsuccessful:

avatar muhme
muhme
10 Jan 2026

Summary of Changes

System Tests are failing with #46631 as db_createCategory() hacks the category simplified in the database table. To prevent reimplementing nested set properly (lft/rgt/level/path) it is simple replaced by api_post() call.

  • Replaced all db_createCategory() by api_post()
  • Deleted db_createCategory() command in source and documentation
  • Unified all create category usage with beforeEach() deletion as recommended by Cypress.
    • This ensures even with test canceled in the middle of execution, the next test will work.
    • As there is no afterEach there may stay objects in instance, e.g. news feed category 'Automated System Tests Category Title feed delete'
  • Introduced support/constants.mjs with AST_CATEGORY_TITLE
    • Only used for the changed stuff, could be extended later
  • Note: There are 19 more db_* commands, but the other ones we would leave for performance reasons.

Testing Instructions

  • Code review is needed and requested before human tests
  • Human tests:
    • System Tests should run without error (this is already given by CI)
    • System Tests should run withouts errors including PR #46631
    • Single System Tests (without Joomla installation step) should be running multiple times without errors,
      choose one or multiple of the modified tests, e.g.
      npx cypress run --spec tests/System/integration/administrator/components/com_categories/Categories.cy.js
      npx cypress run --spec tests/System/integration/administrator/components/com_categories/Categories.cy.js
      
    • Check db_createCategory() is removed from source and documentation

Actual result BEFORE applying this Pull Request

  • System Tests failing with #46631

Expected result AFTER applying this Pull Request

  • System Tests passed with #46631

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar muhme muhme - open - 10 Jan 2026
avatar muhme muhme - change - 10 Jan 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Jan 2026
Category Administration com_categories Unit Tests Repository JavaScript
avatar brianteeman
brianteeman - comment - 10 Jan 2026

To prevent reimplementing nested set properly (lft/rgt/level/path) it is simple replaced by api_post() call.

surely that makes it an unrealistic test

avatar muhme
muhme - comment - 10 Jan 2026

@laoneo Could you please carry out a review before the testers start? It works with the PR, but is everything implemented as we need it, or could something be improved?

avatar muhme muhme - change - 10 Jan 2026
Labels Added: Unit/System Tests PR-6.1-dev
avatar joomla-cms-bot joomla-cms-bot - change - 10 Jan 2026
Category Administration com_categories Unit Tests Repository JavaScript Unit Tests Repository JavaScript
avatar muhme
muhme - comment - 10 Jan 2026

To prevent reimplementing nested set properly (lft/rgt/level/path) it is simple replaced by api_post() call.

surely that makes it an unrealistic test

There are tests that create a category in the backend. What we are talking about here is that if we need to create categories as a prerequisite for other tests, the not fully implemented database table hack will be replaced by API call.

avatar muhme muhme - change - 10 Jan 2026
Labels Added: bug
avatar laoneo
laoneo - comment - 10 Jan 2026

I would move the api call to its own function and not call everywhere the api directly.

avatar tecpromotion tecpromotion - change - 11 Jan 2026
Title
System Tests – Replace db_createCategory() by API
[6.1] System Tests – Replace db_createCategory() by API
avatar tecpromotion tecpromotion - edited - 11 Jan 2026

Add a Comment

Login with GitHub to post a comment