HuddleEng / PhantomCSS

Visual/CSS regression testing with PhantomJS
MIT License
4.72k stars 259 forks source link

does phantomcss selector support the xpath? #163

Open qileilove opened 8 years ago

qileilove commented 8 years ago

If inscribe, troublesome everybody.

jamescryer commented 8 years ago

CasperJS supports XPath, http://docs.casperjs.org/en/latest/selectors.html#selectors which is what PhantomCSS uses to capture screenshots of html components.

qileilove commented 8 years ago

@jamescryer thanks,but like the phantomcss.screenshot('#the-dialog', 'a screenshot of my dialog') function, the first parameter must be css selector, can't use xpath selector.

jamescryer commented 8 years ago

I'm happy to review a Pull Request for the support of XPath

xiaoina commented 7 years ago

So the only way to take a screenshot is if something is a div class?

jamescryer commented 7 years ago

Any CSS selector ".my-class" is the most obvious usage, less obvious might be "[href='http://www.site.com']" or even "div:first-child span .btn" but I would recommend keeping your selectors as small as possible, even if that means adding classes you wouldn't have otherwise needed.