diff options
author | Mihail Stanciu <stanciux.mihail@intel.com> | 2015-08-19 14:29:24 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-19 18:05:51 +0100 |
commit | c8df84777bc5283f54f71e5e76fafb5e766a1009 (patch) | |
tree | 8092d682230b292e6aedd5a6b54b2abfc93ff1dc /bitbake/lib/toaster/contrib | |
parent | 55f13d45561f0e14e38bb79203404a06bb91786b (diff) | |
download | poky-c8df84777bc5283f54f71e5e76fafb5e766a1009.tar.gz |
bitbake: toasteruitest: Updated UI tests cases to use dom IDs and 1.9 UI changes
Updated existing tests to use dom IDs where necessary.
Updated tests to use 1.9 specific UI changes:
- removed deprecated columns(log and layer directory)
- changed expected names for table header("Recipe" instead of "Target")
Added tests for TC 942 and 943 which were missing
Removed test for TC 959 which was deprecated under 1.9
(Bitbake rev: d8c37780609571e95edef9a220225927eb94b174)
Signed-off-by: Mihail Stanciu <stanciux.mihail@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/contrib')
-rwxr-xr-x | bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_automation_test.py | 307 |
1 files changed, 133 insertions, 174 deletions
diff --git a/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_automation_test.py b/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_automation_test.py index 0cb3934339..2a2078f080 100755 --- a/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_automation_test.py +++ b/bitbake/lib/toaster/contrib/tts/toasteruitest/toaster_automation_test.py | |||
@@ -605,18 +605,16 @@ class toaster_cases(toaster_cases_base): | |||
605 | self.driver.maximize_window() | 605 | self.driver.maximize_window() |
606 | self.driver.get(self.base_url) | 606 | self.driver.get(self.base_url) |
607 | # open all columns | 607 | # open all columns |
608 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 608 | self.driver.find_element_by_id("edit-columns-button").click() |
609 | # adding explicitly wait for chromedriver..-_- | 609 | # adding explicitly wait for chromedriver..-_- |
610 | self.browser_delay() | 610 | self.browser_delay() |
611 | self.driver.find_element_by_id("log").click() | ||
612 | self.browser_delay() | ||
613 | self.driver.find_element_by_id("started_on").click() | 611 | self.driver.find_element_by_id("started_on").click() |
614 | self.browser_delay() | 612 | self.browser_delay() |
615 | self.driver.find_element_by_id("time").click() | 613 | self.driver.find_element_by_id("time").click() |
616 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 614 | self.driver.find_element_by_id("edit-columns-button").click() |
617 | # dict: {lint text name : actual class name} | 615 | # dict: {lint text name : actual class name} |
618 | table_head_dict = {'Outcome':'outcome', 'Target':'target', 'Machine':'machine', 'Started on':'started_on', 'Completed on':'completed_on', \ | 616 | table_head_dict = {'Outcome':'outcome', 'Recipe':'target', 'Machine':'machine', 'Started on':'started_on', 'Completed on':'completed_on', \ |
619 | 'Errors':'errors_no', 'Warnings':'warnings_no', 'Time':'time', 'Log':'log'} | 617 | 'Errors':'errors_no', 'Warnings':'warnings_no', 'Time':'time'} |
620 | for key in table_head_dict: | 618 | for key in table_head_dict: |
621 | try: | 619 | try: |
622 | self.driver.find_element_by_link_text(key).click() | 620 | self.driver.find_element_by_link_text(key).click() |
@@ -653,7 +651,7 @@ class toaster_cases(toaster_cases_base): | |||
653 | print ori_target_column_texts | 651 | print ori_target_column_texts |
654 | self.driver.find_element_by_id("search").clear() | 652 | self.driver.find_element_by_id("search").clear() |
655 | self.driver.find_element_by_id("search").send_keys(pattern) | 653 | self.driver.find_element_by_id("search").send_keys(pattern) |
656 | self.driver.find_element_by_css_selector("button.btn").click() | 654 | self.driver.find_element_by_id("search-button").click() |
657 | new_target_column_texts = self.get_table_column_text("class", "target") | 655 | new_target_column_texts = self.get_table_column_text("class", "target") |
658 | # if nothing found, we still count it as "pass" | 656 | # if nothing found, we still count it as "pass" |
659 | if new_target_column_texts: | 657 | if new_target_column_texts: |
@@ -673,11 +671,11 @@ class toaster_cases(toaster_cases_base): | |||
673 | self.driver.maximize_window() | 671 | self.driver.maximize_window() |
674 | self.driver.get(self.base_url) | 672 | self.driver.get(self.base_url) |
675 | # when opening a new page, "started_on" is not displayed by default | 673 | # when opening a new page, "started_on" is not displayed by default |
676 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 674 | self.driver.find_element_by_id("edit-columns-button").click() |
677 | # currently all the delay are for chrome driver -_- | 675 | # currently all the delay are for chrome driver -_- |
678 | self.browser_delay() | 676 | self.browser_delay() |
679 | self.driver.find_element_by_id("started_on").click() | 677 | self.driver.find_element_by_id("started_on").click() |
680 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 678 | self.driver.find_element_by_id("edit-columns-button").click() |
681 | # step 4 | 679 | # step 4 |
682 | items = ["Outcome", "Completed on", "Started on", "Failed tasks", "Errors", "Warnings"] | 680 | items = ["Outcome", "Completed on", "Started on", "Failed tasks", "Errors", "Warnings"] |
683 | for item in items: | 681 | for item in items: |
@@ -711,7 +709,7 @@ class toaster_cases(toaster_cases_base): | |||
711 | self.save_screenshot(screenshot_type='selenium', append_name='step6') | 709 | self.save_screenshot(screenshot_type='selenium', append_name='step6') |
712 | self.driver.find_element_by_id("search").clear() | 710 | self.driver.find_element_by_id("search").clear() |
713 | self.driver.find_element_by_id("search").send_keys("core-image") | 711 | self.driver.find_element_by_id("search").send_keys("core-image") |
714 | self.driver.find_element_by_css_selector("button.btn").click() | 712 | self.driver.find_element_by_id("search-button").click() |
715 | 713 | ||
716 | 714 | ||
717 | ############## | 715 | ############## |
@@ -737,24 +735,24 @@ class toaster_cases(toaster_cases_base): | |||
737 | 735 | ||
738 | self.driver.find_element_by_id("search").clear() | 736 | self.driver.find_element_by_id("search").clear() |
739 | self.driver.find_element_by_id("search").send_keys("busybox") | 737 | self.driver.find_element_by_id("search").send_keys("busybox") |
740 | self.driver.find_element_by_css_selector("button.btn").click() | 738 | self.driver.find_element_by_id("search-button").click() |
741 | self.browser_delay() | 739 | self.browser_delay() |
742 | self.save_screenshot(screenshot_type='selenium', append_name='step5') | 740 | self.save_screenshot(screenshot_type='selenium', append_name='step5') |
743 | self.driver.find_element_by_css_selector("i.icon-remove").click() | 741 | self.driver.find_element_by_css_selector("i.icon-remove").click() |
744 | # Save screen here | 742 | # Save screen here |
745 | self.save_screenshot(screenshot_type='selenium', append_name='step5_2') | 743 | self.save_screenshot(screenshot_type='selenium', append_name='step5_2') |
746 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 744 | self.driver.find_element_by_id("edit-columns-button").click() |
747 | self.driver.find_element_by_id("cpu_used").click() | 745 | self.driver.find_element_by_id("cpu_used").click() |
748 | self.driver.find_element_by_id("disk_io").click() | 746 | self.driver.find_element_by_id("disk_io").click() |
749 | self.driver.find_element_by_id("task_log").click() | 747 | self.driver.find_element_by_id("task_log").click() |
750 | self.driver.find_element_by_id("recipe_version").click() | 748 | self.driver.find_element_by_id("recipe_version").click() |
751 | self.driver.find_element_by_id("time_taken").click() | 749 | self.driver.find_element_by_id("time_taken").click() |
752 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 750 | self.driver.find_element_by_css_selector("edit-columns-button").click() |
753 | # The operation is the same as case901 | 751 | # The operation is the same as case901 |
754 | # dict: {lint text name : actual class name} | 752 | # dict: {lint text name : actual class name} |
755 | table_head_dict = {'Order':'order', 'Recipe':'recipe_name', 'Task':'task_name', 'Executed':'executed', \ | 753 | table_head_dict = {'Order':'order', 'Recipe':'recipe_name', 'Task':'task_name', 'Executed':'executed', \ |
756 | 'Outcome':'outcome', 'Cache attempt':'cache_attempt', 'Time (secs)':'time_taken', 'CPU usage':'cpu_used', \ | 754 | 'Outcome':'outcome', 'Cache attempt':'cache_attempt', 'Time (secs)':'time_taken', 'CPU usage':'cpu_used', \ |
757 | 'Disk I/O (ms)':'disk_io', 'Log':'task_log'} | 755 | 'Disk I/O (ms)':'disk_io'} |
758 | for key in table_head_dict: | 756 | for key in table_head_dict: |
759 | # This is tricky here: we are doing so because there may be more than 1 | 757 | # This is tricky here: we are doing so because there may be more than 1 |
760 | # same-name link_text in one page. So we only find element inside the table | 758 | # same-name link_text in one page. So we only find element inside the table |
@@ -818,17 +816,17 @@ class toaster_cases(toaster_cases_base): | |||
818 | 'Time':{ | 816 | 'Time':{ |
819 | 'class':'time_taken', | 817 | 'class':'time_taken', |
820 | 'check_head_list':['Recipe', 'Task', 'Executed', 'Outcome', 'Time (secs)'], | 818 | 'check_head_list':['Recipe', 'Task', 'Executed', 'Outcome', 'Time (secs)'], |
821 | 'check_column_list':['cpu_used', 'cache_attempt', 'disk_io', 'task_log', 'order', 'recipe_version'] | 819 | 'check_column_list':['cpu_used', 'cache_attempt', 'disk_io', 'order', 'recipe_version'] |
822 | }, | 820 | }, |
823 | 'CPU usage':{ | 821 | 'CPU usage':{ |
824 | 'class':'cpu_used', | 822 | 'class':'cpu_used', |
825 | 'check_head_list':['Recipe', 'Task', 'Executed', 'Outcome', 'CPU usage'], | 823 | 'check_head_list':['Recipe', 'Task', 'Executed', 'Outcome', 'CPU usage'], |
826 | 'check_column_list':['cache_attempt', 'disk_io', 'task_log', 'order', 'recipe_version', 'time_taken'] | 824 | 'check_column_list':['cache_attempt', 'disk_io', 'order', 'recipe_version', 'time_taken'] |
827 | }, | 825 | }, |
828 | 'Disk I/O':{ | 826 | 'Disk I/O':{ |
829 | 'class':'disk_io', | 827 | 'class':'disk_io', |
830 | 'check_head_list':['Recipe', 'Task', 'Executed', 'Outcome', 'Disk I/O (ms)'], | 828 | 'check_head_list':['Recipe', 'Task', 'Executed', 'Outcome', 'Disk I/O (ms)'], |
831 | 'check_column_list':['cpu_used', 'cache_attempt', 'task_log', 'order', 'recipe_version', 'time_taken'] | 829 | 'check_column_list':['cpu_used', 'cache_attempt', 'order', 'recipe_version', 'time_taken'] |
832 | } | 830 | } |
833 | } | 831 | } |
834 | for key in test_dict: | 832 | for key in test_dict: |
@@ -840,10 +838,10 @@ class toaster_cases(toaster_cases_base): | |||
840 | column_list = self.get_table_column_text('class', test_dict[key]['class']) | 838 | column_list = self.get_table_column_text('class', test_dict[key]['class']) |
841 | self.failUnless(is_list_inverted(column_list)) | 839 | self.failUnless(is_list_inverted(column_list)) |
842 | 840 | ||
843 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 841 | self.driver.find_element_by_id("edit-columns-button").click() |
844 | for item2 in test_dict[key]['check_column_list']: | 842 | for item2 in test_dict[key]['check_column_list']: |
845 | self.driver.find_element_by_id(item2).click() | 843 | self.driver.find_element_by_id(item2).click() |
846 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 844 | self.driver.find_element_by_id("edit-columns-button").click() |
847 | # TBD: save screen here | 845 | # TBD: save screen here |
848 | 846 | ||
849 | 847 | ||
@@ -916,36 +914,35 @@ class toaster_cases(toaster_cases_base): | |||
916 | 914 | ||
917 | self.driver.find_element_by_id("search").clear() | 915 | self.driver.find_element_by_id("search").clear() |
918 | self.driver.find_element_by_id("search").send_keys(test_package1) | 916 | self.driver.find_element_by_id("search").send_keys(test_package1) |
919 | self.driver.find_element_by_css_selector("button.btn").click() | 917 | self.driver.find_element_by_id("search-button").click() |
920 | # Save screen here | 918 | # Save screen here |
921 | self.save_screenshot(screenshot_type='selenium', append_name='step4') | 919 | self.save_screenshot(screenshot_type='selenium', append_name='step4') |
922 | self.driver.find_element_by_css_selector("i.icon-remove").click() | 920 | self.driver.find_element_by_css_selector("i.icon-remove").click() |
923 | self.save_screenshot(screenshot_type='selenium', append_name='step4_2') | 921 | self.save_screenshot(screenshot_type='selenium', append_name='step4_2') |
924 | 922 | ||
925 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 923 | self.driver.find_element_by_id("edit-columns-button").click() |
926 | self.driver.find_element_by_id("depends_on").click() | 924 | self.driver.find_element_by_id("depends_on").click() |
927 | self.driver.find_element_by_id("layer_version__branch").click() | 925 | self.driver.find_element_by_id("layer_version__branch").click() |
928 | self.driver.find_element_by_id("layer_version__layer__commit").click() | 926 | self.driver.find_element_by_id("layer_version__layer__commit").click() |
929 | self.driver.find_element_by_id("layer_version__local_path").click() | ||
930 | self.driver.find_element_by_id("depends_by").click() | 927 | self.driver.find_element_by_id("depends_by").click() |
931 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 928 | self.driver.find_element_by_id("edit-columns-button").click() |
932 | 929 | ||
933 | self.find_element_by_link_text_in_table(self.table_name, 'Recipe').click() | 930 | self.find_element_by_link_text_in_table(self.table_name, 'Recipe').click() |
934 | # Check the inverted table by Recipe | 931 | # Check the inverted table by Recipe |
935 | # Recipe doesn't have class name | 932 | # Recipe doesn't have class name |
936 | inverted_tasks_column_count = len(self.driver.find_elements_by_xpath("/html/body/div[2]/div/div[2]/div[2]/table/tbody/tr/td[1]")) | 933 | #inverted_tasks_column_count = len(self.driver.find_elements_by_xpath("/html/body/div[2]/div/div[2]/div[2]/table/tbody/tr/td[1]")) |
937 | print inverted_tasks_column_count | 934 | #print inverted_tasks_column_count |
938 | inverted_column_list = self.get_table_column_text_by_column_number(self.table_name, 1) | 935 | #inverted_column_list = self.get_table_column_text_by_column_number(self.table_name, 1) |
939 | #print inverted_column_list | 936 | #print inverted_column_list |
940 | 937 | ||
941 | self.driver.find_element_by_xpath("/html/body/div[2]/div/div[2]/div[2]/table/tbody/tr[1]/td[1]/a").click() | 938 | #self.driver.find_element_by_partial_link_text("zlib").click() |
942 | self.driver.back() | 939 | #self.driver.back() |
943 | self.failUnless(is_list_inverted(inverted_column_list)) | 940 | #self.failUnless(is_list_inverted(inverted_column_list)) |
944 | self.find_element_by_link_text_in_table(self.table_name, 'Recipe').click() | 941 | #self.find_element_by_link_text_in_table(self.table_name, 'Recipe').click() |
945 | 942 | ||
946 | table_head_dict = {'Recipe file':'recipe_file', 'Section':'recipe_section', \ | 943 | table_head_dict = {'Recipe':'recipe__name', 'Recipe file':'recipe_file', 'Section':'recipe_section', \ |
947 | 'License':'recipe_license', 'Layer':'layer_version__layer__name', \ | 944 | 'License':'recipe_license', 'Layer':'layer_version__layer__name', \ |
948 | 'Layer branch':'layer_version__branch', 'Layer directory':'layer_version__local_path'} | 945 | 'Layer branch':'layer_version__branch'} |
949 | for key in table_head_dict: | 946 | for key in table_head_dict: |
950 | self.find_element_by_link_text_in_table(self.table_name, key).click() | 947 | self.find_element_by_link_text_in_table(self.table_name, key).click() |
951 | column_list = self.get_table_column_text("class", table_head_dict[key]) | 948 | column_list = self.get_table_column_text("class", table_head_dict[key]) |
@@ -954,14 +951,14 @@ class toaster_cases(toaster_cases_base): | |||
954 | self.find_element_by_link_text_in_table(self.table_name, key).click() | 951 | self.find_element_by_link_text_in_table(self.table_name, key).click() |
955 | column_list = self.get_table_column_text("class", table_head_dict[key]) | 952 | column_list = self.get_table_column_text("class", table_head_dict[key]) |
956 | self.failUnless(is_list_sequenced(column_list) or is_list_inverted(column_list)) | 953 | self.failUnless(is_list_sequenced(column_list) or is_list_inverted(column_list)) |
957 | self.driver.find_element_by_xpath("/html/body/div[2]/div/div[2]/div[2]/table/tbody/tr[1]/td[1]/a").click() | 954 | self.driver.find_element_by_partial_link_text("acl").click() |
958 | self.driver.back() | 955 | self.driver.back() |
959 | self.failUnless(is_list_sequenced(column_list) or is_list_inverted(column_list)) | 956 | self.failUnless(is_list_sequenced(column_list) or is_list_inverted(column_list)) |
960 | # Search text box background text is "Search recipes" | 957 | # Search text box background text is "Search recipes" |
961 | self.failUnless(self.driver.find_element_by_xpath("//*[@id='searchform']/*[@placeholder='Search recipes']")) | 958 | self.failUnless(self.driver.find_element_by_xpath("//*[@id='searchform']/*[@placeholder='Search recipes']")) |
962 | self.driver.find_element_by_id("search").clear() | 959 | self.driver.find_element_by_id("search").clear() |
963 | self.driver.find_element_by_id("search").send_keys(test_package2) | 960 | self.driver.find_element_by_id("search").send_keys(test_package2) |
964 | self.driver.find_element_by_css_selector("button.btn").click() | 961 | self.driver.find_element_by_id("search-button").click() |
965 | column_search_list = self.get_table_column_text("class", table_head_dict[key]) | 962 | column_search_list = self.get_table_column_text("class", table_head_dict[key]) |
966 | self.failUnless(is_list_sequenced(column_search_list) or is_list_inverted(column_search_list)) | 963 | self.failUnless(is_list_sequenced(column_search_list) or is_list_inverted(column_search_list)) |
967 | self.driver.find_element_by_css_selector("i.icon-remove").click() | 964 | self.driver.find_element_by_css_selector("i.icon-remove").click() |
@@ -969,14 +966,14 @@ class toaster_cases(toaster_cases_base): | |||
969 | self.find_element_by_link_text_in_table(self.table_name, key).click() | 966 | self.find_element_by_link_text_in_table(self.table_name, key).click() |
970 | column_list = self.get_table_column_text("class", table_head_dict[key]) | 967 | column_list = self.get_table_column_text("class", table_head_dict[key]) |
971 | self.failUnless(is_list_sequenced(column_list)) | 968 | self.failUnless(is_list_sequenced(column_list)) |
972 | self.driver.find_element_by_xpath("/html/body/div[2]/div/div[2]/div[2]/table/tbody/tr[1]/td[1]/a").click() | 969 | self.driver.find_element_by_partial_link_text("acl").click() |
973 | self.driver.back() | 970 | self.driver.back() |
974 | self.failUnless(is_list_sequenced(column_list)) | 971 | self.failUnless(is_list_sequenced(column_list)) |
975 | # Search text box background text is "Search recipes" | 972 | # Search text box background text is "Search recipes" |
976 | self.failUnless(self.driver.find_element_by_xpath("//*[@id='searchform']/*[@placeholder='Search recipes']")) | 973 | self.failUnless(self.driver.find_element_by_xpath("//*[@id='searchform']/*[@placeholder='Search recipes']")) |
977 | self.driver.find_element_by_id("search").clear() | 974 | self.driver.find_element_by_id("search").clear() |
978 | self.driver.find_element_by_id("search").send_keys(test_package2) | 975 | self.driver.find_element_by_id("search").send_keys(test_package2) |
979 | self.driver.find_element_by_css_selector("button.btn").click() | 976 | self.driver.find_element_by_id("search-button").click() |
980 | column_search_list = self.get_table_column_text("class", table_head_dict[key]) | 977 | column_search_list = self.get_table_column_text("class", table_head_dict[key]) |
981 | self.failUnless(is_list_sequenced(column_search_list)) | 978 | self.failUnless(is_list_sequenced(column_search_list)) |
982 | self.driver.find_element_by_css_selector("i.icon-remove").click() | 979 | self.driver.find_element_by_css_selector("i.icon-remove").click() |
@@ -985,14 +982,17 @@ class toaster_cases(toaster_cases_base): | |||
985 | self.find_element_by_link_text_in_table(self.table_name, key).click() | 982 | self.find_element_by_link_text_in_table(self.table_name, key).click() |
986 | column_list = self.get_table_column_text("class", table_head_dict[key]) | 983 | column_list = self.get_table_column_text("class", table_head_dict[key]) |
987 | self.failUnless(is_list_inverted(column_list)) | 984 | self.failUnless(is_list_inverted(column_list)) |
988 | self.driver.find_element_by_xpath("/html/body/div[2]/div/div[2]/div[2]/table/tbody/tr[1]/td[1]/a").click() | 985 | try: |
986 | self.driver.find_element_by_partial_link_text("acl").click() | ||
987 | except: | ||
988 | self.driver.find_element_by_partial_link_text("zlib").click() | ||
989 | self.driver.back() | 989 | self.driver.back() |
990 | self.failUnless(is_list_inverted(column_list)) | 990 | self.failUnless(is_list_inverted(column_list)) |
991 | # Search text box background text is "Search recipes" | 991 | # Search text box background text is "Search recipes" |
992 | self.failUnless(self.driver.find_element_by_xpath("//*[@id='searchform']/*[@placeholder='Search recipes']")) | 992 | self.failUnless(self.driver.find_element_by_xpath("//*[@id='searchform']/*[@placeholder='Search recipes']")) |
993 | self.driver.find_element_by_id("search").clear() | 993 | self.driver.find_element_by_id("search").clear() |
994 | self.driver.find_element_by_id("search").send_keys(test_package2) | 994 | self.driver.find_element_by_id("search").send_keys(test_package2) |
995 | self.driver.find_element_by_css_selector("button.btn").click() | 995 | self.driver.find_element_by_id("search-button").click() |
996 | column_search_list = self.get_table_column_text("class", table_head_dict[key]) | 996 | column_search_list = self.get_table_column_text("class", table_head_dict[key]) |
997 | #print column_search_list | 997 | #print column_search_list |
998 | self.failUnless(is_list_inverted(column_search_list)) | 998 | self.failUnless(is_list_inverted(column_search_list)) |
@@ -1002,23 +1002,23 @@ class toaster_cases(toaster_cases_base): | |||
1002 | for key in table_head_dict: | 1002 | for key in table_head_dict: |
1003 | print key | 1003 | print key |
1004 | self.find_element_by_link_text_in_table(self.table_name, key).click() | 1004 | self.find_element_by_link_text_in_table(self.table_name, key).click() |
1005 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1005 | self.driver.find_element_by_id("edit-columns-button").click() |
1006 | self.driver.find_element_by_id(table_head_dict[key]).click() | 1006 | self.driver.find_element_by_id(table_head_dict[key]).click() |
1007 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1007 | self.driver.find_element_by_id("edit-columns-button").click() |
1008 | self.browser_delay() | 1008 | self.browser_delay() |
1009 | # After hide the column, the default table should be sorted by Recipe | 1009 | # After hide the column, the default table should be sorted by Recipe |
1010 | tasks_column_count = len(self.driver.find_elements_by_xpath("/html/body/div[2]/div/div[2]/div[2]/table/tbody/tr/td[1]")) | 1010 | tasks_column_count = len(self.driver.find_elements_by_partial_link_text("acl")) |
1011 | #print tasks_column_count | 1011 | #print tasks_column_count |
1012 | default_column_list = self.get_table_column_text_by_column_number(self.table_name, 1) | 1012 | default_column_list = self.get_table_column_text_by_column_number(self.table_name, 1) |
1013 | #print default_column_list | 1013 | #print default_column_list |
1014 | self.failUnless(is_list_sequenced(default_column_list)) | 1014 | self.failUnless(is_list_sequenced(default_column_list)) |
1015 | 1015 | ||
1016 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1016 | self.driver.find_element_by_id("edit-columns-button").click() |
1017 | self.driver.find_element_by_id("recipe_file").click() | 1017 | self.driver.find_element_by_id("recipe_file").click() |
1018 | self.driver.find_element_by_id("recipe_section").click() | 1018 | self.driver.find_element_by_id("recipe_section").click() |
1019 | self.driver.find_element_by_id("recipe_license").click() | 1019 | self.driver.find_element_by_id("recipe_license").click() |
1020 | self.driver.find_element_by_id("layer_version__layer__name").click() | 1020 | self.driver.find_element_by_id("layer_version__layer__name").click() |
1021 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1021 | self.driver.find_element_by_id("edit-columns-button").click() |
1022 | 1022 | ||
1023 | 1023 | ||
1024 | ############## | 1024 | ############## |
@@ -1034,15 +1034,15 @@ class toaster_cases(toaster_cases_base): | |||
1034 | # step 3-5 | 1034 | # step 3-5 |
1035 | self.driver.find_element_by_id("search").clear() | 1035 | self.driver.find_element_by_id("search").clear() |
1036 | self.driver.find_element_by_id("search").send_keys("lib") | 1036 | self.driver.find_element_by_id("search").send_keys("lib") |
1037 | self.driver.find_element_by_css_selector("button.btn").click() | 1037 | self.driver.find_element_by_id("search-button").click() |
1038 | # save screen here for observation | 1038 | # save screen here for observation |
1039 | self.save_screenshot(screenshot_type='selenium', append_name='step5') | 1039 | self.save_screenshot(screenshot_type='selenium', append_name='step5') |
1040 | # step 6 | 1040 | # step 6 |
1041 | self.driver.find_element_by_css_selector("i.icon-remove").click() | 1041 | self.driver.find_element_by_css_selector("i.icon-remove").click() |
1042 | self.driver.find_element_by_id("search").clear() | 1042 | self.driver.find_element_by_id("search").clear() |
1043 | # we deliberately want "no result" here | 1043 | # we deliberately want "no result" here |
1044 | self.driver.find_element_by_id("search").send_keys("what the hell") | 1044 | self.driver.find_element_by_id("search").send_keys("no such input") |
1045 | self.driver.find_element_by_css_selector("button.btn").click() | 1045 | self.driver.find_element_by_id("search-button").click() |
1046 | self.find_element_by_text("Show all recipes").click() | 1046 | self.find_element_by_text("Show all recipes").click() |
1047 | self.driver.quit() | 1047 | self.driver.quit() |
1048 | 1048 | ||
@@ -1066,7 +1066,6 @@ class toaster_cases(toaster_cases_base): | |||
1066 | self.driver.find_element_by_id("depends_on").click() | 1066 | self.driver.find_element_by_id("depends_on").click() |
1067 | self.driver.find_element_by_id("layer_version__branch").click() | 1067 | self.driver.find_element_by_id("layer_version__branch").click() |
1068 | self.driver.find_element_by_id("layer_version__layer__commit").click() | 1068 | self.driver.find_element_by_id("layer_version__layer__commit").click() |
1069 | self.driver.find_element_by_id("layer_version__local_path").click() | ||
1070 | self.driver.find_element_by_id("depends_by").click() | 1069 | self.driver.find_element_by_id("depends_by").click() |
1071 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1070 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() |
1072 | # check if columns selected above is shown | 1071 | # check if columns selected above is shown |
@@ -1081,7 +1080,6 @@ class toaster_cases(toaster_cases_base): | |||
1081 | self.driver.find_element_by_id("depends_on").click() | 1080 | self.driver.find_element_by_id("depends_on").click() |
1082 | self.driver.find_element_by_id("layer_version__branch").click() | 1081 | self.driver.find_element_by_id("layer_version__branch").click() |
1083 | self.driver.find_element_by_id("layer_version__layer__commit").click() | 1082 | self.driver.find_element_by_id("layer_version__layer__commit").click() |
1084 | self.driver.find_element_by_id("layer_version__local_path").click() | ||
1085 | self.driver.find_element_by_id("depends_by").click() | 1083 | self.driver.find_element_by_id("depends_by").click() |
1086 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1084 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() |
1087 | # don't exist any more | 1085 | # don't exist any more |
@@ -1105,11 +1103,11 @@ class toaster_cases(toaster_cases_base): | |||
1105 | for item in ['Recipe', 'Recipe version', 'Recipe file', 'Section', 'License', 'Layer']: | 1103 | for item in ['Recipe', 'Recipe version', 'Recipe file', 'Section', 'License', 'Layer']: |
1106 | self.failUnless(item in head_list) | 1104 | self.failUnless(item in head_list) |
1107 | # step 4 | 1105 | # step 4 |
1108 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1106 | self.driver.find_element_by_id("edit-columns-button").click() |
1109 | # save screen | 1107 | # save screen |
1110 | self.browser_delay() | 1108 | self.browser_delay() |
1111 | self.save_screenshot(screenshot_type='selenium', append_name='step4') | 1109 | self.save_screenshot(screenshot_type='selenium', append_name='step4') |
1112 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1110 | self.driver.find_element_by_id("edit-columns-button").click() |
1113 | 1111 | ||
1114 | 1112 | ||
1115 | ############## | 1113 | ############## |
@@ -1308,7 +1306,7 @@ class toaster_cases(toaster_cases_base): | |||
1308 | # step 4 | 1306 | # step 4 |
1309 | self.driver.find_element_by_id("search").clear() | 1307 | self.driver.find_element_by_id("search").clear() |
1310 | self.driver.find_element_by_id("search").send_keys("lib") | 1308 | self.driver.find_element_by_id("search").send_keys("lib") |
1311 | self.driver.find_element_by_css_selector("button.btn").click() | 1309 | self.driver.find_element_by_id("search-button").click() |
1312 | # save screen to see result | 1310 | # save screen to see result |
1313 | self.browser_delay() | 1311 | self.browser_delay() |
1314 | self.save_screenshot(screenshot_type='selenium', append_name='step4') | 1312 | self.save_screenshot(screenshot_type='selenium', append_name='step4') |
@@ -1323,7 +1321,7 @@ class toaster_cases(toaster_cases_base): | |||
1323 | # head is still the same | 1321 | # head is still the same |
1324 | self.driver.find_element_by_id("search").clear() | 1322 | self.driver.find_element_by_id("search").clear() |
1325 | self.driver.find_element_by_id("search").send_keys("poky") | 1323 | self.driver.find_element_by_id("search").send_keys("poky") |
1326 | self.driver.find_element_by_css_selector("button.btn").click() | 1324 | self.driver.find_element_by_id("search-button").click() |
1327 | self.find_element_by_link_text_in_table('otable', 'Variable').click() | 1325 | self.find_element_by_link_text_in_table('otable', 'Variable').click() |
1328 | head_list = self.get_table_head_text('otable') | 1326 | head_list = self.get_table_head_text('otable') |
1329 | self.failUnless(head_list == ['Variable', 'Value', 'Set in file', 'Description']) | 1327 | self.failUnless(head_list == ['Variable', 'Value', 'Set in file', 'Description']) |
@@ -1355,7 +1353,7 @@ class toaster_cases(toaster_cases_base): | |||
1355 | # searching won't change the sequentiality | 1353 | # searching won't change the sequentiality |
1356 | self.driver.find_element_by_id("search").clear() | 1354 | self.driver.find_element_by_id("search").clear() |
1357 | self.driver.find_element_by_id("search").send_keys("lib") | 1355 | self.driver.find_element_by_id("search").send_keys("lib") |
1358 | self.driver.find_element_by_css_selector("button.btn").click() | 1356 | self.driver.find_element_by_id("search-button").click() |
1359 | variable_list = self.get_table_column_text('class', 'variable_name') | 1357 | variable_list = self.get_table_column_text('class', 'variable_name') |
1360 | self.failUnless(is_list_sequenced(variable_list)) | 1358 | self.failUnless(is_list_sequenced(variable_list)) |
1361 | 1359 | ||
@@ -1373,11 +1371,11 @@ class toaster_cases(toaster_cases_base): | |||
1373 | c_list = self.get_table_column_text('class', 'completed_on') | 1371 | c_list = self.get_table_column_text('class', 'completed_on') |
1374 | self.failUnless(is_list_inverted(c_list)) | 1372 | self.failUnless(is_list_inverted(c_list)) |
1375 | # step 3 | 1373 | # step 3 |
1376 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1374 | self.driver.find_element_by_id("edit-columns-button").click() |
1377 | self.driver.find_element_by_id("started_on").click() | 1375 | self.driver.find_element_by_id("started_on").click() |
1378 | self.driver.find_element_by_id("log").click() | 1376 | self.driver.find_element_by_id("log").click() |
1379 | self.driver.find_element_by_id("time").click() | 1377 | self.driver.find_element_by_id("time").click() |
1380 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1378 | self.driver.find_element_by_id("edit-columns-button").click() |
1381 | head_list = self.get_table_head_text('otable') | 1379 | head_list = self.get_table_head_text('otable') |
1382 | for item in ['Outcome', 'Target', 'Machine', 'Started on', 'Completed on', 'Failed tasks', 'Errors', 'Warnings', 'Warnings', 'Time']: | 1380 | for item in ['Outcome', 'Target', 'Machine', 'Started on', 'Completed on', 'Failed tasks', 'Errors', 'Warnings', 'Warnings', 'Time']: |
1383 | self.failUnless(item in head_list) | 1381 | self.failUnless(item in head_list) |
@@ -1399,9 +1397,9 @@ class toaster_cases(toaster_cases_base): | |||
1399 | # click Errors , order in "Completed on" should be disturbed. Then hide | 1397 | # click Errors , order in "Completed on" should be disturbed. Then hide |
1400 | # error column to check if order in "Completed on" can be restored | 1398 | # error column to check if order in "Completed on" can be restored |
1401 | self.find_element_by_link_text_in_table('otable', 'Errors').click() | 1399 | self.find_element_by_link_text_in_table('otable', 'Errors').click() |
1402 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1400 | self.driver.find_element_by_id("edit-columns-button").click() |
1403 | self.driver.find_element_by_id("errors_no").click() | 1401 | self.driver.find_element_by_id("errors_no").click() |
1404 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1402 | self.driver.find_element_by_id("edit-columns-button").click() |
1405 | # Note: without time.sleep here, there'll be unpredictable error..TBD | 1403 | # Note: without time.sleep here, there'll be unpredictable error..TBD |
1406 | time.sleep(1) | 1404 | time.sleep(1) |
1407 | c_list = self.get_table_column_text('class', 'completed_on') | 1405 | c_list = self.get_table_column_text('class', 'completed_on') |
@@ -1425,13 +1423,12 @@ class toaster_cases(toaster_cases_base): | |||
1425 | # Step 4 | 1423 | # Step 4 |
1426 | # pulldown menu | 1424 | # pulldown menu |
1427 | option_ids = ['recipe__layer_version__layer__name', 'recipe__layer_version__branch', \ | 1425 | option_ids = ['recipe__layer_version__layer__name', 'recipe__layer_version__branch', \ |
1428 | 'recipe__layer_version__layer__commit', 'recipe__layer_version__local_path', \ | 1426 | 'recipe__layer_version__layer__commit', 'license', 'recipe__version'] |
1429 | 'license', 'recipe__version'] | 1427 | self.driver.find_element_by_id("edit-columns-button").click() |
1430 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | ||
1431 | for item in option_ids: | 1428 | for item in option_ids: |
1432 | if not self.driver.find_element_by_id(item).is_selected(): | 1429 | if not self.driver.find_element_by_id(item).is_selected(): |
1433 | self.driver.find_element_by_id(item).click() | 1430 | self.driver.find_element_by_id(item).click() |
1434 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1431 | self.driver.find_element_by_id("edit-columns-button").click() |
1435 | # save screen here to observe that 'Package' and 'Package version' is | 1432 | # save screen here to observe that 'Package' and 'Package version' is |
1436 | # not selectable | 1433 | # not selectable |
1437 | self.browser_delay() | 1434 | self.browser_delay() |
@@ -1456,6 +1453,44 @@ class toaster_cases(toaster_cases_base): | |||
1456 | 1453 | ||
1457 | 1454 | ||
1458 | ############## | 1455 | ############## |
1456 | # CASE 942 # | ||
1457 | ############## | ||
1458 | def test_942(self): | ||
1459 | self.case_no = self.get_case_number() | ||
1460 | self.log.info(' CASE %s log: ' % str(self.case_no)) | ||
1461 | self.driver.maximize_window() | ||
1462 | self.driver.get(self.base_url) | ||
1463 | self.driver.find_element_by_link_text("core-image-minimal").click() | ||
1464 | self.driver.find_element_by_link_text("Packages").click() | ||
1465 | #get initial table header | ||
1466 | head_list = self.get_table_head_text('otable') | ||
1467 | #remove the Recipe column from table header | ||
1468 | self.driver.find_element_by_id("edit-columns-button").click() | ||
1469 | self.driver.find_element_by_id("recipe__name").click() | ||
1470 | self.driver.find_element_by_id("edit-columns-button").click() | ||
1471 | #get modified table header | ||
1472 | new_head = self.get_table_head_text('otable') | ||
1473 | self.failUnless(head_list > new_head) | ||
1474 | |||
1475 | ############## | ||
1476 | # CASE 943 # | ||
1477 | ############## | ||
1478 | def test_943(self): | ||
1479 | self.case_no = self.get_case_number() | ||
1480 | self.log.info(' CASE %s log: ' % str(self.case_no)) | ||
1481 | self.driver.maximize_window() | ||
1482 | self.driver.get(self.base_url) | ||
1483 | self.driver.find_element_by_link_text("core-image-minimal").click() | ||
1484 | self.driver.find_element_by_link_text("Packages").click() | ||
1485 | #search for the "bash" package -> this should definitely be present | ||
1486 | self.driver.find_element_by_id("search").clear() | ||
1487 | self.driver.find_element_by_id("search").send_keys("bash") | ||
1488 | self.driver.find_element_by_id("search-button").click() | ||
1489 | #check for the search result message "XX packages found" | ||
1490 | self.failUnless(self.is_text_present("packages found")) | ||
1491 | |||
1492 | |||
1493 | ############## | ||
1459 | # CASE 944 # | 1494 | # CASE 944 # |
1460 | ############## | 1495 | ############## |
1461 | def test_944(self): | 1496 | def test_944(self): |
@@ -1467,57 +1502,54 @@ class toaster_cases(toaster_cases_base): | |||
1467 | # step 1: test Recipes page stuff | 1502 | # step 1: test Recipes page stuff |
1468 | self.driver.find_element_by_link_text("Recipes").click() | 1503 | self.driver.find_element_by_link_text("Recipes").click() |
1469 | # for these 3 items, default status is not-checked | 1504 | # for these 3 items, default status is not-checked |
1470 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1505 | self.driver.find_element_by_id("edit-columns-button").click() |
1471 | self.driver.find_element_by_id("layer_version__branch").click() | 1506 | self.driver.find_element_by_id("layer_version__branch").click() |
1472 | self.driver.find_element_by_id("layer_version__layer__commit").click() | 1507 | self.driver.find_element_by_id("layer_version__layer__commit").click() |
1473 | self.driver.find_element_by_id("layer_version__local_path").click() | 1508 | self.driver.find_element_by_id("edit-columns-button").click() |
1474 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | ||
1475 | # otable is the recipes table here | 1509 | # otable is the recipes table here |
1476 | otable_head_text = self.get_table_head_text('otable') | 1510 | otable_head_text = self.get_table_head_text('otable') |
1477 | for item in ["Layer", "Layer branch", "Layer commit", "Layer directory"]: | 1511 | for item in ["Layer", "Layer branch", "Layer commit", "Layer directory"]: |
1478 | self.failIf(item not in otable_head_text) | 1512 | self.failIf(item not in otable_head_text) |
1479 | # click the fist recipe, whatever it is | 1513 | # click the fist recipe, whatever it is |
1480 | self.get_table_element("otable", 1, 1).click() | 1514 | self.get_table_element("otable", 1, 1).click() |
1481 | self.failUnless(self.is_text_present(["Layer", "Layer branch", "Layer commit", "Layer directory", "Recipe file"])) | 1515 | self.failUnless(self.is_text_present(["Layer", "Layer branch", "Layer commit", "Recipe file"])) |
1482 | 1516 | ||
1483 | # step 2: test Packages page stuff. almost same as above | 1517 | # step 2: test Packages page stuff. almost same as above |
1484 | self.driver.back() | 1518 | self.driver.back() |
1485 | self.browser_delay() | 1519 | self.browser_delay() |
1486 | self.driver.find_element_by_link_text("Packages").click() | 1520 | self.driver.find_element_by_link_text("Packages").click() |
1487 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1521 | self.driver.find_element_by_id("edit-columns-button").click() |
1488 | self.driver.find_element_by_id("recipe__layer_version__layer__name").click() | 1522 | self.driver.find_element_by_id("recipe__layer_version__layer__name").click() |
1489 | self.driver.find_element_by_id("recipe__layer_version__branch").click() | 1523 | self.driver.find_element_by_id("recipe__layer_version__branch").click() |
1490 | self.driver.find_element_by_id("recipe__layer_version__layer__commit").click() | 1524 | self.driver.find_element_by_id("recipe__layer_version__layer__commit").click() |
1491 | self.driver.find_element_by_id("recipe__layer_version__local_path").click() | 1525 | self.driver.find_element_by_id("edit-columns-button").click() |
1492 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | ||
1493 | otable_head_text = self.get_table_head_text("otable") | 1526 | otable_head_text = self.get_table_head_text("otable") |
1494 | for item in ["Layer", "Layer branch", "Layer commit", "Layer directory"]: | 1527 | for item in ["Layer", "Layer branch", "Layer commit"]: |
1495 | self.failIf(item not in otable_head_text) | 1528 | self.failIf(item not in otable_head_text) |
1496 | # click the fist recipe, whatever it is | 1529 | # click the fist recipe, whatever it is |
1497 | self.get_table_element("otable", 1, 1).click() | 1530 | self.get_table_element("otable", 1, 1).click() |
1498 | self.failUnless(self.is_text_present(["Layer", "Layer branch", "Layer commit", "Layer directory"])) | 1531 | self.failUnless(self.is_text_present(["Layer", "Layer branch", "Layer commit"])) |
1499 | 1532 | ||
1500 | # step 3: test Packages core-image-minimal(images) stuff. almost same as above. Note when future element-id changes... | 1533 | # step 3: test Packages core-image-minimal(images) stuff. almost same as above. Note when future element-id changes... |
1501 | self.driver.back() | 1534 | self.driver.back() |
1502 | self.driver.find_element_by_link_text("core-image-minimal").click() | 1535 | self.driver.find_element_by_link_text("core-image-minimal").click() |
1503 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1536 | self.driver.find_element_by_id("edit-columns-button").click() |
1504 | self.driver.find_element_by_id("layer_name").click() | 1537 | self.driver.find_element_by_id("layer_name").click() |
1505 | self.driver.find_element_by_id("layer_branch").click() | 1538 | self.driver.find_element_by_id("layer_branch").click() |
1506 | self.driver.find_element_by_id("layer_commit").click() | 1539 | self.driver.find_element_by_id("layer_commit").click() |
1507 | self.driver.find_element_by_id("layer_directory").click() | 1540 | self.driver.find_element_by_id("edit-columns-button").click() |
1508 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | ||
1509 | otable_head_text = self.get_table_head_text("otable") | 1541 | otable_head_text = self.get_table_head_text("otable") |
1510 | for item in ["Layer", "Layer branch", "Layer commit", "Layer directory"]: | 1542 | for item in ["Layer", "Layer branch", "Layer commit"]: |
1511 | self.failIf(item not in otable_head_text) | 1543 | self.failIf(item not in otable_head_text) |
1512 | # click the fist recipe, whatever it is | 1544 | # click the fist recipe, whatever it is |
1513 | self.get_table_element("otable", 1, 1).click() | 1545 | self.get_table_element("otable", 1, 1).click() |
1514 | self.failUnless(self.is_text_present(["Layer", "Layer branch", "Layer commit", "Layer directory"])) | 1546 | self.failUnless(self.is_text_present(["Layer", "Layer branch", "Layer commit"])) |
1515 | 1547 | ||
1516 | # step 4: check Configuration page | 1548 | # step 4: check Configuration page |
1517 | self.driver.back() | 1549 | self.driver.back() |
1518 | self.driver.find_element_by_link_text("Configuration").click() | 1550 | self.driver.find_element_by_link_text("Configuration").click() |
1519 | otable_head_text = self.get_table_head_text() | 1551 | otable_head_text = self.get_table_head_text() |
1520 | for item in ["Layer", "Layer branch", "Layer commit", "Layer directory"]: | 1552 | for item in ["Layer", "Layer branch", "Layer commit"]: |
1521 | self.failIf(item not in otable_head_text) | 1553 | self.failIf(item not in otable_head_text) |
1522 | 1554 | ||
1523 | 1555 | ||
@@ -1568,7 +1600,7 @@ class toaster_cases(toaster_cases_base): | |||
1568 | for item in check_list: | 1600 | for item in check_list: |
1569 | if not self.is_element_present(how=By.LINK_TEXT, what=item): | 1601 | if not self.is_element_present(how=By.LINK_TEXT, what=item): |
1570 | self.log.error("%s not found" %item) | 1602 | self.log.error("%s not found" %item) |
1571 | if not self.is_text_present(['Layers', 'Layer', 'Layer branch', 'Layer commit', 'Layer directory']): | 1603 | if not self.is_text_present(['Layers', 'Layer', 'Layer branch', 'Layer commit']): |
1572 | self.log.error("text not found") | 1604 | self.log.error("text not found") |
1573 | # step 5 | 1605 | # step 5 |
1574 | self.driver.find_element_by_link_text("BitBake variables").click() | 1606 | self.driver.find_element_by_link_text("BitBake variables").click() |
@@ -1579,18 +1611,24 @@ class toaster_cases(toaster_cases_base): | |||
1579 | temp_element = self.find_element_by_text_in_table('otable', "Set in file") | 1611 | temp_element = self.find_element_by_text_in_table('otable', "Set in file") |
1580 | temp_element.find_element_by_xpath("..//*/a/i[@class='icon-filter filtered']").click() | 1612 | temp_element.find_element_by_xpath("..//*/a/i[@class='icon-filter filtered']").click() |
1581 | self.browser_delay() | 1613 | self.browser_delay() |
1582 | self.driver.find_element_by_xpath("(//input[@name='filter'])[2]").click() | 1614 | self.driver.find_element_by_xpath("(//input[@name='filter'])[3]").click() |
1583 | self.driver.find_element_by_css_selector("button.btn.btn-primary").click() | 1615 | btns = self.driver.find_elements_by_css_selector("button.btn.btn-primary") |
1616 | for btn in btns: | ||
1617 | try: | ||
1618 | btn.click() | ||
1619 | break | ||
1620 | except: | ||
1621 | pass | ||
1584 | # save screen here | 1622 | # save screen here |
1585 | self.browser_delay() | 1623 | self.browser_delay() |
1586 | self.save_screenshot(screenshot_type='selenium', append_name='step6') | 1624 | self.save_screenshot(screenshot_type='selenium', append_name='step6') |
1587 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1625 | self.driver.find_element_by_id("edit-columns-button").click() |
1588 | # save screen here | 1626 | # save screen here |
1589 | # step 7 | 1627 | # step 7 |
1590 | # we should manually check the step 6-8 result using screenshot | 1628 | # we should manually check the step 6-8 result using screenshot |
1591 | self.browser_delay() | 1629 | self.browser_delay() |
1592 | self.save_screenshot(screenshot_type='selenium', append_name='step7') | 1630 | self.save_screenshot(screenshot_type='selenium', append_name='step7') |
1593 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1631 | self.driver.find_element_by_id("edit-columns-button").click() |
1594 | # step 9 | 1632 | # step 9 |
1595 | # click the 1st item, no matter what it is | 1633 | # click the 1st item, no matter what it is |
1596 | self.driver.find_element_by_xpath("//*[@id='otable']/tbody/tr[1]/td[1]/a").click() | 1634 | self.driver.find_element_by_xpath("//*[@id='otable']/tbody/tr[1]/td[1]/a").click() |
@@ -1602,7 +1640,7 @@ class toaster_cases(toaster_cases_base): | |||
1602 | if item not in element.text: | 1640 | if item not in element.text: |
1603 | self.log.error("%s not found" %item) | 1641 | self.log.error("%s not found" %item) |
1604 | # any better way to close this pop-up? ... TBD | 1642 | # any better way to close this pop-up? ... TBD |
1605 | element.find_element_by_xpath(".//*[@class='close']").click() | 1643 | element.find_element_by_class_name("close").click() |
1606 | # step 10 : need to manually check "Yocto Manual" in saved screen | 1644 | # step 10 : need to manually check "Yocto Manual" in saved screen |
1607 | self.driver.find_element_by_css_selector("i.icon-share.get-info").click() | 1645 | self.driver.find_element_by_css_selector("i.icon-share.get-info").click() |
1608 | # save screen here | 1646 | # save screen here |
@@ -1627,20 +1665,20 @@ class toaster_cases(toaster_cases_base): | |||
1627 | # return xpath of options under "Edit columns" button | 1665 | # return xpath of options under "Edit columns" button |
1628 | return self.shortest_xpath('id', 'navTab') + self.shortest_xpath('id', 'editcol') \ | 1666 | return self.shortest_xpath('id', 'navTab') + self.shortest_xpath('id', 'editcol') \ |
1629 | + self.shortest_xpath('id', column_name) | 1667 | + self.shortest_xpath('id', column_name) |
1630 | self.find_element_by_xpath_in_table('navTab', self.shortest_xpath('class', 'btn dropdown-toggle')).click() | 1668 | self.driver.find_element_by_id('edit-columns-button').click() |
1631 | # by default, option "Description" and "Set in file" were checked | 1669 | # by default, option "Description" and "Set in file" were checked |
1632 | self.driver.find_element_by_xpath(xpath_option('description')).click() | 1670 | self.driver.find_element_by_xpath(xpath_option('description')).click() |
1633 | self.driver.find_element_by_xpath(xpath_option('file')).click() | 1671 | self.driver.find_element_by_xpath(xpath_option('file')).click() |
1634 | self.find_element_by_xpath_in_table('navTab', self.shortest_xpath('class', 'btn dropdown-toggle')).click() | 1672 | self.driver.find_element_by_id('edit-columns-button').click() |
1635 | check_list = ['Description', 'Set in file'] | 1673 | check_list = ['Description', 'Set in file'] |
1636 | head_list = self.get_table_head_text('otable') | 1674 | head_list = self.get_table_head_text('otable') |
1637 | for item in check_list: | 1675 | for item in check_list: |
1638 | self.failIf(item in head_list) | 1676 | self.failIf(item in head_list) |
1639 | # check these 2 options and verify again | 1677 | # check these 2 options and verify again |
1640 | self.find_element_by_xpath_in_table('navTab', self.shortest_xpath('class', 'btn dropdown-toggle')).click() | 1678 | self.driver.find_element_by_id('edit-columns-button').click() |
1641 | self.driver.find_element_by_xpath(xpath_option('description')).click() | 1679 | self.driver.find_element_by_xpath(xpath_option('description')).click() |
1642 | self.driver.find_element_by_xpath(xpath_option('file')).click() | 1680 | self.driver.find_element_by_xpath(xpath_option('file')).click() |
1643 | self.find_element_by_xpath_in_table('navTab', self.shortest_xpath('class', 'btn dropdown-toggle')).click() | 1681 | self.driver.find_element_by_id('edit-columns-button').click() |
1644 | head_list = self.get_table_head_text('otable') | 1682 | head_list = self.get_table_head_text('otable') |
1645 | for item in check_list: | 1683 | for item in check_list: |
1646 | self.failUnless(item in head_list) | 1684 | self.failUnless(item in head_list) |
@@ -1657,66 +1695,15 @@ class toaster_cases(toaster_cases_base): | |||
1657 | self.driver.find_element_by_link_text("core-image-minimal").click() | 1695 | self.driver.find_element_by_link_text("core-image-minimal").click() |
1658 | self.find_element_by_link_text_in_table('nav', 'Configuration').click() | 1696 | self.find_element_by_link_text_in_table('nav', 'Configuration').click() |
1659 | self.driver.find_element_by_link_text("BitBake variables").click() | 1697 | self.driver.find_element_by_link_text("BitBake variables").click() |
1660 | number_before_search = list() | 1698 | #get number of variables visible by default |
1661 | number_after_search = list() | 1699 | number_before_search = self.driver.find_element_by_class_name('page-header').text |
1662 | # step 3 | ||
1663 | # temp_dict -- filter string : filter name in firepath | ||
1664 | temp_dict = {'Set in file':'filter_vhistory__file_name', 'Description':'filter_description'} | ||
1665 | count = 0 | ||
1666 | for key in temp_dict: | ||
1667 | try: | ||
1668 | temp_element = self.find_element_by_text_in_table('otable', key) | ||
1669 | temp_element.find_element_by_xpath("..//*[@class='icon-filter filtered']").click() | ||
1670 | # delay here. otherwise it won't get correct "text" we need. | ||
1671 | # TBD | ||
1672 | time.sleep(1) | ||
1673 | # step 4-5, we need to make sure that "search" manipulation | ||
1674 | # does reduce the number in the filter. | ||
1675 | # in this case, text returned will be "All variables (xxx)" | ||
1676 | temp_text = self.driver.find_element_by_xpath("//*[@id='" + temp_dict[key] + "']//*[@class='radio']").text | ||
1677 | number_list = extract_number_from_string(temp_text) | ||
1678 | print number_list | ||
1679 | # probably we only need the first number. in this case. | ||
1680 | number_before_search.append(eval(number_list[0])) | ||
1681 | count +=1 | ||
1682 | # how we locate the close button | ||
1683 | self.driver.find_element_by_xpath("//*[@id='" + temp_dict[key] + "']//*[@class='close']").click() | ||
1684 | self.browser_delay() | ||
1685 | except Exception,e: | ||
1686 | self.log.error(e) | ||
1687 | raise | ||
1688 | # search for a while... | 1700 | # search for a while... |
1689 | self.driver.find_element_by_id("search").clear() | 1701 | self.driver.find_element_by_id("search").clear() |
1690 | self.driver.find_element_by_id("search").send_keys("BB") | 1702 | self.driver.find_element_by_id("search").send_keys("BB") |
1691 | self.driver.find_element_by_css_selector("button.btn").click() | 1703 | self.driver.find_element_by_id("search-button").click() |
1692 | # same operation as above, only to get the new numbers in the filter | 1704 | #get number of variables visible after search |
1693 | count = 0 | 1705 | number_after_search = self.driver.find_element_by_class_name('page-header').text |
1694 | for key in temp_dict: | 1706 | self.failUnless(number_before_search > number_after_search) |
1695 | try: | ||
1696 | temp_element = self.find_element_by_text_in_table('otable', key) | ||
1697 | temp_element.find_element_by_xpath("..//*[@class='icon-filter filtered']").click() | ||
1698 | time.sleep(1) | ||
1699 | # in this case, text returned will be "All variables (xxx)" | ||
1700 | temp_text = self.driver.find_element_by_xpath("//*[@id='" + temp_dict[key] + "']//*[@class='radio']").text | ||
1701 | number_list = extract_number_from_string(temp_text) | ||
1702 | # probably we only need the first number. in this case. | ||
1703 | number_after_search.append(eval(number_list[0])) | ||
1704 | count += 1 | ||
1705 | # how we locate the close button | ||
1706 | self.driver.find_element_by_xpath("//*[@id='" + temp_dict[key] + "']//*[@class='close']").click() | ||
1707 | self.browser_delay() | ||
1708 | except Exception,e: | ||
1709 | self.log.error(e) | ||
1710 | raise | ||
1711 | for i in range(0, count): | ||
1712 | print i | ||
1713 | print number_after_search[i] | ||
1714 | print number_before_search[i] | ||
1715 | if number_after_search[i] < number_before_search[i]: | ||
1716 | self.log.info("After search, filter number reduces") | ||
1717 | else: | ||
1718 | self.log.error("Error: After search, filter number doesn't reduce") | ||
1719 | self.failIf(True) | ||
1720 | 1707 | ||
1721 | 1708 | ||
1722 | ############## | 1709 | ############## |
@@ -1741,11 +1728,11 @@ class toaster_cases(toaster_cases_base): | |||
1741 | for item in ['Package', 'Package version', 'Size', 'Dependencies', 'Reverse dependencies', 'Recipe']: | 1728 | for item in ['Package', 'Package version', 'Size', 'Dependencies', 'Reverse dependencies', 'Recipe']: |
1742 | self.failUnless(item in head_list) | 1729 | self.failUnless(item in head_list) |
1743 | # step 5-6 | 1730 | # step 5-6 |
1744 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1731 | self.driver.find_element_by_id("edit-columns-button").click() |
1745 | selectable_class = 'checkbox' | 1732 | selectable_class = 'checkbox' |
1746 | # minimum-table : means unselectable items | 1733 | # minimum-table : means unselectable items |
1747 | unselectable_class = 'checkbox muted' | 1734 | unselectable_class = 'checkbox muted' |
1748 | selectable_check_list = ['Dependencies', 'Layer', 'Layer branch', 'Layer commit', 'Layer directory', \ | 1735 | selectable_check_list = ['Dependencies', 'Layer', 'Layer branch', 'Layer commit', \ |
1749 | 'License', 'Recipe', 'Recipe version', 'Reverse dependencies', \ | 1736 | 'License', 'Recipe', 'Recipe version', 'Reverse dependencies', \ |
1750 | 'Size', 'Size over total (%)'] | 1737 | 'Size', 'Size over total (%)'] |
1751 | unselectable_check_list = ['Package', 'Package version'] | 1738 | unselectable_check_list = ['Package', 'Package version'] |
@@ -1766,7 +1753,7 @@ class toaster_cases(toaster_cases_base): | |||
1766 | if item not in unselectable_list: | 1753 | if item not in unselectable_list: |
1767 | self.log.error(" %s not found in dropdown menu \n" % item) | 1754 | self.log.error(" %s not found in dropdown menu \n" % item) |
1768 | self.failIf(True) | 1755 | self.failIf(True) |
1769 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | 1756 | self.driver.find_element_by_id("edit-columns-button").click() |
1770 | # step 7 | 1757 | # step 7 |
1771 | self.driver.find_element_by_partial_link_text("Directory structure").click() | 1758 | self.driver.find_element_by_partial_link_text("Directory structure").click() |
1772 | head_list = self.get_table_head_text('dirtable') | 1759 | head_list = self.get_table_head_text('dirtable') |
@@ -1894,31 +1881,3 @@ class toaster_cases(toaster_cases_base): | |||
1894 | self.log.error("please check [Toaster manual] link on page") | 1881 | self.log.error("please check [Toaster manual] link on page") |
1895 | self.failIf(True) | 1882 | self.failIf(True) |
1896 | 1883 | ||
1897 | |||
1898 | ############## | ||
1899 | # CASE 959 # | ||
1900 | ############## | ||
1901 | def test_959(self): | ||
1902 | self.case_no = self.get_case_number() | ||
1903 | self.log.info(' CASE %s log: ' % str(self.case_no)) | ||
1904 | self.driver.maximize_window() | ||
1905 | self.driver.get(self.base_url) | ||
1906 | self.driver.find_element_by_link_text("core-image-minimal").click() | ||
1907 | # step 2-3 | ||
1908 | self.find_element_by_link_text_in_table('nav', 'Tasks').click() | ||
1909 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | ||
1910 | self.driver.find_element_by_id("task_log").click() | ||
1911 | self.driver.find_element_by_css_selector("button.btn.dropdown-toggle").click() | ||
1912 | # step 4: "Not Executed" tasks have no log. So click "Log"... | ||
1913 | self.find_element_by_link_text_in_table('otable', 'Log').click() | ||
1914 | # save screen to see if there's "absolute path" of logs | ||
1915 | self.browser_delay() | ||
1916 | self.save_screenshot(screenshot_type='selenium', append_name='step4_1') | ||
1917 | self.find_element_by_link_text_in_table('otable', 'Log').click() | ||
1918 | # save screen to see if there's "absolute path" of logs | ||
1919 | self.browser_delay() | ||
1920 | self.save_screenshot(screenshot_type='selenium', append_name='step4_2') | ||
1921 | |||
1922 | |||
1923 | |||
1924 | |||