theintern / visual-plugin

Visual Regression Testing for Intern
Mozilla Public License 2.0
29 stars 7 forks source link

Add configuration to hide elements #9

Open devpaul opened 7 years ago

devpaul commented 7 years ago

It's common for pages to have elements whose contents vary on subsequent page views. For instance, a welcome prompt that says "Hello, <user>" or other personalization; a time stamp; or ads.

We should add a configuration parameter that makes it easy to hide these variable elements. It could look something like

visualTest({
    url,
    width: 1024,
    height: 480,
    hide: [ '.querySelector', '.login' ],
    remove: [ 'footer' ]
}),

Elements would be identified using a query selector. Each item in the hide list would have visible: hidden applied. Each item in the remove list would have display: none applied.