> For example, I have a button in the header of the page that's used in more than 15 tests. It's a lot easier for me to call a descriptively named function those 15 times, and it's a lot easier to maintain. But from what I've read on multiple sites, including cypress official docs, that isn't how it's supposed to be done
I've not heard this at all. I've heard Brian Mann express distaste for page object model, which would be grouping your functions and selectors by page, and I concur with that. What you are doing with the header seems like a best practice to me. Including it as a custom command makes life easier when writing tests because testers don't need to import anything, and they mesh well with the built-in Cypress commands.