Question: Is there a keyword in Robot Framework to ensure element has a certain class? Something like

`Element should has class element className`

Alternatively, I could check if element has a certain attribute with certain value. Former would be more suitable though, as element may contain multiple classes.

Answer: 
You could create a new keyword via XPath selectors:

```
Element should have class
    [Arguments]  ${element}  ${className}
    Wait until page contains element  ${element}[contains(@class, '${className}')]

```

Or via CSS selectors:

```
Element should have class
    [Arguments]  ${element}  ${className}
    Wait until page contains element  ${element}.${className}

```

`Wait until page contains element` could be replaced by any keyword of your liking to check if the element exists and is visible, such as `Element should be visible`.
Here below an example of both ways:

```
    ${temp}=    get element attribute       xpath=/elementpath    class
    should contain        ${temp}   ${ClassName}

```

OR

```
 Wait until page contains element  xpath=/elementpath[contains(@class, '${ClassName}')

```