Commit Graph
112 Commits
Author SHA1 Message Date
John Chilton bf896d621d Move CasperJS history API tests in api/test_histories.py. 2016-11-30 17:44:12 -05:00
John Chilton 5cd2c55104 Remove CasperJS API user and history tests...
... more complete testing for both is available in API tests.
2016-11-30 17:44:12 -05:00
John Chilton 9b0390defb Remove CasperJS api-batch-tests.js - already available in API test framework. 2016-11-30 17:44:12 -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
John Chilton b705579125 Fix configuration API admin checking and tests.
- Move CasperJS tests for configuration API into API test framework.
- Fix bug where configuration API wouldn't treat master API key as coming from an admin user.
2016-11-29 14:12:51 -05:00
carlfeberhard 7bfd6410eb Merge remote-tracking branch 'upstream/dev' into api.batch 2016-06-23 16:13:49 -04:00
Nicola Soranzo 8a43b2b492 Python 3: use "as" instead of comma in except clause 2016-05-17 23:53:16 +01:00
carlfeberhard 7d5cc93737 Merge remote-tracking branch 'upstream/dev' into api.batch 2016-05-11 12:58:50 -04:00
Martin Cech 0ff81d3dcb remove buildbot remnants 2016-04-11 11:19:39 -04:00
carlfeberhard 69de8d58de Merge remote-tracking branch 'upstream/dev' into api.batch 2016-02-10 08:21:24 -05:00
Nicola Soranzo 487ece0f40 Fix all E731 "errors". 2016-01-14 01:19:01 +00:00
Dannon Baker 89e7c3df95 Address W503 and E721 errors now enforced by pep8 1.7. 2016-01-12 18:26:20 -05:00
Dannon Baker f939c4eab5 Merge from release to dev. 2016-01-12 14:58:57 -05:00
Dave B d844a3489b Remove debugs. 2016-01-06 12:46:09 -05:00
Dave B 06fd219646 Fix casper tests. 2016-01-06 12:41:40 -05:00
Dave B 073609d005 Fix casper tests. 2016-01-06 13:58:13 +00:00
carlfeberhard 0b6397ec5c Merge remote-tracking branch 'origin/dev' into api.batch 2015-12-18 14:43:18 -05:00
Dannon Baker cf5d209e0f Manual merge of #1303 to resolve build artifact conflicts. 2015-12-16 06:51:12 -05:00
John Chilton 58911edbfb Remove worklfow casperjs API test.
It has good and more updated coverage in the Python API testing framework.
2015-12-14 14:05:43 +00:00
carlfeberhard 84f3b72e1a (merge dev); Testing, histories: update tests to reflect allowing anon to create/copy histories via the API 2015-12-11 13:44:48 -05:00
carlfeberhard 7cd5713dbb Webpack: simplify query routes in analysis, remove duplicate js in display.mako and tabular_chunked.mako, change order of requirejs import; testing, casperjs: quiet requirejs scripterrors when navigating away from pages 2015-11-20 10:08:44 -05:00
carlfeberhard 7b93a53a4c Webpack: polyfill object.assign for phantomjs; remove galaxy.frame.masthead.css in favor of adding styles locally; change css load order to prevent 'ui-button' name collision between base and jquery-ui 2015-11-17 12:16:13 -05:00
carlfeberhard bc9972bae2 Testing: update casperjs functional tests; change expected size string; remove nice_size from expected history api keys; remove test for rerun button on uploaded dataset; attempt to fix linux+python unicode error in hda api tests 2015-10-19 15:45:13 -04:00
John Chilton 49740caaa2 Add documentation for running casperjs tests through run_tests.sh.
Add option to run a specific test. Verified xunit reports work and --dockerize works for casperjs tests.
2015-10-01 13:45:37 +01:00
Nicola Soranzo 2fccd0c11f Finish flake8 of test/ . 2015-08-26 20:08:09 +01:00
Carl Eberhard 1dc0876cdd Merge remote-tracking branch 'upstream/dev' into api.batch 2015-07-31 11:40:15 -04:00
Carl Eberhard d28f1c7073 Testing, casperjs: fix the hda api show assertion in the anon tests 2015-07-22 10:06:23 -04:00
Carl Eberhard e618782ff7 Testing, casperjs: small fixes to selectors and api assertions 2015-07-21 15:15:51 -04:00
Carl Eberhard 456abe93f1 Fix broken browser tests 2015-05-01 16:12:11 -04:00
Carl Eberhard 8fb10a5c9a API, batch: test errored calls 2015-04-22 17:45:36 -04:00
Carl Eberhard 5dcc4e8e3a API, batch: handle bad routes 2015-04-22 17:20:37 -04:00
Carl Eberhard 35b7c7788a API, batch: initial commit 2015-04-21 15:09:28 -04:00
Carl Eberhard 179d11db85 Merge managers.datasets with dev and remove conflicts 2015-04-02 14:39:45 -04:00
Carl Eberhard ceeff0a03c Fix to c1f7210: remove print statements and minor fixes 2015-04-02 14:22:26 -04:00
Carl Eberhard 9b1cc1dfdf Browser testing: add test for passing null/None to misc_info during an update 2015-03-25 18:42:03 -04:00
Carl Eberhard de78429ceb Managers: fallback to string validation for genome_build validation; Browser tests: update tests to reflect looser validation of genome_build 2015-03-17 15:45:39 -04:00
Carl Eberhard 59fb7b5b72 Browser tests: Fix user module registration to search for the proper message class 2015-03-03 17:08:10 -05:00
Carl Eberhard 045625c829 History, API: allow purging with url parameter passing e.g. '...?purge=True', add test 2015-02-16 14:25:03 -05:00
Carl Eberhard 25855d1406 Browser test: use new object param style in history api tests 2015-02-03 16:54:39 -05:00
Carl Eberhard 14383c0868 API, tests: add datasets API tests in test/API and casperjs sections; Browser tests: add datasets api, allow api to send extra params for history show & index 2015-02-03 16:11:10 -05:00
Carl Eberhard 2c21d5252f Browser tests: remove starting slash from workflow return url comparisons 2015-02-03 09:00:51 -05:00
Carl Eberhard 768f37ff37 Managers: add a 'user_manager' in BaseController; History: allow 'history/share' to accept user ids, add browser tests for same; Browser tests: make api urls absolute and so usable in web-based tests 2015-01-30 16:35:12 -05:00
Carl Eberhard 91feab47e7 Fix to 14796ac: for history-panel-tests.js 2015-01-14 17:31:05 -05:00
Carl Eberhard 4c744f7275 Remove relative imports in managers; factor out circular ref in HDAManager using slight code dup; Fill out deserializers and provde generic manager for deserializer superclasses and mixins; Bug hunt with functional/browser tests 2015-01-14 17:26:41 -05:00
Carl Eberhard 232f78827e Browser tests: remove console statements interferring with test json parsing 2015-01-05 10:34:05 -05:00
Carl Eberhard 2f7eec5d93 merge 2014-12-22 14:58:44 -05:00
Carl Eberhard 981954e107 UsesHistoryMixin, get_history: allow anon users to get their current history; update browser tests; remove unused selenium tests 2014-12-22 14:35:08 -05:00
Carl Eberhard b6e0b3a9f1 Tools API: use history manager to get history in create() to allow anon users to get their only history; Update browser/casper tests to use api upload for testing, remove use of upload tool form 2014-11-19 14:53:51 -05:00
Nate Coraor 8fadc6392b Rename universe_wsgi.ini -> galaxy.ini everywhere. 2014-09-15 16:43:51 -04:00
Dannon Baker 2b04823343 Merge json changes (and some cleanup) back with central. 2014-09-09 16:31:31 -04:00