From 883bcc257a38240de7de8888f78bac4406b5d027 Mon Sep 17 00:00:00 2001 From: Muriithi Frederick Muriuki Date: Mon, 19 Mar 2018 17:49:39 +0300 Subject: Initialise navigation tests. * Start working on navigation tests. --- test/requests/navigation_tests.py | 15 +++++++++++++++ test/requests/test-website.py | 7 ++++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 test/requests/navigation_tests.py (limited to 'test') diff --git a/test/requests/navigation_tests.py b/test/requests/navigation_tests.py new file mode 100644 index 00000000..eda27324 --- /dev/null +++ b/test/requests/navigation_tests.py @@ -0,0 +1,15 @@ +from __future__ import print_function +import re +import requests +from lxml.html import parse + +def check_navigation(args_obj, parser): + print("") + print("Checking navigation.") + + host = args_obj.host + url = host + "/show_trait?trait_id=1435395_s_at&dataset=HC_M2_0606_P" + print("URL: ", url) + page = requests.get(url) + # Page is built by the javascript, hence using requests fails for this. + # Investigate use of selenium maybe? diff --git a/test/requests/test-website.py b/test/requests/test-website.py index 2bef6eb1..dbf3b822 100755 --- a/test/requests/test-website.py +++ b/test/requests/test-website.py @@ -7,6 +7,7 @@ from __future__ import print_function import argparse from link_checker import check_links from mapping_tests import check_mapping +from navigation_tests import check_navigation from main_web_functionality import check_main_web_functionality print("Mechanical Rob firing up...") @@ -57,9 +58,9 @@ parser.add_argument("-m", "--mapping", dest="accumulate" , action="store_const", const=check_mapping, default=print_help , help="Checks for mapping.") -# parser.add_argument("-n", "--navigation", dest="accumulate" -# , action="store_const", const=check_navigation, default=print_help -# , help="Checks for navigation.") +parser.add_argument("-n", "--navigation", dest="accumulate" + , action="store_const", const=check_navigation, default=print_help + , help="Checks for navigation.") # parser.add_argument("-s", "--skip-broken", dest="accumulate" # , action="store_const", const=dummy, default=print_help -- cgit v1.2.3