.hasClass() Suggest edits
Checks if the given element has the specified CSS class.
Usage
Example
this.demoTest = function (browser) {
browser.assert.hasClass('#main', 'container');
browser.assert.hasClass('#main', ['visible', 'container']);
browser.assert.hasClass('#main', 'visible container');
};
Parameters
Name | Type | description |
---|---|---|
definition |
string | object | The selector (CSS/Xpath) used to locate the element. Can either be a string or an object which specifies element properties. |
className |
string | The CSS class to look for. |
msg Optional |
string | Optional log message to display in the output. If missing, one is displayed by default. |