Skip to content

Commit 7f2fc1f

Browse files
author
Suvajit Gupta
committed
updated Lebowski scripts
1 parent 1bc35ec commit 7f2fc1f

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

spec/config.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
App['login_panel'].define 'user_name_field', 'contentView.loginNameField', TextFieldView
2828
App['login_panel'].define 'password_field', 'contentView.passwordField', TextFieldView
2929
App['login_panel'].define 'login_button', 'contentView.loginButton', ButtonView
30-
App['login_panel'].define 'login_err_msg', 'contentView.loginErrorMessage', LabelView
30+
App['login_panel'].define 'login_err_msg', 'contentView.loginErrorMessageLabel', LabelView
3131
App['login_panel'].define 'guest_signup_button', 'contentView.guestSignupButton', ButtonView
3232

3333
App['signup_panel'].define 'signup_prompt', 'contentView.signupPrompt', LabelView

spec/login.rb

+6-5
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@
66

77
it "will confirm that an error message is displayed on a failed login attempt" do
88
App['login_panel'].should be_pane_attached
9-
App['login_panel.login_err_msg'].should_not be_visible
10-
App['login_panel.login_err_msg'].should have_value /Login failed, please try again/i
9+
App['login_panel.login_err_msg'].should have_value ''
1110
App['login_panel.user_name_field',TextFieldView].type "InvalidLoginName"
1211
App['login_panel.password_field'].type "InvalidPassword"
1312
App['login_panel.login_button'].click
1413
end
1514

1615
it "will clear the login and password fields, error message disappears" do
17-
App['login_panel.login_err_msg'].wait_until { |it| it['isVisible'] }
16+
puts "... login error = #{App['login_panel.login_err_msg'].value}"
17+
App.wait_until(60) do |it|
18+
match = it['login_panel.login_err_msg'].value =~ /Login failed/i
19+
not match.nil?
20+
end
1821
App['login_panel.user_name_field'].clear
1922
App['login_panel.password_field'].clear
20-
App['login_panel.login_err_msg'].wait_until { |it| !it.isVisible }
21-
App['login_panel.login_err_msg', LabelView].should_not be_visible
2223
end
2324

2425
end

spec/main.rb

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
App.start do |app|
1010
app['isLoaded'] == true
11+
# app.driver.run_script "window.ononbeforeunload = null"
1112
end
1213

1314
App.window.move_to 1, 1 # Have a slight offset for Firefox so that the window will actually be moved

0 commit comments

Comments
 (0)