Commit Graph

106 Commits

Author SHA1 Message Date
Tim Abbott eadb2ea6d3 Update casperjs to 1.0.2.
(imported from commit 9e34b51c4588dce6419ea86024b2e8c06346a685)
2013-03-05 15:10:32 -05:00
Tim Abbott 0891f3e4e5 tests: Actually wait until message is sent on send_message.
Previously, using e.g. the search box would be problematic because the
compose box closing event might fire, blurring the search box, in the
middle of whatever you were doing.

(imported from commit cc045f5a6a7b7fbf72848da14b6fcd3df39cab05)
2013-03-05 15:08:47 -05:00
Zev Benjamin 86f5030587 tests: Allow frontend "run" script to accept a list of test files to run
(imported from commit 1d29be561bf6a2501797d4875b9deb43eb560fb3)
2013-03-05 11:57:24 -05:00
Zev Benjamin e588323f5d tests: Move log int and log out functions into a common.js
(imported from commit d6c2f45af775dea9c99426aa46b08ed45eb76d17)
2013-03-05 11:05:12 -05:00
Zev Benjamin d5493ed580 tests: Split site.js out into 00-login.js and 01-site.js
(imported from commit cdd3b2c675b6ae33456377546424fcc5cad58cf5)
2013-03-05 10:32:55 -05:00
Waseem Daher 7d97a739df Don't let tutorial break test suite.
I don't actually have this problem, but Jessica et al tell me that the
tutorial bot's messages sometimes arrive too late for them and it
interferes with the test suite's ability to run correctly.

I add a delay which should hopefully reduce the occurrence
of this issue.

(imported from commit 0f41610ada7dd49d71f0deef034e014164357197)
2013-03-04 16:27:14 -05:00
Waseem Daher 6743d0e4fa Disable the tutorial as part of the test suite.
It's causing unexpected messages to appear.

(imported from commit e80a8cd43a771c4d06a7147e06b21246f47de316)
2013-02-28 13:23:13 -05:00
Keegan McAllister 9323203cfb frontend tests: Remove trailing commas to make JSLint happy
(imported from commit b62192e67a74f1f47e87f87245c910f42e0b3bec)
2013-02-20 16:02:30 -05:00
Waseem Daher 91a3e0402f Update test (again) to match new '>' delimiter.
It looks like there was a stray | in the tests.

(imported from commit 991c35988daa1d6dbf268f8334f28ab69e222eb4)
2013-02-15 12:14:59 -05:00
Jessica McKellar 1f24133292 Update tests to match new '>' delimiter.
(imported from commit e9a0c60ee89f7cd3cf0756baaf35221263c3d3be)
2013-02-15 11:01:06 -05:00
Keegan McAllister 59bfe38448 Fix wait condition in subscriptions frontend test
Waiting for text "Waseemio" to appear isn't reliable, because the "create
stream" modal already contains that text.  Instead, do a more specific check
for a .subscription_name element.

(imported from commit 54689aeb9d243c3fb62d1765b2b4fb93d3bb40db)
2013-02-06 13:49:37 -05:00
Jessica McKellar 474a91e25b tests: update frontend tests to reflect subscription page changes.
(imported from commit 1f34863b8cf1a2d951153fd4a66132418ea07a23)
2013-02-05 10:01:45 -05:00
Zev Benjamin 2e7d411ef8 Remove redundant success messages from subscriptions page
The fact that the user sees a change (the button changes or a row
appears) makes it obvious that the operation was a success.  The
success messages were only serving to make the page scroll
confusingly when you couldn't see the top.

(imported from commit 471b9304f71bb8533c98d208b855d4d75c04a886)
2013-01-24 17:59:03 -05:00
Zev Benjamin df712b7794 Move the "create new stream" form into the subscriptions table
(imported from commit 6cfccf01b4253423e271a08c74f6077cbc10fce3)
2013-01-24 17:59:03 -05:00
Tim Abbott b977bce998 Add hack to clean up zephyr/lib/time.pyc -- it will break tests.
(imported from commit f649b31010adc38e3820879fcdd543e81d271d0f)
2013-01-11 15:58:19 -05:00
Tim Abbott 52589ca6fb Fix running "./manage.py test zephyr --settings=humbug.test_settings"
Previously it wouldn't work due to using the wrong port numbers.

This commit also has the side effect of fixing the fact that our
frontend tests would send real emails and log events to the real
message log.

(imported from commit f2cf400e6061c089627acba2759d588981ecf5bb)
2013-01-10 16:59:36 -05:00
Zev Benjamin a01cee3cce Set up frontend tests to run multiple test files
(imported from commit 7eef13df33e8d878efcab199fd4c7eea7fd99a5c)
2013-01-09 14:22:18 -05:00
Keegan McAllister 6cf59f1fba tests.js: Add a note about capturing console.log
(imported from commit a47078b48f0c209e82ce4c9775e9da8f933f7bbb)
2013-01-09 14:03:40 -05:00
Keegan McAllister c4e9d95420 tests.js: Fail if we get a JavaScript error in the page's context
(imported from commit 2f1299ff660b8948ac1451e5724c1f198c7a4e29)
2013-01-09 14:03:40 -05:00
Waseem Daher d2a7d06dea tests: Be more robust about detecting when the subscriptions page has loaded.
We apparently cannot rely on Iago to consistently be subscribed to
"Denmark", so make this determination some other way.

(imported from commit 2a75b345c2d82097ab44538942af89536aac09ed)
2013-01-09 13:27:18 -05:00
Luke Faraone 8c2a9617e7 Do south migrations before running tests.
(imported from commit 94cc702d731838b812dfba27cdd9e24f8d464b78)
2013-01-09 13:18:10 -05:00
Tim Abbott 39501e5a78 Make the Django-based test suite much faster.
So, I got annoyed that our test suite was taking forever to run:

real	2m13.443s
user	1m32.630s
sys	0m3.748s

Some quick profiling determined that the test suite is spending all of
its time loading the fixtures files (zephyr/fixtures/messages.json)
that it loads for each test case (3s to load that for each test case).
To improve this situation, I cut out from the test database used by
the test suite most of the users, subscriptions, etc. that aren't
being used directly by the test cases.  The impact is a quite
significant speedup:

real	0m15.176s
user	0m9.161s
sys	0m0.508s

We're still spending over a quarter of a second per test, which isn't
great -- but this is at least no longer unbearable.

This commit doesn't make any changes to the populate_db output if you
don't pass the new --test-suite option.

(imported from commit 2334ba5399b33edab3d29ff269fde4ea77ccd48e)
2013-01-08 17:23:55 -05:00
Waseem Daher 105f0aa25a Rearrange calls to then() in frontend test suite.
Apparently after you call waitForText, if you don't specify
a callback function, you need to put the next stuff after
a casper.then() -- not doing so caused some tests to fail
if, e.g. the subscription list did not load super-promptly
(because we checked for the text even before the waitFor
expired; in other words, we were not blocking on it.)

(imported from commit c71d543db0aba0c27b5136b92bb6e28e63278ac5)
2013-01-08 15:52:42 -05:00
Waseem Daher 055652e16d A few more subscription-related tests.
(imported from commit 4d2b47d124bdf0e483363fb7852061bd690d0064)
2013-01-08 13:57:48 -05:00
Waseem Daher 65a474c37c Add test for subscribing to a stream.
(imported from commit e006bcfa5f4c5bbabda839470904689ed1ca5a2b)
2013-01-08 13:57:48 -05:00
Waseem Daher 9ecbff26f8 Very basic "Do the subscriptions and settings pages links work" tests.
(imported from commit f941b8d5f984ffa726266dab50bfab00716c34eb)
2013-01-08 13:57:48 -05:00
Keegan McAllister 3c9b9227f8 Get rid of the narrowbar
(imported from commit 53335b8177561d4b103659a51704d6b2ce7ec367)
2013-01-08 12:18:29 -05:00
Keegan McAllister 15f606a2ef frontend/tests: Add a function to inject key presses
(imported from commit d2595482ec0bef8b2a4f819e6c29d6e84175a70e)
2013-01-08 12:18:29 -05:00
Jacob Hurwitz e590c914a6 Also change the comment to read 300 ms
(imported from commit e039dca675affa275247280a33bd414705bd44c0)
2013-01-02 17:14:38 -05:00
Jacob Hurwitz af70df0e70 Increasing hardcoded timeout in wait_for_receive
(imported from commit 0662a12891ad4b3dfc11e368901e2dd47bff3daa)
2013-01-02 17:14:38 -05:00
Jessica McKellar 4832a6a1fe [schema] Add a management script to create default streams for a domain.
Run this script on an existing realm to create or change default
streams, which new users will get upon account creation.

(imported from commit 8938dcbd3520d97d25b4c6ca783d35c9aef52df0)
2012-11-28 14:07:16 -05:00
Keegan McAllister 3494a3ae2a tests/frontend/run: Make waiting for the server less noisy
(imported from commit c62bc23081e76e18de2aeddf45a2e7043deabc2b)
2012-11-16 15:33:38 -05:00
Keegan McAllister 172386d9dd tests/frontend/run: Complain if the test server dies
One way this can happen is if run-dev.py --test is already running.  In that
case the one we launch will die with "Address already in use", and we should
alert the user that test results may not be accurate.

(imported from commit 078091cace2cff777b444668b03f96dc208f22fc)
2012-11-16 15:33:37 -05:00
Keegan McAllister 5344c9dcc5 frontend/tests.js: Wait more intelligently to receive messages
(imported from commit 4bd6ad72cbde8f0cb8bdd3b20883d1449435bb29)
2012-11-16 15:33:37 -05:00
Keegan McAllister b8f0599c7c tests/frontend/run: Avoid leaking test server on exception
(imported from commit 4c8ab0db991655a6647bd9861cc2fb95b21c1be4)
2012-11-16 15:33:37 -05:00
Keegan McAllister 0e6ce16172 tests/frontend/run: Wait more intelligently for the server
(imported from commit c3e26d7a85bca85921270d7927c0243df6586a2a)
2012-11-16 15:33:37 -05:00
Zev Benjamin 534a1fd2ec frontend-tests: Click on the buttons the user would for sending
Previously we bypassed the big buttons on the left bar and clicked on
the anchor tag inside the compose box.  This bypassed the
compose.start() call.

(imported from commit 2b627825596c8d3c21441e58db895b8e488e624b)
2012-11-13 15:40:53 -05:00
Zev Benjamin 195bdb07c9 Unify huddles and personals into private messages on the send path
Personals are now just private messages between two people (which
sometimes manifests as a private message with one recipient).  The
new message type on the send path is 'private'.  Note that the receive
path still has 'personal' and 'huddle' message types.

(imported from commit 97a438ef5c0b3db4eb3e6db674ea38a081265dd3)
2012-11-13 15:40:53 -05:00
Keegan McAllister a91947fdde Add a command to run the frontend test suite against a testing server
(imported from commit f72604e5be3e3342cf95bde8bedc4d1733e24d79)
2012-11-13 10:59:02 -05:00
Keegan McAllister 23bdc74863 Add a client test script
(imported from commit c31ba54ed0e15b1eab5a731471f40cfa1c87152f)
2012-11-13 10:59:02 -05:00
Keegan McAllister 921f7832c5 Import CasperJS 1.0.0-RC4-0-g8c798c7
(imported from commit b24184d9de034ecf4054dbc72cd6c28b49309182)
2012-11-13 10:59:02 -05:00
Keegan McAllister 0d538d91ac test: Fail if generate-fixtures fails
(imported from commit b13167ad04837cfeb64989ff43fec2e6ae890a33)
2012-11-07 17:46:46 -05:00
Keegan McAllister f8540dcdae Wrap some other extremely long lines
(imported from commit e7d55f318c8865ca953bf4520d1b07f7e84a4aeb)
2012-10-25 15:22:18 -04:00
Tim Abbott 7b3b4362dd [schema] Add a Client model keeping track of the sending client.
(imported from commit 31a430b1de14ce973addafd5d13ace049a8f8091)
2012-10-20 18:41:54 -04:00
Keegan McAllister eab84fa195 gitignore zephyr/tests/zephyrdb.test
(imported from commit 755213afd778829a6d3f77a4232b9947b5f01c4a)
2012-10-11 16:25:40 -04:00
Tim Abbott 4c4cca0945 Fix removal of stale zephyrdb.test files.
(imported from commit 2f3f8b1f05d43ed2fe9e3b5427f0be2e2b05b51b)
2012-10-10 18:13:45 -04:00
Tim Abbott b5bb6b9921 Rename test-settings.py to test_settings.py
(imported from commit c9ad55821bc66a7c11668ac0b40ca13c2e05986e)
2012-10-10 18:13:45 -04:00
Tim Abbott 8daff2e05e Rename ZephyrClass to Stream.
(imported from commit ae51b7a9e03f322dfe2dfccd250cbfc23adfe32e)
2012-10-10 17:47:12 -04:00
Tim Abbott c83efefcc7 Replace 'zephyr' => 'message' in test suite.
(imported from commit 550a4b1f3c45e3275181a04b3a892040ef508dc5)
2012-10-04 14:37:36 -04:00
Tim Abbott 1ab81cff92 [schema] Rename Zephyr => Message in the schema.
(imported from commit 4f402f150c45d2097d6b16943935e6e370b4f8d8)
2012-10-03 18:14:15 -04:00
Tim Abbott 45c22c95af generate-fixtures: Remove zephyrdb.test each time.
(imported from commit 08bd0abcbafd8e6277dcd190b0fef1b9cc0f2da5)
2012-10-02 12:02:43 -04:00
Tim Abbott e9d5532a41 Make the test suite faster.
(imported from commit 7baf86f0d615f05eec9873b84cf4c88476798895)
2012-10-01 17:58:40 -04:00
Tim Abbott cc3b90b5a2 Fix some testing problems with new UserMessage class.
(imported from commit abcadca84e6ad21c523f339952ad0dec0868dc50)
2012-09-07 11:30:28 -04:00
Tim Abbott 38b30e5997 [schema] Add realms to the schema.
Note that realms aren't actually used for anything, aren't prompted
for, etc, so this is mostly just a schema change and the refactoring
needed to allow setting the realm in the future.

(imported from commit b8b483dcc9601b288702284879e9c99707a50a5c)
2012-09-06 11:02:34 -04:00
Tim Abbott c059937f31 Remove fixtures from version control.
(imported from commit 32f17aa1b674e47d730a00cced8b5bed8a136755)
2012-09-04 16:34:39 -04:00
Jessica McKellar 24abc27c28 Add a script to generate fixtures for use in unit tests.
This dumps the zephyr app tables and the auth_user table (needed for
UserProfile).

(imported from commit 471b84a532af711c263305297399c0cbf2f41eda)
2012-09-04 10:46:19 -04:00