2 # This file is subject to the license terms in the LICENSE file found in the
3 # qa-browsertests top-level directory and at
4 # https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
5 # qa-browsertests, including this file, may be copied, modified, propagated, or
6 # distributed except according to the terms contained in the LICENSE file.
8 # Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
9 # qa-browsertests top-level directory and at
10 # https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
12 Given(/^I am at Log in page$/) do
16 When(/^I log in with incorrect password$/) do
17 on(LoginPage
).login_with(ENV["MEDIAWIKI_USER"], "incorrect password", false)
20 When(/^I log in with incorrect username$/) do
21 on(LoginPage
).login_with("incorrect username", ENV["MEDIAWIKI_PASSWORD"], false)
24 When(/^I log in without entering credentials$/) do
25 on(LoginPage
).login_with("", "", false)
28 When(/^I log in without entering password$/) do
29 on(LoginPage
).login_with(ENV["MEDIAWIKI_USER"], "", false)
32 Then(/^error box should be visible$/) do
33 on(LoginErrorPage
).error_box_element
.should be_visible
36 Then(/^error box should not be visible$/) do
37 on(LoginErrorPage
).error_box_element
.should_not be_visible
40 Then(/^feedback should be (.+)$/) do |feedback
|
41 on(LoginPage
) do |page
|
42 page
.feedback_element
.when_present
.click
43 page
.feedback
.should match Regexp
.escape(feedback
)
47 Then(/^Log in element should be there$/) do
48 on(LoginPage
).login_element
.should exist
51 Then(/^main page should open$/) do
52 @browser.url
.should
== on(MainPage
).class.url
55 Then(/^Password element should be there$/) do
56 on(LoginPage
).password_element
.should exist
59 Then(/^there should be a link to (.+)$/) do |text
|
60 on(LoginPage
).username_displayed_element
.when_present
.text
.should
== text
63 Then(/^Username element should be there$/) do
64 on(LoginPage
).username_element
.should exist