Commit Graph

80 Commits

Author SHA1 Message Date
Tim Abbott 7ce6154464 Set UserProfile to be the AUTH_USER_MODEL.
(imported from commit 92bf66b3e6a8ed06054bd491bcc96ef422a1fbe1)
2013-04-04 15:45:44 -04:00
Tim Abbott 51911d304d generate-fixtures: Run after schema changes even without --force.
(imported from commit 1daff2ee6746c4036c3cc71746ad59e18b5a331e)
2013-04-02 16:27:13 -04:00
Keegan McAllister 33ac53b849 tests: Reinstate star tests
(imported from commit f61762b0296922ee72e1304718044d5df78abd12)
2013-04-01 11:03:17 -04:00
Keegan McAllister c1a0309bb4 tests: Test more ways of narrowing / un-narrowing
(imported from commit 470b9fb5fc7e418944fee577d510d4ee0a78cd68)
2013-04-01 11:03:16 -04:00
Keegan McAllister 50ef0a6edb tests: Move page console.log support into common.js
(imported from commit e875e67ad44ef10d9d84671a14a4d1755c0154df)
2013-04-01 11:03:16 -04:00
Keegan McAllister 0263bace8a tests: Factor out message checks in 02-narrow.js
In anticipation of testing several UIs for narrowing.

(imported from commit 9403be5550de4f4503933aa03dc45335a7f3fc63)
2013-04-01 11:03:16 -04:00
Keegan McAllister bd85af4d02 tests: Move narrowing tests into their own file
(imported from commit 673fb5f862d08de1dfff1abb8db5efb76039e1ba)
2013-04-01 11:03:16 -04:00
Keegan McAllister 5015c77b33 tests: Clean up code for sending multiple messages
(imported from commit 194490a764d05408e9849bd3a80552c7173f5112)
2013-04-01 11:03:16 -04:00
Keegan McAllister 7e348783e6 tests: Update comment about common.keypress
(imported from commit c58d850ba4fa291e62ffdf56d8e647688940a3ed)
2013-04-01 11:03:16 -04:00
Keegan McAllister 83f1071259 tests: Move more helper functions to common.js
(imported from commit 2a4e2acda367f087acee69f46b6542e3762f5000)
2013-04-01 11:03:16 -04:00
Keegan McAllister b2dea39fad tests: Remove initial dummy message workaround
I can't reproduce the problem this works around anymore.  If it comes back,
let's debug and figure out what's happening.

(imported from commit 26096405a93a530e449c9f1f60d8110b1bb0e96b)
2013-04-01 11:03:16 -04:00
Keegan McAllister 8e6587e92f tests: Use common.js in 00-login.js
(imported from commit b4f3150ee9bbb2c37c3bd5cb0032d8d210d8e976)
2013-04-01 11:03:16 -04:00
Keegan McAllister b09c829fd6 tests: Move common initialization into casper.start
Otherwise it fails when common.js is used by the very first test.

(imported from commit 5299072a62c63202c641b2a11b40aafb9c89e13e)
2013-04-01 11:03:15 -04:00
Keegan McAllister 0c3e21e4b2 tests: Split subscriptions and settings page tests into their own files
Delete star tests for now and restore them later -- it's much easier
this way.

(imported from commit 0572aa64b39d73fddb40b57db554e1f0f14973af)
2013-04-01 11:03:15 -04:00
Keegan McAllister d6810efc90 tests: Fix URL test for new event system
(imported from commit 07671e9a8b678a725b5f49ed755f008107734251)
2013-04-01 11:03:15 -04:00
Leo Franchi 199610fe7f Add tests for unread count in sidebar
(imported from commit dc10016258bf61599ceae434623040a2a7dd5946)
2013-03-28 17:37:32 -04:00
Jessica McKellar 39602a4437 tests: add frontend tests for starring.
(imported from commit 6a35286cf4a1e3db9adbc14f8d6c0aa0a05b24db)
2013-03-28 16:59:59 -04:00
Keegan McAllister 45eb9bcf47 tests: Disable tutorial through the server side variable needs_tutorial
This fixes a nondeterministic test failure for me.

The first message sent in the test suite appears to get dropped.  I don't know
why this is, and I'm pretty sure it was an existing bug.  This message used to
be the one disabling the tutorial, which might explain why that didn't always
work.

Regardless, this commit at least makes the test suite usable, and we can work
on fixing that bug later.

(imported from commit 063e40871b9883e3a6dab93a4e0a51c5b2dae4b7)
2013-03-18 13:46:46 -04:00
Waseem Daher 9920dcd22a Properly disable the tutorial in the test suite.
I think my previous commit causes the tutorial to run more regularly
in the test suite, so we,  in turn, need to be more systematic
about disabling it.

(imported from commit c3805438b0564874a358526d3592b86d147547c0)
2013-03-12 11:05:46 -04:00
Zev Benjamin ebb095d0ce tests: Basic compose box tests
(imported from commit e1e7fc1f9efec464f1a86c1a8b39c1a6db207adb)
2013-03-07 14:30:08 -05:00
Tim Abbott 0c62dcc9f6 tests: Move casper.page.onError setup outside casper.start().
This has no functional impact, it's just for clarity.

(imported from commit 2ec1948929df120a3a410324412912ec062b8500)
2013-03-06 11:36:15 -05:00
Tim Abbott b861e19654 tests: Write screenshots for all casperjs failures to /tmp/.
(imported from commit 4e1a54b89fce76c6923157967ade3d525f5c7f30)
2013-03-06 11:36:15 -05:00
Tim Abbott 0fee4e8d9d tests: Set casperjs viewport size to a reasonable browser size.
Otherwise we're by default testing the phone size layout, which
probably isn't what we want the default test setup to be.

(imported from commit a76b2d51c18824b0a5f6342cce848aca87dda15a)
2013-03-06 11:36:15 -05:00
Zev Benjamin a84947eade tests: Don't regenerate the test database every time we run tests
This cuts about 6 seconds off of the test startup time on my laptop.
The other startup costs are about 1 second for the server to come up
and about half a second for casperjs to begin executing tests.

generate-fixtures now takes a '--force' option that can be use to
force a regeneration of the test database.

(imported from commit 1f473507502f0edf159b2638abb392d9357eb46f)
2013-03-05 17:26:50 -05:00
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