Skip to content

Fixing and improving createMenuItem#28

Merged
laoneo merged 10 commits intojoomla-projects:mainfrom
muhme:fix-createMenuItem
Aug 7, 2024
Merged

Fixing and improving createMenuItem#28
laoneo merged 10 commits intojoomla-projects:mainfrom
muhme:fix-createMenuItem

Conversation

@muhme
Copy link
Copy Markdown
Contributor

@muhme muhme commented Jul 27, 2024

Problems found while documenting and testing the functionality:

  1. The custom command createMenuItem, working in Joomla 4, fails in Joomla 5 with:
AssertionError: Timed out retrying after 4000ms: Expected to find element: `.controls > .input-group > .btn`, but never found it.
  1. The language setting was not implemented

This PR makes createMenuItem

  • Working for the default and all active Joomla branches and
  • Implements setting the language.

Additional

  • Improving method comment (PR will follow for all methods)
  • Directly defining the function
  • Standardisation of the coding style by omitting single semicolons

Tests

This PR is extensively tested with test.cy.js based on joomla-cpress 1.1.0 plus #29:

  • Intel macOS 14.5 Sonoma native with Joomla 4.4-dev
  • Intel macOS 14.5 Sonoma docker-based with Joomla 4.4-dev, 5.1-dev, 5.2-dev and 6.0-dev
  • Windows 11 Pro Laragon with Joomla 5.1-dev
  • Windows 11 Pro WSL 2 docker-based with Joomla 4.4-dev, 5.1-dev, 5.2-dev and 6.0-dev

Sample test output:

  Running:  test.cy.js                                                                      (1 of 1)
  Test createMenuItem
    ✓ have fresh start with installJoomla (23138ms)
    ✓ can create with minimum arguments - 1st (4877ms)
    ✓ can create with explicit set menu and (unused) language - 2nd (4660ms)
    ✓ can create in different menu - 3rd (5762ms)
    ✓ change to multilingual website and install second language ja-JP (10877ms)
    ✓ still can create with minimum arguments - 4th (5467ms)
    ✓ can create with explicit set menu and using language ja-JP - 第5 (4698ms)
    ✓ can create with third language uk-UA - 6-й (13427ms)

Created menu items are:
menu-items

👉 This custom command is actual not used in Joomla System Tests.

muhme added 6 commits June 19, 2024 09:58
- Make it working for Joomla >= 5
- Implement language selection
- Refactor method documentation and unify non-use of the semicolon
@laoneo laoneo merged commit 1eb6f7f into joomla-projects:main Aug 7, 2024
@laoneo
Copy link
Copy Markdown
Collaborator

laoneo commented Aug 7, 2024

Thanks!

@muhme muhme deleted the fix-createMenuItem branch August 7, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants