|
1 | | -""" |
2 | | -TODO: Commented out because https://github.com/galaxyproject/galaxy/pull/20771 changes the way the |
3 | | -`Tour.vue` frontend component is mounted, and therefore, `Tool Describing Tours` do not work anymore; |
4 | | -which by the way, didn't seem to be working currently anyways. Upcoming work will change tour generation |
5 | | -from a webhook to core functionality. And this file must be uncommented and updated accordingly. |
6 | | -""" |
7 | | - |
8 | | -# import unittest |
9 | | - |
10 | | -# from .framework import ( |
11 | | -# selenium_test, |
12 | | -# SeleniumTestCase, |
13 | | -# ) |
14 | | - |
15 | | - |
16 | | -# class TestToolDescribingTours(SeleniumTestCase): |
17 | | -# def setUp(self): |
18 | | -# super().setUp() |
19 | | -# self.home() |
20 | | - |
21 | | -# @selenium_test |
22 | | -# def test_generate_tour_no_data(self): |
23 | | -# """Ensure a tour without data is generated and pops up.""" |
24 | | -# self._ensure_tdt_available() |
25 | | - |
26 | | -# self.tool_open("environment_variables") |
27 | | - |
28 | | -# self.tool_form_generate_tour() |
29 | | - |
30 | | -# popover_component = self.components.tour.popover._ |
31 | | -# popover_component.wait_for_visible() |
32 | | - |
33 | | -# title = popover_component.title.wait_for_visible().text |
34 | | -# assert title == "environment_variables Tour", title |
35 | | - |
36 | | -# # Run tool |
37 | | -# self.tool_form_execute() |
38 | | -# self.history_panel_wait_for_hid_ok(1) |
39 | | - |
40 | | -# @selenium_test |
41 | | -# def test_generate_tour_with_data(self): |
42 | | -# """Ensure a tour with data populates history.""" |
43 | | -# self._ensure_tdt_available() |
44 | | -# self.tool_open("md5sum") |
45 | | -# self.tool_form_generate_tour() |
46 | | -# self.history_panel_wait_for_hid_ok(1) |
47 | | - |
48 | | -# popover_component = self.components.tour.popover._ |
49 | | -# popover_component.wait_for_visible() |
50 | | - |
51 | | -# title = popover_component.title.wait_for_visible().text |
52 | | -# assert title == "md5sum Tour", title |
53 | | -# self.screenshot("tool_describing_tour_0_start") |
54 | | - |
55 | | -# popover_component.next.wait_for_and_click() |
56 | | -# self.sleep_for(self.wait_types.UX_RENDER) |
57 | | - |
58 | | -# text = popover_component.content.wait_for_visible().text |
59 | | -# assert "Select dataset" in text, text |
60 | | -# self.screenshot("tool_describing_tour_1_select") |
61 | | - |
62 | | -# popover_component.next.wait_for_and_click() |
63 | | -# self.sleep_for(self.wait_types.UX_RENDER) |
64 | | - |
65 | | -# title = popover_component.title.wait_for_visible().text |
66 | | -# assert title == "Execute tool" |
67 | | -# self.screenshot("tool_describing_tour_2_execute") |
68 | | - |
69 | | -# popover_component.end.wait_for_and_click() |
70 | | -# popover_component.wait_for_absent_or_hidden() |
71 | | - |
72 | | -# # Run tool |
73 | | -# self.tool_form_execute() |
74 | | -# self.history_panel_wait_for_hid_ok(2) |
75 | | -# self.screenshot("tool_describing_tour_3_after_execute") |
76 | | - |
77 | | -# def _ensure_tdt_available(self): |
78 | | -# """Skip a test if the webhook TDT doesn't appear.""" |
79 | | -# response = self.api_get("webhooks", raw=True) |
80 | | -# assert response.status_code == 200 |
81 | | -# data = response.json() |
82 | | -# webhooks = [x["id"] for x in data] |
83 | | -# if "tour_generator" not in webhooks: |
84 | | -# raise unittest.SkipTest('Skipping test, webhook "Tool-Describing-Tours" doesn\'t appear to be configured.') |
| 1 | +from .framework import ( |
| 2 | + selenium_test, |
| 3 | + SeleniumTestCase, |
| 4 | +) |
| 5 | + |
| 6 | + |
| 7 | +class TestToolDescribingTours(SeleniumTestCase): |
| 8 | + def setUp(self): |
| 9 | + super().setUp() |
| 10 | + self.home() |
| 11 | + |
| 12 | + @selenium_test |
| 13 | + def test_generate_tour_no_data(self): |
| 14 | + """Ensure a tour without data is generated and pops up.""" |
| 15 | + self.tool_open("environment_variables") |
| 16 | + |
| 17 | + self.tool_form_generate_tour() |
| 18 | + |
| 19 | + popover_component = self.components.tour.popover._ |
| 20 | + popover_component.wait_for_visible() |
| 21 | + |
| 22 | + title = popover_component.title.wait_for_visible().text |
| 23 | + assert title == "environment_variables Tour", title |
| 24 | + |
| 25 | + # Run tool |
| 26 | + self.tool_form_execute() |
| 27 | + self.history_panel_wait_for_hid_ok(1) |
| 28 | + |
| 29 | + @selenium_test |
| 30 | + def test_generate_tour_with_data(self): |
| 31 | + """Ensure a tour with data populates history.""" |
| 32 | + self.tool_open("md5sum") |
| 33 | + self.tool_form_generate_tour() |
| 34 | + self.history_panel_wait_for_hid_ok(1) |
| 35 | + |
| 36 | + popover_component = self.components.tour.popover._ |
| 37 | + popover_component.wait_for_visible() |
| 38 | + |
| 39 | + title = popover_component.title.wait_for_visible().text |
| 40 | + assert title == "md5sum Tour", title |
| 41 | + self.screenshot("tool_describing_tour_0_start") |
| 42 | + |
| 43 | + popover_component.next.wait_for_and_click() |
| 44 | + self.sleep_for(self.wait_types.UX_RENDER) |
| 45 | + |
| 46 | + text = popover_component.content.wait_for_visible().text |
| 47 | + assert "Select dataset" in text, text |
| 48 | + self.screenshot("tool_describing_tour_1_select") |
| 49 | + |
| 50 | + popover_component.next.wait_for_and_click() |
| 51 | + self.sleep_for(self.wait_types.UX_RENDER) |
| 52 | + |
| 53 | + title = popover_component.title.wait_for_visible().text |
| 54 | + assert title == "Execute tool" |
| 55 | + self.screenshot("tool_describing_tour_2_execute") |
| 56 | + |
| 57 | + popover_component.end.wait_for_and_click() |
| 58 | + popover_component.wait_for_absent_or_hidden() |
| 59 | + |
| 60 | + # Run tool |
| 61 | + self.tool_form_execute() |
| 62 | + self.history_panel_wait_for_hid_ok(2) |
| 63 | + self.screenshot("tool_describing_tour_3_after_execute") |
0 commit comments