Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom JQuery/Sizzle Pseudo Selectors #155

Open
rmbrntt opened this issue Oct 8, 2015 · 1 comment
Open

Custom JQuery/Sizzle Pseudo Selectors #155

rmbrntt opened this issue Oct 8, 2015 · 1 comment
Assignees

Comments

@rmbrntt
Copy link

rmbrntt commented Oct 8, 2015

Below is javascript for a custom pseudo selector which is being executed by IJavaScriptExecutor. This works well but I'm wondering if there is a way to globally apply custom JS functions to JQuery/Sizzle before a test is run so that in this example the selector ":icontains" doesn't need to be explicitly called.

        //case insensitive pseudo selector
        ((IJavaScriptExecutor)FluentTest.ProviderInstance).ExecuteScript(
            @"jQuery.expr[':'].icontains = function(a,i,m){
            return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0;};"
        );

        I.Find("span[class='select2-match']:icontains('ANYCase')");

Any thoughts on the best approach to make a custom JQuery function natively integrate into FluentAutomation's JQuery/Sizzle library?

@stirno
Copy link
Owner

stirno commented Dec 29, 2015

Sorry I've been working on other things for awhile.. Interesting idea. Definitely something we can provide a hook for during bootstrapping I think.

@stirno stirno self-assigned this Dec 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants