jwebunit to check css style - css

I'm trying to assert the current styling of a div. For example, is it set to visible or not. I wasn't able to find a way in jwebunit to get at this information though. Ideas? Alternate approaches?
Constraint: I cannot change the page I am trying to test.

There are two TestEngines which you can use with JWebUnit, HTMLUnit and Selenium. why not System.out.println("========="+ getPageSource()); and see if the page source return from both TestEngines gives css within the output. If they do that means you can verify css, if the output does not give css then i guess you will not be able to verify. One thing i know for sure is that it will show you the css file the page uses for style but as to the styling being applied I will say not, but try it

Related

Cypress.io cannot find any element, body or class

I've started testing a .jsp page which includes iframes.
After visiting the page it cannot find a single element, img, class etc etc.
Even using the playground selector it doesn't seem to recognize any link or elements.
I'm unsure if I need to target the iframe first or not.
Below is a recording of the playground selector not finding anything.
https://recordit.co/aQC6Awpxwy
I've added a screenshot of some source code below to help if anyone has any suggestions I can try.
Looks to be #Documents embedded inside of iframes, I have no idea where to start.

css message locator in robotframework

Please advice me about to find css message locator in robotframework.
I can not use id cause of change every time when I run test script.
Only Class not change but have a lot of message.
Hence I want to catch the message instead.
enter image description here
enter image description here
As far as I could understand, you need to select an element based on CSS class. If you need exactly that solution, you can go with CSS locator css:z-menu-img, if you are sure that this is the only element with that CSS class in the page.
Otherwise, I propose another solution (as unstable as the others because it can change over time): use XPath. For your case, it can be: //*[#id="kOIQf6-a"]/span.

Changes in clarity-ui.min.css not working

I tried to add one more attribute to clarity modal css in clarity-ui.min.css but the changes are not reflecting.
Without any details about what you've done, its hard to understand what is going on. However, you should not directly edit clr-ui.min.css and instead write your own CSS that is included afterwards and overrides any values you need.

Load resources in gadgets in Jira

I've made an Add-on which is a custom field.
The style of the text in the field changes depending on the properties of an issue.
I check which style should the text have in the .java file and I pass the html class in a variable called $indicator to the velocity template:
#if( ${value} )
<span class="$indicator">${value}</span>
#end
It works perfect everywhere but in gadgets. When I add this field to a table showing issues in a dashboard, the html code is correct, but it doesn't find the css resource. This is because gadgets are inside an iframe.
How can I make the iframe have a reference to the stylesheet?
You did not say exactly which gadget you were using, but try adding the following context within your <web-resource> module:
<context>jira.webresources:issue-table</context>
The above should work for at least Assigned to Me, Filter Results, In Progress, Voted, and Watched in JIRA 6.1+.
If that does not work, you might also try:
<context>com.atlassian.jira.gadgets:common-lite</context>
If that general context doesn't work, you can look for which exact contexts are #requireContext'ed by the specific gadget you are trying to use, and then make sure that your web-resource is listed in that context. You can figure this out by looking at the gadget's XML and then searching for the #requireContext. (You can find the gadget XMLs inside $JIRA_DATA/plugins/.osgi-plugins/transformed-plugins/jira-gadgets-plugin-*.jar)
Starting with JIRA 7 the Answer of Scott Dudley is no longer working. #requireContext was replaced with a #requireResource within the Atlassian sources of this gadget.
As it affects our plugin, I created a Improvement Request to make that possible again

Increase size of Facebook Like Button

I am developing a feature where I want to increase the size(width and height) of Facebook Like button which is getting rendere on my page.
I have tried overidding the css but it is not working as my css is loading very late.
Help required.
Are you sure you're using the correct overrides in your CSS? If I'm not mistaken, it doesn't matter when the CSS is loaded, just that it is loaded.
Be sure to check your CSS includes in the header file to make sure you're using the latest version. Also double check the classes or ids you need to override.
Perhaps you could post the code containing the like button you're trying to manipulate. If you're loading it in via Javascript you can use Firebug or other Web Inspectors to find out the actual HTML that gets inserted.
First of all, the css MUST be interpreted by the browser before the html element it refers to is loaded...
Second, the reason you can't select the button through CSS directly, is because it is rendered inside an iFrame that is controlled by the Facebook framework (you can check this out with firebug or any other inspector).
I'm not sure if it's feasible, but you have two possible ways to do it:
use javascript and the DOM to access inside that iFrame, select the button and style it.
create a button yourself, and give it the same href as the one generated originally, thus losing the fan-counter capabilities and whatever else is part of their framework

Resources