Merge "Add some casts for sanity before BagOStuff::add() calls"
[lhc/web/wiklou.git] / tests / browser / features / step_definitions / preferences_appearance_steps.rb
1 #
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.
7 #
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
11 #
12 When(/^I click Appearance$/) do
13 visit(PreferencesPage).appearance_link_element.when_present.click
14 end
15
16 When(/^I navigate to Preferences$/) do
17 visit(PreferencesPage)
18 end
19
20 Then(/^I can click Save$/) do
21 on(PreferencesAppearancePage).save_button_element.should exist
22 end
23
24 Then(/^I can restore default settings$/) do
25 on(PreferencesAppearancePage).restore_default_link_element.should exist
26 end
27
28 Then(/^I can see local time$/) do
29 @browser.text.should match Regexp.escape("Local time")
30 on(PreferencesAppearancePage).local_time_span_element.should exist
31 end
32
33 Then(/^I can see server time$/) do
34 @browser.text.should match Regexp.escape("Server time")
35 end
36
37 Then(/^I can select date format$/) do
38 on(PreferencesAppearancePage) do |page|
39 page.no_preference_radio_element.should exist
40 page.mo_day_year_radio_element.should exist
41 page.day_mo_year_radio_element.should exist
42 page.year_mo_day_radio_element.should exist
43 page.iso_8601_radio_element.should exist
44 end
45 end
46
47 Then(/^I can select image size$/) do
48 on(PreferencesAppearancePage).size_select_element.should exist
49 end
50
51 Then(/^I can select my time zone$/) do
52 @browser.text.should match Regexp.escape("Time zone")
53 on(PreferencesAppearancePage) do |page|
54 page.time_offset_select_element.should exist
55 page.other_offset_element.should exist
56 end
57 end
58
59 Then(/^I can select skins$/) do
60 on(PreferencesAppearancePage) do |page|
61 page.cologne_blue_element.should exist
62 page.modern_element.should exist
63 page.monobook_element.should exist
64 page.vector_element.should exist
65 end
66 end
67
68 Then(/^I can select Threshold for stub link$/) do
69 on(PreferencesAppearancePage).threshold_select_element.should exist
70 end
71
72 Then(/^I can select thumbnail size$/) do
73 on(PreferencesAppearancePage).thumb_select_element.should exist
74 end
75
76 Then(/^I can select underline preferences$/) do
77 on(PreferencesAppearancePage).underline_select_element.should exist
78 end
79
80 Then(/^I have advanced options checkboxes$/) do
81 on(PreferencesAppearancePage) do |page|
82 page.hidden_categories_check_element.should exist
83 page.auto_number_check_element.should exist
84 end
85 end
86
87