galenframework / galen

Layout and functional testing framework for websites
http://galenframework.com
1.41k stars 163 forks source link

Incorrectly reporting pixel values (rounding DP) #531

Open freakyleaf opened 6 years ago

freakyleaf commented 6 years ago

Expected measurements use up to 4DP but Galen always rounds, failing tests.

Example output:

= Spacers =
    spacers.spacer_xxs:
->      width 4.3125px
->      :   "spacers.spacer_xxs" width is 4.0000px instead of 4.3125px

    spacers.spacer_xs:
->      width 8.6375px
->      :   "spacers.spacer_xs" width is 9.0000px instead of 8.6375px

    spacers.spacer_s:
->      width 17.275px
->      :   "spacers.spacer_s" width is 17.000px instead of 17.275px

    spacers.spacer_m:
->      width 34.55px
->      :   "spacers.spacer_m" width is 35.00px instead of 34.55px

    spacers.spacer_l:
->      width 69.1125px
->      :   "spacers.spacer_l" width is 69.0000px instead of 69.1125px

    spacers.spacer_xl:
->      width 138.238px
->      :   "spacers.spacer_xl" width is 138.000px instead of 138.238px

Expected figures are taken directly from Chrome DevTools.

cyildirim commented 6 years ago

Galen gets object size as integer value from browser. It looks like it is not possible currently.