Add unit tests for try_login behavior

Add unit tests for the code that detects and tries to use login forms
automatically (`Browser.try_login`).

Add `htdocs/favicon.ico` because it is loaded automatically when the
browser tries to use the test web server and it causes a "missing"
warning.

Create a new dir `tests/htdocs/site11` which is used for login related
test html files.
This commit is contained in:
Vangelis Banos 2020-04-13 19:16:10 +00:00
parent e22d80b9a4
commit 782aab3048
4 changed files with 74 additions and 0 deletions

View file

@ -0,0 +1,12 @@
<html>
<head>
<title>Form without proper username/password fields</title>
</head>
<body>
<form action="/login-action" method="POST">
<input type="text" name="username" />
<input type="text" name="foo" />
<input type="submit" name="login" value="login" />
</form>
</body>
</html>

View file

@ -0,0 +1,12 @@
<html>
<head>
<title>Detect login form and use it</title>
</head>
<body>
<form action="/login-action" method="POST">
<input type="email" name="email" />
<input type="password" name="password" />
<input type="submit" name="login" value="login" />
</form>
</body>
</html>