-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difference between 'style' and 'style-hammerhead-stored-value' of element #1922
Comments
Hi, any news/updates? |
Hello. I've reproduced this issue. Our team will research it and check for a suitable solution. As a workaround, you can use the following <html>
<head>
</head>
<body>
<div id="ButtonGetAttribute">
Style button
</div>
<script>
function clickHandler() {
if (!document.getElementById('ButtonGetAttribute').getAttribute('style')){
document.getElementById('ButtonGetAttribute').setAttribute('style', 'background: red;');
}
if (document.getElementById('ButtonGetAttribute').getAttribute('style').indexOf('background: red;') >= 0) {
document.getElementById('ButtonGetAttribute').setAttribute('style', document.getElementById('ButtonGetAttribute').getAttribute('style').replace(/background:(.+?;)/i, ''));
document.getElementById('ButtonGetAttribute').setAttribute('style', 'background: green;');
}
else if(document.getElementById('ButtonGetAttribute').getAttribute('style').indexOf('background') >= 0) {
document.getElementById('ButtonGetAttribute').setAttribute('style', document.getElementById('ButtonGetAttribute').getAttribute('style').replace(/background:(.+?;)/i, ''));
}
}
var div = document.getElementById('ButtonGetAttribute');
div.onclick = clickHandler;
</script>
</body>
</html> |
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow. |
What is your Test Scenario?
Changing of element's style by clicking
What is the Current behavior?
Styles which are got by getAttribute('style') are not equal to the styles from 'style' property of element
What is the Expected behavior?
Values of getAttribute('style') and 'style' property are the same
What is your web application and your TestCafe test code?
Web application example:
Our test example:
Steps to Reproduce:
Your Environment details:
The text was updated successfully, but these errors were encountered: