Skip to content

Instantly share code, notes, and snippets.

@andreastt
Created May 13, 2011 14:55
Show Gist options
  • Save andreastt/970672 to your computer and use it in GitHub Desktop.
Save andreastt/970672 to your computer and use it in GitHub Desktop.
require 'operawatir/desktop_helper'
describe 'Password Strength' do
before :all do
browser.open_dialog_with_action('Feature Dialog', 'Set up Sync')
browser.quick_button(:name, 'button_Next').change_page_with_click
@new_password_edit = browser.quick_editfield(:name, 'new_password_edit')
end
before :each do
@new_password_edit.focus_with_click
@new_password_edit.clear
end
passwords = {
'aaaaa' => 'Very weak',
'aqplsd' => 'Weak',
'aqpl6sdH' => 'Medium',
'aqpl6sdHpoAki' => 'Strong',
'aqpl6sdHpoAkiK' => 'Very strong'
}
passwords.each do |password, strength|
describe strength do
it 'has correct strength level' do
@new_password_edit.type_text password
browser.quick_button(:text, strength).text.should include strength
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment