buttercup / locust

Login form location & automation utility
MIT License
20 stars 6 forks source link

Add dyndns test #12

Closed perry-mitchell closed 6 years ago

LinusU commented 6 years ago

Hmm, the Travis error is strange, this is the HTML from the site:

<input id="login25_username" name="username" value="">

I wonder if they are doing something with User-Agent headers or similar...

edit: haha 😆 I know what it is!

They aren't setting type="text". The default is text, but the query-selector engine doesn't care about that...

Maybe add something like this:

export const USERNAME_QUERIES = [
    "input[type=text][id^=user]",
    "input:not([type])[id^=user]",
    "input[type=text][name^=user]",
    "input:not([type])[name^=user]",
    // ...
];

It's a bit annoying to have everything twice though 🤔

btw. this specific query selector catches it: input:not([type])[name^=user]

perry-mitchell commented 6 years ago

Ah brilliant! Thank you @LinusU that's perfect!

perry-mitchell commented 6 years ago

Tried adding tests for Facebook, but their security policies (I'm guessing) don't really allow for me to run anything there using Nightmare.

{
        "name": "Facebook",
        "url": "https://www.facebook.com/",
        "expectedFields": {
            "username": "#login_form input[type=email][name=email]",
            "password": "#login_form input[type=password][name=pass]"
        }
    }