From 65a474c37cc19bab79bdaa1a59a7a42757577725 Mon Sep 17 00:00:00 2001 From: Waseem Daher Date: Mon, 7 Jan 2013 23:10:47 -0500 Subject: [PATCH] Add test for subscribing to a stream. (imported from commit e006bcfa5f4c5bbabda839470904689ed1ca5a2b) --- zephyr/tests/frontend/tests.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/zephyr/tests/frontend/tests.js b/zephyr/tests/frontend/tests.js index fe3476d703..3c108098c3 100644 --- a/zephyr/tests/frontend/tests.js +++ b/zephyr/tests/frontend/tests.js @@ -285,6 +285,18 @@ casper.then(function() { casper.click('a[href^="#subscriptions"]'); casper.test.assertUrlMatch(/^http:\/\/[^\/]+\/#subscriptions/, 'URL suggests we are on subscriptions page'); casper.test.assertExists('#subscriptions.tab-pane.active', 'Subscriptions page is active'); + casper.waitForText('Denmark'); // subscriptions need to load + casper.test.assertTextExists('Denmark', 'Initial subscriptions loaded'); +}); +casper.then(function() { + casper.fill('form#add_new_subscription', {streams: 'waseemio'}); + casper.click('form#add_new_subscription input.btn.btn-primary'); +}); +casper.then(function() { + casper.waitForText('waseemio'); + // TODO: Make this more robust. + // I tried to do it with assertSelectorHasText, but it wasn't quite working. + casper.test.assertTextExists('Successfully added subscription to waseemio', 'Subscribing to a stream'); }); // Settings page tests