Regression testing for styling and layout of web applications

前端 未结 5 408
-上瘾入骨i
-上瘾入骨i 2021-02-04 10:55

I realise this is a non-trivial task, but is there a way to regression test the styling and rendered layout of a web application?

I\'ve found it straightforward to unit t

5条回答
  •  囚心锁ツ
    2021-02-04 11:39

    I guess you could generate an 'ideal' shot of each page in your web application to use as reference.

    Then generate a new shot of every page after a CSS update and compare with the previous ones. A 1:1 comparison should be okay if you make sure you always keep the same resolution, etc.

    You could even make it so that you can tell it that if the page differs, the other page is actually 'better' than the example and to use the 'other' as the example for the next runs.

    That way, when you fix something you can see the difference for one page, and mark it as being better, and then fix a bug on another page while making sure you don't regress the bug you were trying to fix in the first place.

提交回复
热议问题