Handling Multi browser support in spec for Galen Framework

276 views Asked by At

I am using Galen Framework for UI testing for my application. The issue I am facing is that the CSS value for the font-family varies between browsers. And if I add the check for 1 value the specs fails for the other browsers. I can write different specs for differnt browsers, but I want to avoid that.

The list below shows the different values for the CSS property "font-family".

  • Firefox = "Helvetica,Arial,Verdana,sans-serif,sans-serif"
  • Chrome = "Helvetica, Arial, Verdana, sans-serif, sans-serif"
  • IE = "helvetica,arial,verdana,sans-serif,sans-serif"
2

There are 2 answers

2
hypery2k On

You could try creating a custom rules (http://galenframework.com/docs/reference-galen-spec-language-guide/#CustomRules) for that. I didn't tried it, but maybe you can get the browser name to and wrap all the browser specific stuff in a custom rule

0
mons On

It's better to use something like below:

@set
    fontlist    "(Helvetica|Arial|Verdana|sans-serif|helvetica|arial|verdana)"
= Check value of the object =
    objectname:
      css font-family matches ${fontlist}

Another way, if you want to check exact value:

= Check value of the object =
objectname:
  @on ie
   css font-family is "helvetica,arial,verdana,sans-serif,sans-serif" 
  @on firefox
   css font-family is "Helvetica,Arial,Verdana,sans-serif,sans-serif"
  @on chrome
   css font-family is "Helvetica, Arial, Verdana, sans-serif, sans-serif"