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)
This commit is contained in:
Waseem Daher 2013-01-09 13:26:23 -05:00
parent 8c2a9617e7
commit d2a7d06dea
1 changed files with 4 additions and 2 deletions

View File

@ -285,10 +285,12 @@ 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
// subscriptions need to load; if they have *any* subs,
// the word "Unsubscribe" will appear
casper.waitForText('Unsubscribe');
});
casper.then(function() {
casper.test.assertTextExists('Denmark', 'Initial subscriptions loaded');
casper.test.assertTextExists('Unsubscribe', 'Initial subscriptions loaded');
casper.fill('form#add_new_subscription', {streams: 'Waseemio'});
casper.click('form#add_new_subscription input.btn.btn-primary');
casper.waitForText('Waseemio');