Can I test live websites using QUnit? For example, can I write a test that says:
- Go to google.com
- Enter a search term
- Click ‘Google Search’
- Check there are 10 results and 2 ads
Would QUnit be an appropriate tool for this kind of “live” testing?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can achieve that using qunit if qunit is the only tool/testing framework that is available for you and the page you will be testing allows GET requests.
How to do that qunit is you can make an ajax call to the page you are testing using JSONP and get the response. Then you would assert certain elements on the response exists.
For google, google itself has a very complex page structure on search results, I would not even attempt to do anything like this.
I would use qunit for testing javascript components on their own without dependencies.
If you are looking for another tool to do this task, I would recommend Selenium, which would do exactly what you want.
Good luck.