mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-06-01 04:56:29 -04:00
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:
parent
e22d80b9a4
commit
782aab3048
4 changed files with 74 additions and 0 deletions
12
tests/htdocs/site11/form-no-login.html
Normal file
12
tests/htdocs/site11/form-no-login.html
Normal 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>
|
12
tests/htdocs/site11/form1.html
Normal file
12
tests/htdocs/site11/form1.html
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue