Scenario: Log in without entering credentials
When I log in without entering credentials
- Then error box should be visible
+ Then error message should be displayed for username
Scenario: Log in without entering password
When I log in without entering password
- Then error box should be visible
+ Then error message should be displayed for password
Scenario: Log in with incorrect username
When I log in with incorrect username
expect(on(LoginPage).error_message_element).not_to exist
end
+Then(/^error message should be displayed for username$/) do
+ expect(on(LoginPage).username_error_element).to exist
+end
+
+Then(/^error message should be displayed for password$/) do
+ expect(on(LoginPage).password_error_element).to exist
+end
+
Then(/^feedback should be (.+)$/) do |feedback|
on(LoginPage) do |page|
page.feedback_element.when_present.click
page_url '<%=params[:page_title]%>'
button(:create_account, id: 'wpCreateaccount')
- element(:error_message, css: 'div#userloginForm div.error')
+ element(:error_message, css: 'input#wpName2:required:invalid')
end
button(:login, id: 'wpLoginAttempt')
li(:logout, id: 'pt-logout')
text_field(:password, id: 'wpPassword1')
+ element(:password_error, css: 'input#wpPassword1:required:invalid')
a(:password_strength, text: 'password strength')
a(:phishing, text: 'phishing')
text_field(:username, id: 'wpName1')
a(:username_displayed, title: /Your user page/)
+ element(:username_error, css: 'input#wpName1:required:invalid')
def logged_in_as_element
@browser.div(id: 'mw-content-text').p.b