But what if someone (hopefully a designer) wants to change Buttonto MenuItem? Your test will break and you will have to fix it. One of the main points of MVVM is that designers can really freely organize and rearrange the interface as they like, without requiring too much back and forth with the developers. Writing unit tests against the user interface will invalidate this.
I kind of play Devil's lawyer here. I'm not saying that the user interface is completely useless and never takes place in any codebase. I say that income is declining and that you can trade one problem for another.
""., , , . , . , API WPF, , , .