[
https://issues.jboss.org/browse/ARQGRA-290?page=com.atlassian.jira.plugin...
]
Juraj Húska commented on ARQGRA-290:
------------------------------------
IMHO there is problem in how {{WebDriver}} returns the value of some attribute. In those
mentioned tests specifically of attribute {{style}}.
The {{style="display: none;"}} attribute is removed in order to make an element
visible by JS code in the HTML pages of those tests:
[
here|https://github.com/arquillian/arquillian-graphene/blob/master/graphe...].
The condition for asserting an attribute present is
[
here|https://github.com/arquillian/arquillian-graphene/blob/master/graphe...].
So we are asserting the returned value to {{null}}.
Copying relevant part of the {{WebDriver#getAttribute}} method's Javadoc:
??Get the value of a the given attribute of the element. Will return the current value,
even if this has been modified after the page has been loaded. More exactly, this method
will return the value of the given attribute, unless that *attribute is not present*, in
which case the *value of the property with the same name is returned.* *If neither value
is set, null is returned.* The *"style"* attribute is converted as best can be
to a text representation with a trailing semi-colon.??
Therefore, I think that we need to change the assertion of the {{AttributeIsPresent}}
condition to be in compliance with the {{getAttribute}} method.
*However*, that would not be sufficient. Another problem is that there is difference in JS
engines of {{HTMLUnit}} and {{Chrome}}, which causes that removing an attribute is not
consistent for all browsers.
IMHO the best option would be to assert element for presence like this:
{{return (attributeValue != null) && (attributeValue.length() != 0) &&
(attributeValue.equals(getAttribute()));}}
What do you think guys ?
testAttributeIsPresent fails on Chrome and PhantomJS
----------------------------------------------------
Key: ARQGRA-290
URL:
https://issues.jboss.org/browse/ARQGRA-290
Project: Arquillian Graphene
Issue Type: Bug
Reporter: Lukáš Fryč
Assignee: Juraj Húska
Priority: Critical
Fix For: 2.0.0.Alpha4
Test cases:
{code}
LocatorAttributeTest.testAttributeIsPresent
LocatorAttributeTest.testAttributeIsPresentDirectly
WebElementAttributeTest.testAttributeIsPresent
WebElementAttributeTest.testAttributeIsPresentDirectly
ConditionsTestCase.testAttributeIsPresent
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira