Improved browser test.

This commit is contained in:
Martin Edenhofer 2016-03-11 06:58:27 +01:00
parent 2c50fcfa39
commit 4b37e4da2b
2 changed files with 10 additions and 5 deletions

View file

@ -382,6 +382,7 @@ returns on fail
'Connection refused' => { host: true }, 'Connection refused' => { host: true },
'Mailbox doesn\'t exist' => { folder: true }, 'Mailbox doesn\'t exist' => { folder: true },
'Folder doesn\'t exist' => { folder: true }, 'Folder doesn\'t exist' => { folder: true },
'Unknown Mailbox' => { folder: true },
} }
end end

View file

@ -48,15 +48,19 @@ class AdminChannelEmailTest < TestCase
watch_for( watch_for(
css: '.modal', css: '.modal',
value: 'already exists', value: '(already exists|unknown mailbox)',
) )
click(css: '.modal .js-close') click(css: '.modal .js-close')
# delete # delete all channels
click(css: '#content .js-channelDelete') loop do
sleep 2 break if !@browser.find_elements(css: '#content .js-channelDelete')[0]
click(css: '.modal .js-submit') click(css: '#content .js-channelDelete')
sleep 2
click(css: '.modal .js-submit')
sleep 2
end
# re-create # re-create
click(css: '#content .js-channelNew') click(css: '#content .js-channelNew')