.jss403
is generated by React each time you build. The other two classes are fixed and supplied by the Material-UI library.
Since you have a label, can you search on the text of the label?
cy.contains('.MuiButton-label', 'the-label-text')
If you can inspect the page with devtools, copy the section of HTML (use the right-click option 'Edit as HTML') and add it to your question, can then give a more precise answer.
Based on the MUI docs page here, the element you would target for the first example button which has the text "Default" is
<span class="MuiButton-label">Default</span>
I cloned the page from the CodeSandbox link they give, and added a simple click handler to the Default button
App - demo.js
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';
...
export default function OutlinedButtons() {
const classes = useStyles();
return (
<div className={classes.root}>
<Button variant="outlined" onClick={() => { alert('clicked') }}>Default</Button>
Test
it('clicks the MUI button', () => {
cy.visit('http://localhost:3000') // cloned the example and running it locally
cy.contains('.MuiButton-label', 'Default')
.click() // shows "(alert) clicked"
// in Cypress runner log
})
The alert does not actually show because Cypress suppresses it, but there is an entry in the log.