Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

stropho/xpath-has-class

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xpath-has-class

  • functions that help you to create xpaths, more specifically shortcuts for writing contains(concat(' ', normalize-space(@class), ' '), ' "+className+" ') and similar

API

hasClass = require('xpath-has-class');

hasClass.one("foo");
//returns "contains(concat(' ', normalize-space(@class), ' '), ' foo ')"

hasClass.notOne("foo");
//would be the same as 
hasClass.not( hasClass.one("foo") );
//returns "not(contains(concat(' ', normalize-space(@class), ' '), ' foo '))"

hasClass.all(["bar","bar-foo"]);
//returns "contains(concat(' ', normalize-space(@class), ' '), ' bar ') and contains(concat(' ', normalize-space(@class), ' '), ' bar-foo ')";"

To sum up, there are methods:

  • not
  • one
  • notOne

And a few, where you need to pass an array:

  • all
  • some
  • notAny

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published