HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/ste.komma.pro/tests/Cypress/support/jqueryUI_SelectMenu.js
Cypress.Commands.add('jqueryUiSelectMenuSelect', (textToSelect, attributeKey, options = {}) => {
    cy.document().then(function(document) {
        if(!attributeKey) {
            cy.log('Not selecting the text "' + textToSelect + '" because no select menu attribute key was given');
            return;
        }

        if(!textToSelect) {
            cy.log('Not selecting empty text in the select with attribute key: '+attributeKey);
            return;
        }

        cy.get('[data-test='+attributeKey+']').click();
        //The mouseover trigger is needed to make the click work. Else the select menu won't select the option.
        cy.get('li[data-test^="'+attributeKey+'-"]').contains(textToSelect).parent().trigger('mouseover').click();
    })
});