Ignore noop DB transactions errors on connection loss
[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 expect(on(PreferencesPage).save_button_element).to exist
22 end
23
24 Then(/^I can restore default settings$/) do
25 expect(on(PreferencesAppearancePage).restore_default_link_element).to exist
26 end
27
28 Then(/^I can see local time$/) do
29 expect(on(PreferencesAppearancePage).local_time_span_element).to exist
30 end
31
32 Then(/^I can see time offset section$/) do
33 expect(on(PreferencesAppearancePage).time_offset_table_element).to be_visible
34 end
35
36 Then(/^I can select date format$/) do
37 on(PreferencesAppearancePage) do |page|
38 expect(page.no_preference_radio_element).to exist
39 expect(page.mo_day_year_radio_element).to exist
40 expect(page.day_mo_year_radio_element).to exist
41 expect(page.year_mo_day_radio_element).to exist
42 expect(page.iso_8601_radio_element).to exist
43 end
44 end
45
46 Then(/^I can select image size$/) do
47 expect(on(PreferencesAppearancePage).size_select_element).to exist
48 end
49
50 Then(/^I can select my time zone$/) do
51 on(PreferencesAppearancePage) do |page|
52 expect(page.time_offset_select_element).to exist
53 expect(page.other_offset_element).to exist
54 end
55 end
56
57 Then(/^I can select skins$/) do
58 on(PreferencesAppearancePage) do |page|
59 expect(page.cologne_blue_element).to exist
60 expect(page.modern_element).to exist
61 expect(page.monobook_element).to exist
62 expect(page.vector_element).to exist
63 end
64 end
65
66 Then(/^I can select Threshold for stub link$/) do
67 expect(on(PreferencesAppearancePage).threshold_select_element).to exist
68 end
69
70 Then(/^I can select thumbnail size$/) do
71 expect(on(PreferencesAppearancePage).thumb_select_element).to exist
72 end
73
74 Then(/^I can select underline preferences$/) do
75 expect(on(PreferencesAppearancePage).underline_select_element).to exist
76 end
77
78 Then(/^I have advanced options checkboxes$/) do
79 on(PreferencesAppearancePage) do |page|
80 expect(page.hidden_categories_check_element).to exist
81 expect(page.auto_number_check_element).to exist
82 end
83 end