Create an automated website testing script in Python or Perl.
The script will be ran under Linux (Ubuntu) and will perform the following tests on our website. The website's address is https://jv16powertools.com. The script must run without any interaction required from the user.
The script shall perform the following tests on our website (jv16powertools dot com):
Test 1) Website front page load time: Download the content of the website index page 5 times and calculate the average loading time. If it is more than 4 seconds, show an error. If no error, show the average loading time.
Test 2) Website sub page load time: Parse the links from the front page and load all of the found sub pages (i.e. same domain) five times and calculate average loading time for each. If more than 4 seconds, show an error. If no error, show the average loading time.
Test 3) Dead links checker. Check all of the website's internal and external a href= links AND src= source data urls for broken links. List any dead links as errors. If none found, show the number of links tested. Note: This feature must support a builtin ignore list, i.e. an array of search words. If URL contains any of these search words, they do not get analyzed or crawled. For example, we would have the word '/forum/' in this list, so the check does not check any links found in [login to view URL]
Test 4) Insecure content checker. Check all pages of the website (minus any URLs matching the ignore list of test 3) for any URLs starting with "http://". List any as errors. If none found, show the number of pages tested.
Test 5) Website content spell checker. Check all page contents of the website (minus any with an URL matching the ignore list of test 3) with an English spell checker to find spelling mistakes. If none found, show the number of words tested. The test must also support another ignore list, a builtin array of words, which are not to be considered as spelling mistakes. For example, if the used spell checking library considers the word "jv16" and/or "Powertools" as spelling mistakes, we can add 'jv16' and 'powertools' into this ignore list (by editing source code) and these are no longer considered as spelling mistakes. Naturally, this test must be done only on the visible content of each page, not to the entire HTML source code dump.
Test 6) Image alt text checker. Check all pages of the website (minus any with an URL matching the ignore list of test 3) to ensure all <img> tags contain a non empty alt="" parameter. If any found, report as error. If none found, show the number of img tags detected.
Test 7) Redirection checker. Check all of the following URLs redirect to "[login to view URL]":
[login to view URL], [login to view URL], [login to view URL], [login to view URL], [login to view URL], [login to view URL], https://www.macecraft.com. If all works, report the number of redirections tested. If an error, display on screen.
After each test is executed, it will print out either OK (plus test's result message) or the list of detected errors.
For example, the output of the test could look like this:
[login to view URL] Quality Control Script version 1.0
Test 1: OK - Average load time: 3.4 seconds
Test 2: OK -
/features/ - 4.3 seconds
/pricing/ - 3.3 seconds
/about/ - 3.3 seconds
/blog/ - 3.3 seconds
Test 3: OK - 1320 links checked
Test 4: OK - 432 pages checked
Test 5: FAIL -
/jv16-powertools-update-released-version-5-0-0-484/ - Spelling error: "improvemments"
Test 6: OK - 238 images checked
Test 7: OK - 7 redirections checked
Sawasdee! First of all, great project description - you're the ideal employer a freelancer would like to work for I guess. Website check-ups and penetration tests are something I easily achieve in Python and I think Daha Fazla