Commit Graph
126 Commits
Author SHA1 Message Date
John Chilton cc5f44bccc Comment out test that doesn't work on Jenkins.
I don't know why it doesn't work - I'll revisit later but Jenkins is currently broken.
2017-10-04 14:02:12 -04:00
John Chilton 225ad7fb45 Continue push toward smarter component based Selenium testing.
This continues a thread started in 0650978a91 and #4732 of switching to smarter selectors from a more structured YAML description of the Galaxy DOM. This continues that by:

- Eliminating any use of the old navigation YAML file (navigation-data.yml).
- Replace href selectors with other things since they break when testing Galaxy with a proxy-prefix.
- Extending the raw selectors to allow concept of nesting selectors.
- Building even smarter "components" that wrap these raw selectors generated from the YAML directly in a way that allows them to utilize the actual Selenium session and helper class.

So the old ``self.navigation_data`` is gone, ``self.navigation`` still yields the raw selectors, and ``self.components`` yields the smarter variant. Hopefully all will agree the code that uses ``self.components`` is more compact and readable.

The following a very basic example of this:

```diff
     def click_masthead_user(self):
-        self.wait_for_and_click(self.navigation.masthead.selectors.user)
+        self.components.masthead.user.wait_for_and_click()

```

Here is an example of combining it with the new child selector syntax:

```diff
     def assert_item_dbkey_displayed_as(self, hid, dbkey):
-        item_body_selector = self.history_panel_item_body_selector(hid=hid, wait=True)
-        dbkey_selector = item_body_selector + ' ' + self.test_data["historyPanel"]["selectors"]["hda"]["dbkey"]
-        dbkey_element = self.wait_for_selector_visible(dbkey_selector)
-        assert dbkey in dbkey_element.text
+        item_body = self.history_panel_item_component(hid=hid)
+        dbkey_text = item_body.dbkey.wait_for_text()
+        assert dbkey in dbkey_text

```
2017-10-04 12:53:34 -04:00
John Chilton 3c64167788 Initial work on selenium testing for libraries.
- Test importing datasets from histories.
- Test basic importing of a dataset from a path.
- Test creating a folder.
- Test create library, renaming a library, filtering libraries by name, and sorting of libraries.
- Test various buttons (e.g. details, help).
2017-10-03 11:59:39 -04:00
John Chilton 0650978a91 Switch to a new more structured YAML format for navigation data.
Break everything into components.
2017-10-02 11:54:59 -04:00
John Chilton 2d521ff927 Capture screenshots and such for setUp problems in Selenium tests as well. 2017-10-02 09:50:37 -04:00
John Chilton bff364753a Add Selenium test case for testing bits of navigates_galaxy.py. 2017-10-02 09:50:37 -04:00
John Chilton cc3c3a9b92 Implement outline of Jupyter testing. 2017-10-02 09:50:37 -04:00
John Chilton 395eefcbb2 Selenium - implement managed_history decorator for tests.
Creates and deletes a history for tests - good for tests meant to aim at production servers that need to have useful metadata and need to be cleaned up.
2017-10-02 09:50:37 -04:00
John Chilton 14d4367cc4 Allow forcing a particular user for some Selenium tests. 2017-10-02 09:50:37 -04:00
John Chilton c9915fc7e6 Switch to configurable, scaling approach to Selenium timeouts.
Implement different "WAIT_TYPES" and try to sleep for different amounts of time based on what is being waited for.

Replace sleep statements in addition to Selenium wait on statements.
2017-10-02 09:50:37 -04:00
John Chilton afaea964cf Selenium - cleanup duplication of DEFAULT_PASSWORD variable. 2017-10-02 09:50:37 -04:00
John Chilton 28c8644f02 More history panel abstractions in NavigatesGalaxy. 2017-10-02 09:50:37 -04:00
John Chilton cce59aeb55 Remove deprecated method click_hda_title in navigates_galaxy. 2017-10-02 09:50:37 -04:00
John Chilton 2e3c6e8941 Selenium - bug fix for checking workflow names on workflow index page.
xref https://jenkins.galaxyproject.org/job/selenium/654/artifact/654-test-errors/test_rename2017092708331506515637/
2017-09-29 15:06:26 -04:00
John Chilton e132521255 Selenium - bug fix for grabbing history name during transition.
xref https://jenkins.galaxyproject.org/job/selenium/654/artifact/654-test-errors/test_history_switch2017092708211506514917/
2017-09-29 15:06:26 -04:00
John Chilton 0dd7f01008 Merge pull request #4681 from guerler/replace_analysis_forms
Remove history renaming mako
2017-09-26 09:42:10 -04:00
John Chilton afe1ea7f20 Fix test_saved_histories.py for #4681. 2017-09-26 09:40:23 -04:00
Nicola Soranzo 9b1832abb1 Fix import order for cron/, scripts/ and test/ 2017-09-25 23:44:39 +01:00
John Chilton 9f5309688e Import order fix. 2017-09-24 17:13:36 -04:00
John Chilton 9d3ed321be Selenium - fix transient history in test_saved_histories related to fetching history names.
xref https://jenkins.galaxyproject.org/job/selenium/588/artifact/588-test-errors/test_delete_and_undelete_history2017092415231506281014/stacktrace.txt
2017-09-24 17:00:59 -04:00
John Chilton 97cf3b94d1 Selenium - fix transiently failing test caused by not waiting on anonymous history loading.
After logging out - may need to a wait a second to give the UI and backend a chance to create a new history for the now anoymous user. Pause and let that happen.

xref https://jenkins.galaxyproject.org/job/selenium/585/artifact/585-test-errors/test_clean_anon_history_after_logout2017092412041506269041/
2017-09-24 17:00:53 -04:00
John Chilton c90a84e1c2 Selenium - fix transient error in history switching test.
History sometimes takes longer than that second to switch in the GUI, so start a retry cycle on that assertion after a half a second.

xref https://jenkins.galaxyproject.org/job/selenium/586/artifact/586-test-errors/test_history_switch2017092413201506273602/stacktrace.txt
2017-09-24 17:00:43 -04:00
John Chilton 6168e243b2 Selenium - fix rerunning test errors for test_custom_builds.
Fixed similar problem for saved histories tests with 341667437a. Should fix this problem https://jenkins.galaxyproject.org/job/selenium/568/artifact/568-test-errors/test_build_delete2017092319091506208182/stacktrace.txt.
2017-09-24 17:00:43 -04:00
John Chilton 76fe60180a Selenium - fix bug where snapshots might be used in tests before it is setup. 2017-09-24 17:00:38 -04:00
John Chilton aa825d22aa Selenium - fix transient issue with saved histories test. 2017-09-24 16:59:19 -04:00
Martin Cech 3014b1068b remove unused import 2017-09-22 14:44:59 -04:00
John Chilton 341667437a Fix selenium test retrying of tests in test_saved_histories.
The automatic retrying of tests only runs for methods - not for the full test case (if that makes sense) - so setUp() isn't rerun. By refactoring the login action out of the setUp method and into the test function for these cases - when the test is retried the user should be logged back in again as well.
2017-09-22 09:24:32 -04:00
John Chilton cf037fcc0c Selenium - more robust modal checking in test_workflow_editor.
During this transient failure:

https://jenkins.galaxyproject.org/job/selenium/519/artifact/519-test-errors/test_missing_tools2017092118271506032874/stacktrace.txt

the workflow was still loading when an assertion about the resulting modal text was issued. Avoiding the arbitrary sleep and instead just retrying the assertion until it holds true or times out is more robust and should prevent that.
2017-09-22 09:10:08 -04:00
John Chilton 17348a62fe Selenium - more robust inline searching for published histories grid.
Refactor recent search improvement for workflow management into a method that can be shared with published histories grid. Should address the transient failure test here:

https://jenkins.galaxyproject.org/job/selenium/521/artifact/521-test-errors/test_history_grid_search_standard2017092120151506039303/stacktrace.txt
2017-09-22 08:57:20 -04:00
John Chilton 77b61ba82d Selenium - attempted fix for transiently failing history options test.
Comments inline about this - but the target failure I'm hoping this fixes is:

https://jenkins.galaxyproject.org/job/selenium/528/artifact/528-test-errors/test_options2017092203081506064101/stacktrace.txt
2017-09-22 08:57:18 -04:00
John Chilton 9e6e340adc Selenium - handle potentially stale search box on workflow index page.
https://jenkins.galaxyproject.org/job/selenium/530/artifact/530-test-errors/test_index_search2017092205301506072611/stacktrace.txt
2017-09-22 08:56:36 -04:00
John Chilton 4ee18019e0 Fix Selenium tests outright broken in #4669.
Way to go @jmchilton.
2017-09-21 15:55:35 -04:00
Martin Cech 00677fc0f6 Merge pull request #4653 from jmchilton/selenium_fixes_28
Improve robustness of published workflow display test case.
2017-09-21 12:55:41 -04:00
Martin Cech 35cd933945 Merge pull request #4655 from jmchilton/selenium_fixes_29
Aggressively retry buggy submit_login() function in Selenium tests.
2017-09-21 12:55:20 -04:00
John Chilton a45e7e196b Fix transiently failing saved histories due to success message disappearing. 2017-09-21 11:13:03 -04:00
John Chilton 095307b678 Selenium fixes for publishing histories button.
Fixes https://jenkins.galaxyproject.org/job/selenium/488/testReport/junit/selenium_tests.test_published_histories_grid/HistoryGridTestCase/test_history_grid_histories/.

It looks like a Toastr popup sometimes intercepts the click, this should solve that I believe.
2017-09-20 13:35:02 -04:00
John Chilton 01eb5f04e6 Aggressively retry buggy submit_login() function in Selenium tests.
I don't get why when we click submit the user does not actually get logged in, but based on the last round of improved error messages this seems to be the case. You might think there is some callback in the login form that doesn't get registered by the time Selenium clicks the submit button - but this doesn't seem to be the case - I don't see any jquery magic happening in login.mako.

Should fix failures like this:

https://jenkins.galaxyproject.org/job/selenium/482/testReport/junit/selenium_tests.test_saved_histories/SavedHistoriesTestCase/test_history_publish/

I'd say at this point this is the most common problem in the Selenium tests.

This also introduces a framework for taking state snapshots of the Galaxy interface during tests that will only get written out if the tests fail. We now take screenshots before and after submitting the login form but this is a general purpose debugging mechanism that could be used other places.
2017-09-20 10:28:41 -04:00
John Chilton aa68d38735 Improve robustness of published workflow display test case.
Failed twice in different ways here https://jenkins.galaxyproject.org/job/selenium/484/ - this should address both cases.
2017-09-20 08:29:25 -04:00
John Chilton 87bb576c39 Improved state handling for @anatskiy-style Selenium tests.
These tests aren't idealized unittest.TestCase because they initialize class level data in instance level methods. While this isn't ideal, it is seems an entirely fair workaround given that SeleniumTestCase setups up the Selenium connection itself in an instance method - so class-level initializers would not be able to setup Galaxy data. Since I think we will continue using this pattern then, probably best to formalize it a bit and improve error handling.

This provides a formal super class for these test cases that provides a uniform method for setting up the class level data and tracks whether this is successful or not. This serves a couple purposes beyond simple uniformity. First, it tracks if the state has actually been setup or not and will skip subsequent tests if it hasn't. Some of these tests aren't passing very consistently on Jenkins and so we get a bunch of extra noise for tests that are attempting to run without their preconditions met - this will fix that and make the original errors much more clear. Moving the "hacky" part of this into the framework itself also means the tests themselves don't have to repeat hacks like seeing if variables are set with ``getattr`` and such - I always prefer one framework hack to a dozen application hacks.
2017-09-19 10:33:26 -04:00
Evgeny Anatskiy e01b57da58 small improvement 2017-09-18 22:28:04 +02:00
Evgeny Anatskiy db67d254ed don't test the uploading of fasta files 2017-09-18 21:17:00 +02:00
Evgeny Anatskiy 2c128b097a add custom builds tests 2017-09-14 18:30:41 +02:00
John Chilton 79a37830bb Small improvements to workflow editor Selenium tests.
I saw a failed test earlier that would have been fixed by a switch to wait_for_and_click in workflow_editor_click_options. This makes that switch and moves some of these workflow editor helper functions into navigates_galaxy.py for reuse by other test cases and by library users.
2017-09-11 11:30:36 -04:00
Dannon Baker a190903bd0 Merge pull request #4588 from jmchilton/selenium_fixes_25
Make history sharing Selenium tests more robust and informative.
2017-09-11 11:21:14 -04:00
Evgeny Anatskiy 5146455164 generate random history names for the published history grid tests 2017-09-11 16:45:34 +02:00
Evgeny Anatskiy dcc18134e7 generate random history names 2017-09-11 15:30:09 +02:00
John Chilton e2730ca714 Reduce duplication, increase robustness in Selenium history tests.
- set_tags() appeared in both published and saved history tests, refactored into navigates_galaxy with function name history_panel_add_tags
- is_displayed() appeared in both published and saved history tests, refactored into has_driver as selector_is_displayed
- Introduced history_panel_rename to reduce duplication across history panel tests and newer published and saved history tests.
- Removed custom history click option helper in saved and published history tests and just used the variant in navigates_galaxy.
- use wait_for_and_click a couple more places...
2017-09-10 17:58:10 -04:00
John Chilton b61ca47c99 Make history sharing tests more robust and informative.
- Be sure when sharing a history with a user we wait to actually see that user's e-mail address appear in the history's sharing list after submission.
- Print something for the failed history sharing assertions (I'm pretty sure they are 403 errors because some aspect of the sharing or login didn't work - but might as well verify).
2017-09-10 17:02:33 -04:00
Evgeny Anatskiy 8533c71787 use the wait_for_and_click_selector function 2017-09-10 18:44:42 +02:00
Evgeny Anatskiy d78e60186b Merge branch 'dev' into saved_histories_tests 2017-09-10 18:22:19 +02:00