Commit Graph
31 Commits
Author SHA1 Message Date
anuprulez e74653feac Merging with dev 2017-05-11 17:11:40 +02:00
John Chilton a8ddd73ab4 Reset Selenium test connection between test retries.
Otherwise the state of one test can affect the next attempt.
2017-05-11 09:57:46 -04:00
John Chilton c76c588ed1 Fix Selenium test cases for JavaScript-izing workflow management. 2017-05-11 09:35:14 -04:00
Dannon Baker baa85bf788 Merge pull request #4042 from jmchilton/selenium_fixes_12
One more fix for main_panel fix in #3992.
2017-05-08 16:16:10 -04:00
John Chilton 5ba5e8a85f One more fix for main_panel fix in #3992.
See #4003 / d09ba53c8e for similar fix to other tests and more information.
2017-05-08 12:08:24 -04:00
John Chilton d09ba53c8e Fix handling main_panel switching in various Selenium tests.
PR #3992 fixed "with self.main_panel()" so that leaving the context actually restore the Selenium context back to the top level page. This surfaced a bunch of bugs related to assertions that were operating in the main panel without declaring it. This fixes those and makes the assertions a bit stronger - such as verifying error messages being asserted about are visible.
2017-05-01 23:34:22 -04:00
Björn Grüning 7b385c2b84 Merge pull request #3992 from jmchilton/selenium_fixes_9
Fixes for Selenium workflow run test case.
2017-05-01 14:24:40 +02:00
John Chilton 85a9b37d80 Setup framework for retrying failed Selenium tests.
- By default this won't occur locally, but you can set GALAXY_TEST_SELENIUM_RETRIES to a non-zero number to enable auto retrying tests that many times.
- Capture the stack trace in the Selenium test error report directory - this will be useful for debugging problems that may fail once but pass on a subsequence attempt. Jenkins now captures these directories and includes their content in the test reports.
- Document the Selenium test error report directory in run_tests.sh as well as this new retry variable.
- Update the Jenkins test script to set this new variable to 1 so transient failures break the build much less frequently.
2017-04-28 10:21:06 -04:00
John Chilton a26991b2a8 Selenium workflow run test case fix.
The ``with self.main_panel():`` construct wasn't cleaning up properly - I've fixed this and eliminated the terrible workarounds in the execution test case that I guess I had added trying to figure out how to make things work. It should be more stable now. (This test case has been failing 1 out 9 times I'd say.)
2017-04-28 09:49:27 -04:00
John Chilton 606c32998f Allow upload to collections.
- New upload tab for "Collections".
  - This has a new option to select "Collection Type" in footer.
  - Collection upload geared toward homogeneous datasets - must specify genome and file format for all files.
  - New button "Build" after all individual datasets have finished their upload to the server.
  - Clicking "Build" launches the appropriate collection builder for selected collection type.
  - By default, uploading a collection hides the original uploaded datasets (can be unchecked).

Implement tests for all uploaded collection types.
2017-03-28 09:31:26 -04:00
John Chilton 82ca6931c0 More test cases for collection builders.
- Add test case for building paired lists.
- Add tests for new hide original datasets functionality for lists and paired lists.
2017-03-24 10:07:58 -04:00
John Chilton 3d13a2bb4f Fix transiently failing Selenium test of tool form re-running.
Reworks addition of staleness checkers introduced in #3780.
2017-03-24 10:06:42 -04:00
John Chilton d270a21908 Allow non-ready jobs in collection builder.
This includes two parallel changes to the Selenium tests.

- It adds a decorator to allow retrying certain atomic actions that may occur during jQuery transitions automatically.
- It refactors things to allow waiting on HIDs to become visible instead of just green.
2017-03-24 10:06:32 -04:00
John Chilton 0ced044897 Flush out upload tests for Selenium.
- Use newer abstraction in the simplest upload test - verify the default extension (auto -> sam) and dbkey (?) also.
- Add a test case that explicitly sets the extension of an upload and verifies.
- Add a test case that explicitly sets a genome and verifies.
- Add a test case that tests setting ext for all uploads and verifies.
- Add a test case that tests setting genome for all uploads and verifies.
2017-03-23 10:25:59 -04:00
John Chilton 5704013301 Implement initial collection builder UX test cases.
Exercise list and paired builder's most basic functionality.
2017-03-06 09:47:37 -05:00
John Chilton 2e787394cc Disable transiently failing tour test.
See code comment for more information - I am tracking the issue here https://github.com/galaxyproject/galaxy/issues/3598. I think it is important to resolve that test and fix the usability problems with current tours but I'd like to get the Selenium tests stable and testing against new PRs first.
2017-02-12 10:30:13 -05:00
Martin Cech 66a24c8830 Merge pull request #3587 from jmchilton/selenium_fixes
Fix transiently failing Selenium upload test.
2017-02-10 13:16:50 -05:00
John Chilton 1922d50f90 Increase patience of Galaxy tests throughout.
This should help reduce various API and Selenium transient failures.
2017-02-10 10:39:27 -05:00
John Chilton 812ad3af18 Fix transiently failing Selenium upload test. 2017-02-10 09:29:21 -05:00
John Chilton ebfd740025 Fix selenium workflow tests broken with #3181. 2017-01-27 10:10:56 -05:00
John Chilton 1af1583caa Fix various transiently failing Selenium tests.
I'm pretty sure the problem is that I was waiting on conditions (e.g. datasets to become "ok") using the API and then assuming the state of the GUI elements was the same. Obviously though the GUI is polling the API and there is some lag there. This commit changes things to specifically wait on history panel GUI changes - obviously the better thing to wait on in a GUI test.
2017-01-19 10:22:20 -05:00
John Chilton e1612d24ea Update URL used by Selenium tests that changed with a recent commit. 2017-01-17 13:39:19 -05:00
John Chilton 6fdd0014d3 Remove debugging "assert False" in workflow editor test. 2017-01-17 13:39:19 -05:00
John Chilton 7f62eb0c83 Fix history sharing test broken with #3417. 2017-01-17 13:39:19 -05:00
John Chilton 78b099f3a7 Expand selenium test coverage for workflows.
Expand and then break out workflow management tests into its own file since these aren't related to the workflow editor per se. Includes new tests of workflow "viewing" and "renaming".

Add a new file for testing workflow execution. This currently contains tests for simple execution with a single input and a test for running workflows with tool version upgrades.

This includes a refactoring of some existing tests related to checking various things in the history panel - as part of building up good history panel abstractions. The previous constructs were ported fairly literally from older CasperJS tests. These abstractions therefore referred to everything has "hda"s instead of history items. The newer abstractions therefore allow for collections and are built around HIDs (a visual thing exposed to the user) instead of HDA IDs. I think this is higher-level and more appropriate for a web functional test.

Rebase into workflow GUI tests.
2017-01-08 08:13:42 -05:00
John Chilton 76b8a69c37 Capture page source and DOM of top-level frame on Selenium errors.
Dump to the same directory as the last screenshot related to the error.
2017-01-08 08:13:42 -05:00
John Chilton 10720fa4f9 Fixup and test core.history.yaml tour. 2016-12-20 18:06:16 -05:00
John Chilton a5af4d155f Fix Python 3 linting error for #3340. 2016-12-20 13:19:49 -05:00
John Chilton cc32dcae4b Initial tool form and dataset detail selenium testing.
- Test parameters and tables appear on dataset details page after running a tool.
- Test a simple tool execution with an integer field.
- Test re-run a tool.
- Test a tool with a data drop down.
- Improved select2 abstractions.
2016-12-20 12:34:50 -05:00
John Chilton 53b6413df9 Attempt fix of logic for GALAXY_TEST_SELENIUM_HEADLESS == "auto".
Pointed out by @dannon.
2016-12-01 09:49:04 -05:00
John Chilton 82728df155 Replace CasperJS browser tests with Selenium tests.
See documentation added to run_tests.sh. This can be configured to target local web browsers or Selenium remote services as detailed in that script.

Individual tests can be executed with nosetests directly or groups of tests can share a common test Galaxy spin up when using ./run_tests.sh. If GALAXY_TEST_EXTERNAL=<url> is set - it will be respected and Galaxy will not be spun up (remember the URL needs to be reachable from the Selenium server inside the Docker container).

Every test failure writes a current screenshot of Galaxy to database/test_errors.

I will be honest that the desire to move toward selenium is based solely on failing to get the Casper tests to pass consistently due to bugs causing segfaults in the underlying tools (probably casperjs or phantomjs?). Over the past year I have tried multiple versions of dependencies, etc... and it never works out for me. Likewise Martin has never been able to get the tests to run consistently under Jenkins. I don't think Python or JavaScript is inherently better, this wasn't based on a personal preference about what kind of test I want to write.

Despite this being the primary reason, there are clear benefits to Selenium. It tests the actual web browsers we support, generates screenshots, has better documented and more robust tooling, can scale across clusters. Less clear, but certainly still a benefit of being Python based is that it fits with the rest of the test framework more cleanly than CasperJS.

Finally Carl's last words on CasperJS were "Ditch it".

The following specific tests were added or replaced:

- Implemented tour testing via Selenium (walk the two working stock tours and verify elements avaiable and clicks are valid). This is how I discovered #3206.
- Added completely new workflow GUI test (basic creation from URL and in editor).
- Replaced broken CasperJS registeration tests (text and expectations now wrong) with a Selenium variant that works against dev.
- Replaced broken anonymous history CasperJS tests with working Selenium tests.
- Replaced broken upload CasperJS tests with working Selenium tests.
- Replaced history options CasperJS tests with Selenium tests.
- Replaced login CasperJS tests with Selenium tests.
- Replaced history-share-tests.js with test_history_options.py
- Replaced history-panel-tests.js with test_history_panel.py
- Replaced a big part of hda-state-tests.js with test_history_dataset_state.py

I'm confident these utilities represent a sharable and higher-level abstraction around functional testing of Galaxy that can be used outside of Galaxy's testing framework. So a subset of the functional test stuff is in a separate module with minimal dependencies that I intend to make stand alone and pip installable like galaxy-lib.

This module consists of:

- Sizzle stuff in its own package. This code allows Selenium to reason with jQuery selectors instead of vanilla CSS selectors.
- Functionality for creating a Selenium driver and virtual display.
- The ``HasDriver`` mixin - this provides higher level navigation utilities not specifically tied to Galaxy.
- A package with abstractions for navigating Galaxy. This provides a higher-level interfactor for things such as logging in and out, registering a user, navigating menus, fetching Galaxy style tooltips and error messages, and walking Galaxy tours.

In order to demonstrate this new module is useful outside of Galaxy tests - I've included a CLI package to ease building argparse utilities around these abstractions and implemented a simple demonstration script that walks a Galaxy tour and dumps screenshots of Galaxy at each step to a folder. This is more of a demonstration of the utilities than an actual polished end user tool - though it might be helpful in linting and debugging tours.

In the future I hope to extend this scripting to implement

- Periodic deployment testing to ensure things like Jupyter work in production.
- A best practice recipe for Galaxy QA testing by deployers.
- An utility to generate dozens of screenshots of various aspects of Galaxy so we can quickly visually inspect ever part of the GUI before big releases.

xref https://github.com/galaxyproject/starforge/pull/115 xref #1419
2016-11-30 17:44:11 -05:00