├── .gitignore ├── .travis.yml ├── .rubocop_todo.yml ├── Gemfile ├── features ├── support │ ├── pages │ │ ├── paypal_front_page.rb │ │ ├── article_page.rb │ │ └── spenden_frontend_front_page.rb │ ├── modules │ │ ├── url_module.rb │ │ ├── helper.rb │ │ ├── banner_module.rb │ │ └── banner_form_module.rb │ └── env.rb ├── step_definitions │ ├── banner_mobile_steps.rb │ ├── banner_sticky_steps.rb │ ├── buttonbanner_steps.rb │ ├── yellowblue_steps.rb │ ├── banner_steps.rb │ ├── banner_form_steps.rb │ └── sensitive_steps.rb ├── banner.close.feature ├── banner.visibility.feature ├── mobile.fullscreen.feature ├── banner.form.feature ├── buttonbanner.donation.feature ├── yellowblue.donation.feature ├── sensitive.validation.feature ├── sensitive.ui.feature └── sensitive.donation.feature ├── .rubocop.yml ├── config └── config.yml.sample ├── environments.yml ├── README.md ├── Gemfile.lock └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | !.* 2 | .idea/ 3 | /config/config.yml 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | 3 | rvm: 4 | - 2.1.1 5 | 6 | script: bash ./build/travis/script.sh 7 | -------------------------------------------------------------------------------- /.rubocop_todo.yml: -------------------------------------------------------------------------------- 1 | # Configuration parameters: AllowURI, URISchemes. 2 | Metrics/LineLength: 3 | Max: 130 4 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'activesupport' 4 | gem 'mediawiki_selenium', '~> 1.5.0' 5 | gem 'require_all' 6 | gem 'parallel_tests' 7 | gem 'rubocop', require: false 8 | -------------------------------------------------------------------------------- /features/support/pages/paypal_front_page.rb: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | # 4 | # page object for the PayPal frontpage 5 | 6 | class PaypalFrontPage 7 | include PageObject 8 | 9 | table(:table_content_container, id: 'xptContentContainer') 10 | end 11 | -------------------------------------------------------------------------------- /features/support/modules/url_module.rb: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | 4 | module URL 5 | def self.mediawiki_url 6 | url = ENV['MEDIAWIKI_URL'] 7 | "http://#{url}" 8 | end 9 | 10 | def self.mediawiki_mobile_url 11 | url = ENV['MEDIAWIKI_MOBILE_URL'] 12 | "http://#{url}" 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /features/support/pages/article_page.rb: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | # 4 | # page object for the wikipedia article page 5 | 6 | class ArticlePage 7 | include PageObject 8 | include Helper 9 | include BannerModule 10 | include BannerFormModule 11 | 12 | page_url URL.mediawiki_url 13 | 14 | div(:div_footer, id: 'footer') 15 | end 16 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | inherit_from: .rubocop_todo.yml 2 | 3 | AllCops: 4 | StyleGuideCopsOnly: true 5 | 6 | Metrics/MethodLength: 7 | Enabled: false 8 | 9 | Style/Alias: 10 | Enabled: false 11 | 12 | Style/SignalException: 13 | Enabled: false 14 | 15 | Style/TrivialAccessors: 16 | ExactNameMatch: true 17 | 18 | Style/StringLiterals: 19 | EnforcedStyle: single_quotes 20 | 21 | Style/AsciiComments: 22 | Enabled: false 23 | -------------------------------------------------------------------------------- /features/step_definitions/banner_mobile_steps.rb: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | 4 | And(/^I click the (.*) mobilebanner (credit|paypal) option$/) do | banner_div_id, option | 5 | if option == 'credit' 6 | on(ArticlePage).get_element_by_id("#{banner_div_id}_btn-cc", 'button').when_visible.click 7 | elsif option == 'paypal' 8 | on(ArticlePage).get_element_by_id("#{banner_div_id}_btn-ppl", 'button').when_visible.click 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /features/support/env.rb: -------------------------------------------------------------------------------- 1 | require 'mediawiki_selenium' 2 | require 'mediawiki_selenium/support' 3 | require 'mediawiki_selenium/step_definitions' 4 | 5 | require 'net/http' 6 | require 'active_support/all' 7 | require 'require_all' 8 | 9 | config = YAML.load_file('config/config.yml') 10 | config.each do |k, v| 11 | ENV["#{k}"] = "#{v}" unless ENV["#{k}"] 12 | end 13 | 14 | # require_all 'features/support/utils' 15 | require_all 'features/support/modules' 16 | require_all 'features/support/pages' 17 | 18 | PageObject.default_element_wait = 10 # increased to avoid fails 19 | -------------------------------------------------------------------------------- /features/step_definitions/banner_sticky_steps.rb: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | 4 | And(/^I scroll to the footer$/) do 5 | on(ArticlePage).div_footer_element.scroll_into_view 6 | end 7 | 8 | And(/^The (.*) has a concrete position on the Y-axis$/) do | banner_div_id | 9 | @position = on(ArticlePage).get_banner_y_position(banner_div_id) 10 | end 11 | 12 | Then(/^The (.*) should move its position on the Y-axis downwards$/) do | banner_div_id | 13 | expect(on(ArticlePage).get_banner_y_position(banner_div_id) > @position).to be true 14 | end 15 | 16 | Then(/^The (.*) should have the same position on the Y\-axis$/) do | banner_div_id | 17 | expect(on(ArticlePage).get_banner_y_position(banner_div_id) == @position).to be true 18 | end 19 | -------------------------------------------------------------------------------- /features/support/modules/helper.rb: -------------------------------------------------------------------------------- 1 | module Helper 2 | include PageObject 3 | 4 | def get_element(id) 5 | @browser.element(id: "#{id}") 6 | end 7 | 8 | def get_element_by_id(id, type) 9 | element(type, id: "#{id}") 10 | end 11 | 12 | def get_element_by_xpath(xpath, type) 13 | element(type, xpath: xpath) 14 | end 15 | 16 | def custom_select_helper(id, selection) 17 | get_element_by_xpath(".//*[@id='#{id}']/following-sibling::span[1]", 'span').when_visible.click 18 | get_element_by_id(id, 'select').send_keys selection 19 | get_element_by_id(id, 'select').send_keys :enter 20 | end 21 | 22 | def get_span_by_class(class_id) 23 | @browser.element(xpath: "//span[contains(@class,'#{class_id}')][1]") 24 | end 25 | 26 | def self.generate_random_amount 27 | random = Random.new 28 | random.rand(1..99_999) 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /config/config.yml.sample: -------------------------------------------------------------------------------- 1 | # Copy this file to config.yml on your local system and set the values to your needs. 2 | # You can always set all of the below variables in your local environment by doing 3 | # set = (on Windows) or 4 | # export = (on Unix) 5 | # The environment variable will then be used instead of the values in here. 6 | 7 | # local configuration 8 | MEDIAWIKI_URL: "de.wikipedia.org" 9 | MEDIAWIKI_MOBILE_URL: "de.m.wikipedia.org" 10 | 11 | # local browser configuration 12 | BROWSER: "firefox" 13 | 14 | # paypal only 15 | PAYPAL_USERNAME: "" 16 | PAYPAL_PASSWORD: "" 17 | 18 | # saucelab configuration 19 | #SAUCE_ONDEMAND_USERNAME: "SauceLabUser" 20 | #SAUCE_ONDEMAND_ACCESS_KEY: "SauceLabKey" 21 | 22 | # additional parameters https://saucelabs.com/platforms/webdriver 23 | #BROWSER: "internet_explorer" 24 | #VERSION: "11" 25 | #PLATFORM: "Windows 8.1" -------------------------------------------------------------------------------- /features/support/modules/banner_module.rb: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | # 4 | # page object for the wikimedia.de banners 5 | 6 | module BannerModule 7 | include PageObject 8 | 9 | def goto_article_page_with_banner(article_name, banner_code, mob) 10 | if mob 11 | navigate_to URL.mediawiki_mobile_url + "?title=#{article_name}&banner=#{banner_code}" 12 | else 13 | navigate_to URL.mediawiki_url + "?title=#{article_name}&banner=#{banner_code}" 14 | end 15 | end 16 | 17 | def goto_random_page_with_banner(banner_code, mob) 18 | goto_article_page_with_banner('special:random', banner_code, mob) 19 | end 20 | 21 | def get_banner_y_position(banner_div_id) 22 | @browser.element(id: "#{banner_div_id}").wd.location.y 23 | end 24 | 25 | def wait_for_banner_to_show(banner_div_id) 26 | wait_until do 27 | get_element(banner_div_id).visible? 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /features/banner.close.feature: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | 4 | Feature: Check close functionality in banners for Wikipedia 5 | 6 | Background: 7 | 8 | Scenario: Checks if the banner stays closed when the hidecookie is set 9 | When I am on a random Wikipedia article page and provide a B15WMDE_bulb_prototype 10 | And The WMDE_Banner banner container is visible 11 | And I reset the hide banner cookie centralnotice_wmde15_hide_cookie 12 | And I click the banner close button 13 | And I am on a random Wikipedia article page and provide a B15WMDE_ikea_prototype 14 | And I wait 10 seconds 15 | Then The WMDE_Banner banner should not be visible 16 | 17 | Scenario: Checks if the banner shows again when the hidecookie value differs 18 | When I am on a random Wikipedia article page and provide a B15WMDE_bulb_prototype 19 | And The WMDE_Banner banner container is visible 20 | And I reset the hide banner cookie centralnotice_wmde15_hide_cookie 21 | And I click the banner close button 22 | And I am on a random Wikipedia article page and provide a B15WMDE_42_151222_ctrl 23 | Then The WMDE_Banner banner container should be visible -------------------------------------------------------------------------------- /environments.yml: -------------------------------------------------------------------------------- 1 | # Customize this configuration as necessary to provide defaults for various 2 | # test environments. 3 | # 4 | # The set of defaults to use is determined by the MEDIAWIKI_ENVIRONMENT 5 | # environment variable. 6 | # 7 | # export MEDIAWIKI_ENVIRONMENT=mw-vagrant-host 8 | # bundle exec cucumber 9 | # 10 | # Additional variables set by the environment will override the corresponding 11 | # defaults defined here. 12 | # 13 | # export MEDIAWIKI_ENVIRONMENT=mw-vagrant-host 14 | # export MEDIAWIKI_USER=Selenium_user2 15 | # bundle exec cucumber 16 | # 17 | mw-vagrant-host: &default 18 | mediawiki_url: http://127.0.0.1:8080/wiki/ 19 | mediawiki_user: Selenium_user 20 | mediawiki_password: vagrant 21 | 22 | mw-vagrant-guest: 23 | mediawiki_url: http://127.0.0.1/wiki/ 24 | mediawiki_user: Selenium_user 25 | mediawiki_password: vagrant 26 | 27 | beta: 28 | mediawiki_url: http://en.wikipedia.beta.wmflabs.org/wiki/ 29 | mediawiki_user: Selenium_user 30 | # mediawiki_password: SET THIS IN THE ENVIRONMENT! 31 | 32 | test2: 33 | mediawiki_url: http://test2.wikipedia.org/wiki/ 34 | mediawiki_user: Selenium_user 35 | # mediawiki_password: SET THIS IN THE ENVIRONMENT! 36 | 37 | default: *default 38 | -------------------------------------------------------------------------------- /features/banner.visibility.feature: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | 4 | Feature: Banner visibility checks for Wikipedia 5 | 6 | Background: 7 | 8 | Scenario Outline: Checks if a given banner is live 9 | When I am on the Wikipedia start page 10 | Then The should be present 11 | 12 | Examples: 13 | | banner_div_id | 14 | | WMDE_Banner | 15 | 16 | Scenario Outline: Checks if a given banner is available 17 | When I am on a random Wikipedia article page and provide a 18 | Then The should be present 19 | 20 | Examples: 21 | | banner_code | banner_div_id | 22 | | B14_WMDE_140918_ctrl | B14_WMDE_140918_ctrl | 23 | | B14_WMDE_140918_switch | B14_WMDE_140918_switch | 24 | 25 | 26 | Scenario Outline: Checks if a given banner shows after a given time 27 | When I am on a random Wikipedia article page and provide a 28 | And I start a timer 29 | Then The banner container should be visible 30 | And The timer should not exceed the 31 | 32 | Examples: 33 | | banner_code | banner_div_id | time_limit | 34 | | B14_WMDE_140918_switch | B14_WMDE_140918_switch | 10 | 35 | 36 | -------------------------------------------------------------------------------- /features/mobile.fullscreen.feature: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | 4 | Feature: Checks wikimedia.de fundraising mobile fullscreen banners for Wikipedia 5 | 6 | Background: 7 | 8 | Scenario Outline: Checks if the form submits the selectable amount correctly 9 | When I am on a random mobile Wikipedia article page and provide a B14WMDE_mobile_prototype 10 | And The B14WMDE_mobile_prototype banner container is visible 11 | And I click the banner amount option 12 | And I click the B14WMDE_mobile_prototype mobilebanner credit option 13 | Then The fundraising frontend shows 14 | And The amount value should show 15 | 16 | Examples: 17 | | amount | amount_value | 18 | | amount1 | 5 | 19 | | amount2 | 15 | 20 | | amount3 | 25 | 21 | | amount4 | 50 | 22 | | amount5 | 75 | 23 | | amount6 | 100 | 24 | 25 | Scenario: Checks if the form submits paypal correctly 26 | When I am on a random mobile Wikipedia article page and provide a B14WMDE_mobile_prototype 27 | And The B14WMDE_mobile_prototype banner container is visible 28 | And I click the banner amount1 amount option 29 | And I click the B14WMDE_mobile_prototype mobilebanner paypal option 30 | Then The paypal donation page shows -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | WikimediaBannerBrowserTests 2 | ==================== 3 | This directory contains the browser tests for Wikimedia Banners. 4 | 5 | ## Prerequisites 6 | See prerequisites on [Browser Testing for Wikidata](https://www.mediawiki.org/wiki/Wikibase/Programmer%27s_guide_to_Wikibase#Browser_Testing_for_Wikidata). 7 | 8 | OR follow these steps (Linux): 9 | 10 | \curl -L https://get.rvm.io | bash -s stable --ruby 11 | source /home/USERNAME/.rvm/scripts/rvm && rvm 12 | 13 | gem update --system 14 | gem install bundler 15 | bundle install 16 | 17 | git clone https://github.com/wmde/fundraising-bannertests.git 18 | cd fundraising-bannertests 19 | bundle install 20 | 21 | ## Configuration 22 | 23 | Mediawiki URL 24 | 25 | MEDIAWIKI_URL: "" 26 | 27 | ## Executing tests 28 | 29 | Update/install gems 30 | ```shell 31 | bundle update 32 | ``` 33 | 34 | Run all tests 35 | ```shell 36 | bundle exec cucumber 37 | ``` 38 | 39 | Run a specific feature 40 | ```shell 41 | bundle exec cucumber features/banner.visibility.feature 42 | ``` 43 | 44 | Run a specific scenario (codeline) 45 | ```shell 46 | bundle exec cucumber features/banner.visibility.feature:42 47 | ``` 48 | 49 | Run only tests with a specific tag 50 | ```shell 51 | bundle exec cucumber --tag @foo_bar 52 | ``` 53 | 54 | ## Executing tests on Sauce Labs 55 | 56 | Uncomment Sauce Labs configuration in config.yml 57 | 58 | Adjust Browser settings according to https://saucelabs.com/platforms/webdriver 59 | 60 | Execute tests as seen above 61 | -------------------------------------------------------------------------------- /features/support/modules/banner_form_module.rb: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | # 4 | # page object for the wikimedia.de banner with form 5 | 6 | module BannerFormModule 7 | include PageObject 8 | 9 | text_field(:input_amount, xpath: "//input[@id = 'amount_other']/following::input[1]") 10 | 11 | def click_banner_payment_option(option) 12 | case option 13 | when 'debit' 14 | element('button', xpath: '//td[@id = \'WMDE_BannerForm-wrapper\']/descendant::button[1]').when_visible.click 15 | when 'deposit' 16 | element('button', xpath: '//td[@id = \'WMDE_BannerForm-wrapper\']/descendant::button[2]').when_visible.click 17 | when 'credit' 18 | element('button', xpath: '//td[@id = \'WMDE_BannerForm-wrapper\']/descendant::button[3]').when_visible.click 19 | when 'paypal' 20 | element('button', xpath: '//td[@id = \'WMDE_BannerForm-wrapper\']/descendant::button[4]').when_visible.click 21 | else 22 | end 23 | end 24 | 25 | def get_validation_span_by_field(field) 26 | element('span', xpath: ".//*[@id='#{field}']/following::span[contains(@class, 'validation')][1]") 27 | end 28 | 29 | span(:span_confirm_amount, id: 'WMDE_BannerFullForm-confirm-amount') 30 | span(:span_confirm_salutation, id: 'WMDE_BannerFullForm-confirm-salutation') 31 | span(:span_confirm_street, id: 'WMDE_BannerFullForm-confirm-street') 32 | span(:span_confirm_city, id: 'WMDE_BannerFullForm-confirm-city') 33 | span(:span_confirm_mail, id: 'WMDE_BannerFullForm-confirm-mail') 34 | span(:span_confirm_iban, id: 'WMDE_BannerFullForm-confirm-IBAN') 35 | span(:span_confirm_bic, id: 'WMDE_BannerFullForm-confirm-BIC') 36 | end 37 | -------------------------------------------------------------------------------- /features/step_definitions/buttonbanner_steps.rb: -------------------------------------------------------------------------------- 1 | When(/^I click the buttonbanner regularly interval option$/) do 2 | on(ArticlePage).get_element_by_id('interval_tab_multiple', 'div').when_visible.click 3 | end 4 | 5 | When(/^I click the buttonbanner (deposit|credit|debit|paypal) option$/) do | option | 6 | case option 7 | when 'debit' 8 | on(ArticlePage).get_element_by_xpath('.//*[@id=\'WMDE_Banner-payment\']/ul[1]/li[1]/button', 'button').when_visible.click 9 | when 'deposit' 10 | on(ArticlePage).get_element_by_xpath('.//*[@id=\'WMDE_Banner-payment\']/ul[1]/li[2]/button', 'button').when_visible.click 11 | when 'credit' 12 | on(ArticlePage).get_element_by_xpath('.//*[@id=\'WMDE_Banner-payment\']/ul[2]/li[1]/button', 'button').when_visible.click 13 | when 'paypal' 14 | on(ArticlePage).get_element_by_xpath('.//*[@id=\'WMDE_Banner-payment\']/ul[2]/li[2]/button', 'button').when_visible.click 15 | else 16 | end 17 | end 18 | 19 | When(/^I click the buttonbanner (.*) amount option$/) do |amount| 20 | on(ArticlePage).get_element_by_id(amount, 'input').when_visible.click 21 | end 22 | 23 | When(/^I enter an random valid amount in the buttonbanner other amount field$/) do 24 | @amount = Helper.generate_random_amount 25 | on(ArticlePage).get_element_by_id('amount-other-input', 'input').when_visible.send_keys @amount 26 | end 27 | 28 | Then(/^The buttonbanner regularly details should show$/) do 29 | expect(on(ArticlePage).get_element_by_id('interval1', 'button').when_visible).to be_visible 30 | expect(on(ArticlePage).get_element_by_id('interval3', 'button').when_visible).to be_visible 31 | expect(on(ArticlePage).get_element_by_id('interval6', 'button').when_visible).to be_visible 32 | expect(on(ArticlePage).get_element_by_id('interval12', 'button').when_visible).to be_visible 33 | end 34 | -------------------------------------------------------------------------------- /features/step_definitions/yellowblue_steps.rb: -------------------------------------------------------------------------------- 1 | When(/^I select yellowblue banner (deposit|credit|debit|paypal) option$/) do | option | 2 | case option 3 | when 'debit' 4 | on(ArticlePage).custom_select_helper('zahlweise', 'Lastschrift') 5 | when 'deposit' 6 | on(ArticlePage).custom_select_helper('zahlweise', 'Überweisung') 7 | when 'credit' 8 | on(ArticlePage).custom_select_helper('zahlweise', 'Kreditkarte') 9 | when 'paypal' 10 | on(ArticlePage).custom_select_helper('zahlweise', 'Paypal') 11 | else 12 | end 13 | end 14 | 15 | When(/^I click the yellowblue (monthly|quarterly|semiyearly|yearly) interval option$/) do | option | 16 | case option 17 | when 'monthly' 18 | on(ArticlePage).get_element_by_id('interval1', 'button').when_visible.click 19 | when 'quarterly' 20 | on(ArticlePage).get_element_by_id('interval3', 'button').when_visible.click 21 | when 'semiyearly' 22 | on(ArticlePage).get_element_by_id('interval6', 'button').when_visible.click 23 | when 'yearly' 24 | on(ArticlePage).get_element_by_id('interval12', 'button').when_visible.click 25 | else 26 | end 27 | end 28 | 29 | When(/^I select the yellowblue banner (.*) amount option$/) do |amount| 30 | on(ArticlePage).custom_select_helper('amount_select', amount) 31 | end 32 | 33 | When(/^I click the yellowblue banner submit button$/) do 34 | on(ArticlePage).get_element_by_id('WMDE_Banner_formsubmit', 'button').when_visible.click 35 | end 36 | 37 | When(/^I enter an random valid amount in the yellowblue other amount field$/) do 38 | @amount = Helper.generate_random_amount 39 | on(ArticlePage).get_element_by_id('amount-other-input', 'input').when_visible.send_keys @amount 40 | end 41 | 42 | When(/^I click the yellowblue regularly interval option$/) do 43 | on(ArticlePage).get_element_by_id('interval_multiple', 'button').when_visible.click 44 | end 45 | 46 | Then(/^The yellowblue other amount field should show$/) do 47 | expect(on(ArticlePage).get_element_by_id('amount-other-input', 'input').when_visible).to be_visible 48 | end 49 | 50 | Then(/^The yellowblue regularly details should show$/) do 51 | expect(on(ArticlePage).get_element_by_id('interval1', 'button').when_visible).to be_visible 52 | expect(on(ArticlePage).get_element_by_id('interval3', 'button').when_visible).to be_visible 53 | expect(on(ArticlePage).get_element_by_id('interval6', 'button').when_visible).to be_visible 54 | expect(on(ArticlePage).get_element_by_id('interval12', 'button').when_visible).to be_visible 55 | end 56 | -------------------------------------------------------------------------------- /features/step_definitions/banner_steps.rb: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | 4 | Given(/^I am on the Wikipedia start page$/) do 5 | visit(ArticlePage) 6 | end 7 | 8 | When(/^I am on a random mobile Wikipedia article page and provide a (.*)$/) do | banner_code | 9 | on(ArticlePage).goto_random_page_with_banner(banner_code, true) 10 | end 11 | 12 | When(/^I am on a random Wikipedia article page and provide a (.*)$/) do | banner_code | 13 | on(ArticlePage).goto_random_page_with_banner(banner_code, false) 14 | end 15 | 16 | When(/^The (.*) banner container is visible$/) do |banner_div_id| 17 | on(ArticlePage).wait_for_banner_to_show(banner_div_id) 18 | end 19 | 20 | Then(/^The (.*) banner container should be visible$/) do |banner_div_id| 21 | on(ArticlePage).wait_for_banner_to_show(banner_div_id) 22 | end 23 | 24 | When(/^I start a timer$/) do 25 | @start_time = Time.now 26 | end 27 | 28 | When(/^I wait a second$/) do 29 | sleep(1) 30 | end 31 | 32 | When(/^I wait (\d+) seconds$/) do |seconds| 33 | sleep(seconds.to_i) 34 | end 35 | 36 | When(/^I click the banner close button/) do 37 | on(ArticlePage).get_element_by_id('WMDE_Banner-close', 'span').when_visible.click 38 | end 39 | 40 | When(/^I click the (.*) element$/) do | close_button | 41 | on(ArticlePage).get_element(close_button).when_visible.click 42 | end 43 | 44 | When(/^I click the (.*) element span$/) do | close_button | 45 | on(ArticlePage).get_span_by_class(close_button).click 46 | end 47 | 48 | When(/^I reset the hide banner cookie (.*)$/) do | cookie_name | 49 | cookie = "$.cookie('#{cookie_name}', null, { path: '/' });" 50 | browser.execute_script(cookie) 51 | end 52 | 53 | Then(/^The (.*) should be present$/) do | banner_div_id | 54 | expect(on(ArticlePage).get_element(banner_div_id).exists?).to be true 55 | end 56 | 57 | Then(/^The timer should not exceed the (.*)$/) do | time_limit | 58 | duration = Time.now - @start_time 59 | duration.should < time_limit.to_i 60 | end 61 | 62 | Then(/^The (.*) should hide$/) do | banner_div_id | 63 | expect(on(ArticlePage).get_element(banner_div_id).visible?).to be false 64 | end 65 | 66 | Then(/^The (.*) banner should not be visible/) do | banner_div_id | 67 | expect(on(ArticlePage).get_element_by_id(banner_div_id, 'div').when_not_visible).not_to be_visible 68 | end 69 | 70 | Then(/^The hide banner cookie (.*) should be set$/) do | cookie_name | 71 | cookie = "return $.cookie( '#{cookie_name}' );" 72 | expect(browser.execute_script(cookie)).to eq '1' 73 | end 74 | -------------------------------------------------------------------------------- /features/support/pages/spenden_frontend_front_page.rb: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | # 4 | # page object for the spenden.wikimedia.de frontpage 5 | 6 | class SpendenFrontendFrontPage 7 | include PageObject 8 | include Helper 9 | 10 | div(:div_spenden, id: 'wrapper') 11 | div(:div_debit_confirmation, id: 'debit-donation-confirmation') 12 | div(:div_normal_confirmation, id: 'normal-donation-confirmation') 13 | div(:div_deposit_confirmation, id: 'deposit-donation-confirmation') 14 | 15 | in_iframe({ id: 'micropayment-portal' }) do |mcp_frame| 16 | text_field(:input_holder, id: 'holder', frame: mcp_frame) 17 | text_field(:input_card_number, id: 'card-number', frame: mcp_frame) 18 | text_field(:input_cvc_code, id: 'cvc-code', frame: mcp_frame) 19 | end 20 | 21 | radio_button(:radio_deposit, id: 'payment-type-1') 22 | radio_button(:radio_credit, id: 'payment-type-2') 23 | radio_button(:radio_debit, id: 'payment-type-3') 24 | radio_button(:radio_paypal, id: 'payment-type-4') 25 | 26 | radio_button(:radio_single, id: 'periode-1') 27 | radio_button(:radio_regularly, id: 'periode-2') 28 | 29 | radio_button(:radio_single, id: 'periode-1') 30 | radio_button(:radio_regularly, id: 'periode-2') 31 | 32 | radio_button(:radio_5, id: 'amount-1') 33 | radio_button(:radio_15, id: 'amount-2') 34 | radio_button(:radio_25, id: 'amount-3') 35 | radio_button(:radio_50, id: 'amount-4') 36 | radio_button(:radio_75, id: 'amount-5') 37 | radio_button(:radio_100, id: 'amount-6') 38 | radio_button(:radio_250, id: 'amount-7') 39 | 40 | text_field(:input_amount, id: 'amount-8') 41 | 42 | div(:paypal_main, id: 'xptContentMain') 43 | span(:paypal_amount, id: 'mainTotalAmount') 44 | link(:paypal_back, xpath: "//input[@id = 'CONTEXT_CGI_VAR']/following::a[1]") 45 | text_field(:paypal_login_email, id: 'login_email') 46 | text_field(:paypal_login_password, id: 'login_password') 47 | button(:paypal_login_button, id: 'login.x') 48 | button(:paypal_continue_button, id: 'continue') 49 | 50 | span(:span_confirm_name, id: 'confirm-name') 51 | span(:span_confirm_street, id: 'confirm-street') 52 | span(:span_confirm_post_code, id: 'confirm-postcode') 53 | span(:span_confirm_city, id: 'confirm-city') 54 | span(:span_confirm_mail, id: 'confirm-mail') 55 | 56 | def get_donation_amount_element 57 | @browser.element(xpath: '//span[contains(@class,\'icon-ok-sign\')]/child::strong[1]') 58 | end 59 | 60 | def confirmed_amount_element 61 | element('strong', xpath: '//p[contains(@class,\'title\')]/child::strong[1]') 62 | end 63 | end 64 | -------------------------------------------------------------------------------- /features/banner.form.feature: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | 4 | Feature: Checks wikimedia.de fundraising form functionality in banners for Wikipedia 5 | 6 | Background: 7 | When I am on a random Wikipedia article page and provide a B15WMDE_bulb_prototype 8 | And The WMDE_Banner banner container is visible 9 | 10 | Scenario: Checks if the banner can be closed and the hidecookie is set 11 | When I reset the hide banner cookie centralnotice_wmde15_hide_cookie 12 | And I click the banner close button 13 | Then The WMDE_Banner banner should not be visible 14 | And The hide banner cookie centralnotice_wmde15_hide_cookie should be set 15 | 16 | Scenario: Checks if the form switches the interval options 17 | And I click the regularly interval option 18 | Then The regularly details shows 19 | 20 | Scenario Outline: Checks if the form submits the interval options correctly 21 | When I click the banner amount75 amount option 22 | And I click the regularly interval option 23 | And I click the interval option 24 | And I click the banner deposit option 25 | Then The fundraising frontend shows 26 | And The interval should be selected 27 | 28 | Examples: 29 | | interval | 30 | | monthly | 31 | | quarterly | 32 | | semiyearly | 33 | | yearly | 34 | 35 | Scenario Outline: Checks if the form submits the payment method correctly 36 | When I click the banner amount75 amount option 37 | And I click the banner option 38 | Then The fundraising frontend shows 39 | And The option should be selected 40 | 41 | Examples: 42 | | payment_method | 43 | | deposit | 44 | | debit | 45 | | credit | 46 | | paypal | 47 | 48 | Scenario: Checks if the low amount warning shows 49 | When I click the banner deposit option 50 | Then The low amount alert shows 51 | 52 | Scenario: Checks if the low amount warning blocks the form 53 | When I click the banner deposit option 54 | And I confirm the low amount alert 55 | Then The WMDE_Banner banner container is visible 56 | 57 | Scenario Outline: Checks if the form submits the selectable amount correctly 58 | When I click the banner amount option 59 | And I click the banner deposit option 60 | Then The fundraising frontend shows 61 | Then should show on the formpage as amount 62 | 63 | Examples: 64 | | amount | result_amount | 65 | | amount5 | 5,00€ | 66 | | amount15 | 15,00€ | 67 | | amount25 | 25,00€ | 68 | | amount50 | 50,00€ | 69 | | amount75 | 75,00€ | 70 | | amount100 | 100,00€ | 71 | | amount250 | 250,00€ | 72 | 73 | Scenario: Checks if the form submits the free field amount correctly 74 | When I enter an random valid amount 75 | And I click the banner deposit option 76 | Then The fundraising frontend shows 77 | And The given amount should show -------------------------------------------------------------------------------- /features/buttonbanner.donation.feature: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | 4 | Feature: Checks wikimedia.de fundraising donation functionality in the buttonbanner banner for Wikipedia 5 | 6 | Background: 7 | When I am on a random Wikipedia article page and provide a B15WMDE_30_151211_buttons 8 | And The WMDE_Banner banner container is visible 9 | 10 | Scenario: Checks if the banner can be closed and the hidecookie is set 11 | When I reset the hide banner cookie centralnotice_wmde15_hide_cookie 12 | And I click the banner close button 13 | Then The WMDE_Banner banner should not be visible 14 | And The hide banner cookie centralnotice_wmde15_hide_cookie should be set 15 | 16 | Scenario: Checks if the form switches the interval options 17 | When I click the buttonbanner regularly interval option 18 | Then The buttonbanner regularly details should show 19 | 20 | Scenario Outline: Checks if the form submits the interval options correctly 21 | When I click the buttonbanner field-amount_total_6 amount option 22 | And I click the buttonbanner regularly interval option 23 | And I click the interval option 24 | And I click the buttonbanner deposit option 25 | Then The fundraising frontend shows 26 | And The interval should be selected 27 | 28 | Examples: 29 | | interval | 30 | | monthly | 31 | | quarterly | 32 | | semiyearly | 33 | | yearly | 34 | 35 | Scenario: Checks if the low amount warning shows 36 | When I click the buttonbanner deposit option 37 | Then The low amount alert shows 38 | 39 | Scenario: Checks if the low amount warning blocks the form 40 | When I click the buttonbanner deposit option 41 | And I confirm the low amount alert 42 | Then The WMDE_Banner banner container is visible 43 | 44 | Scenario Outline: Checks if the form submits the selectable amount correctly 45 | And I click the buttonbanner amount option 46 | When I click the buttonbanner deposit option 47 | Then should show on the formpage as amount 48 | 49 | Examples: 50 | | amount | result_amount | 51 | # | field-amount_total_1 | 5,00€ | 52 | # | field-amount_total_2 | 15,00€ | 53 | # | field-amount_total_3 | 25,00€ | 54 | # | field-amount_total_4 | 50,00€ | 55 | # | field-amount_total_5 | 75,00€ | 56 | | field-amount_total_6 | 100,00€ | 57 | | field-amount_total_7 | 250,00€ | 58 | 59 | Scenario: Checks if the form submits the free field amount correctly 60 | When I enter an random valid amount in the buttonbanner other amount field 61 | And I click the buttonbanner deposit option 62 | Then The fundraising frontend shows 63 | And The given amount should show 64 | 65 | Scenario Outline: Checks if the form submits the payment method correctly 66 | When I click the buttonbanner field-amount_total_6 amount option 67 | When I click the buttonbanner option 68 | Then The fundraising frontend shows 69 | And 100,00€ should show on the formpage as amount 70 | And The option should be selected 71 | 72 | Examples: 73 | | payment_method | 74 | | deposit | 75 | | debit | 76 | | credit | 77 | | paypal | -------------------------------------------------------------------------------- /features/yellowblue.donation.feature: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | 4 | Feature: Checks wikimedia.de fundraising donation functionality in the yellowblue banner for Wikipedia 5 | 6 | Background: 7 | When I am on a random Wikipedia article page and provide a B15WMDE_ikea_prototype 8 | And The WMDE_Banner banner container is visible 9 | 10 | Scenario: Checks if the banner can be closed and the hidecookie is set 11 | When I reset the hide banner cookie centralnotice_wmde15_hide_cookie 12 | And I click the banner close button 13 | Then The WMDE_Banner banner should not be visible 14 | And The hide banner cookie centralnotice_wmde15_hide_cookie should be set 15 | 16 | Scenario: Checks if the form switches the interval options 17 | When I click the yellowblue regularly interval option 18 | Then The yellowblue regularly details should show 19 | 20 | Scenario Outline: Checks if the form submits the interval options correctly 21 | When I click the yellowblue regularly interval option 22 | And I click the yellowblue interval option 23 | And I click the yellowblue banner submit button 24 | Then The fundraising frontend shows 25 | And The interval should be selected 26 | 27 | Examples: 28 | | interval | 29 | | monthly | 30 | | quarterly | 31 | | semiyearly | 32 | | yearly | 33 | 34 | Scenario Outline: Checks if the form submits the selectable amount correctly 35 | When I select yellowblue banner deposit option 36 | And I select the yellowblue banner amount option 37 | And I click the yellowblue banner submit button 38 | Then The fundraising frontend shows 39 | And should show on the formpage as amount 40 | 41 | Examples: 42 | | amount | result_amount | 43 | # | 5,00 € | 5,00€ | 44 | # | 15,00 € | 15,00€ | 45 | # | 25,00 € | 25,00€ | 46 | # | 50,00 € | 50,00€ | 47 | # | 75,00 € | 75,00€ | 48 | | 100,00 € | 100,00€ | 49 | | 250,00 € | 250,00€ | 50 | 51 | Scenario: Checks if the form submits the free field amount correctly 52 | When I select yellowblue banner deposit option 53 | And I select the yellowblue banner Anderer Betrag amount option 54 | And I enter an random valid amount in the yellowblue other amount field 55 | And I click the yellowblue banner submit button 56 | Then The fundraising frontend shows 57 | And The given amount should show 58 | 59 | Scenario: Checks if the form shows the free field amount correctly 60 | When I select yellowblue banner deposit option 61 | And I select the yellowblue banner Anderer Betrag amount option 62 | Then The yellowblue other amount field should show 63 | 64 | Scenario Outline: Checks if the form submits the payment method correctly 65 | When I select yellowblue banner option 66 | And I select the yellowblue banner 100,00 € amount option 67 | And I click the yellowblue banner submit button 68 | Then The fundraising frontend shows 69 | And 100,00€ should show on the formpage as amount 70 | And The option should be selected 71 | 72 | Examples: 73 | | payment_method | 74 | | deposit | 75 | | debit | 76 | | credit | 77 | | paypal | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | activesupport (4.2.4) 5 | i18n (~> 0.7) 6 | json (~> 1.7, >= 1.7.7) 7 | minitest (~> 5.1) 8 | thread_safe (~> 0.3, >= 0.3.4) 9 | tzinfo (~> 1.1) 10 | ast (2.1.0) 11 | astrolabe (1.3.1) 12 | parser (~> 2.2) 13 | builder (3.2.2) 14 | childprocess (0.5.7) 15 | ffi (~> 1.0, >= 1.0.11) 16 | cucumber (1.3.20) 17 | builder (>= 2.1.2) 18 | diff-lcs (>= 1.1.3) 19 | gherkin (~> 2.12) 20 | multi_json (>= 1.7.5, < 2.0) 21 | multi_test (>= 0.1.2) 22 | data_magic (0.21) 23 | faker (>= 1.1.2) 24 | yml_reader (>= 0.4) 25 | diff-lcs (1.2.5) 26 | domain_name (0.5.25) 27 | unf (>= 0.0.5, < 1.0.0) 28 | faker (1.5.0) 29 | i18n (~> 0.5) 30 | faraday (0.9.2) 31 | multipart-post (>= 1.2, < 3) 32 | faraday-cookie_jar (0.0.6) 33 | faraday (>= 0.7.4) 34 | http-cookie (~> 1.0.0) 35 | ffi (1.9.10) 36 | gherkin (2.12.2) 37 | multi_json (~> 1.3) 38 | headless (2.2.0) 39 | http-cookie (1.0.2) 40 | domain_name (~> 0.5) 41 | i18n (0.7.0) 42 | json (1.8.3) 43 | mediawiki_api (0.5.0) 44 | faraday (~> 0.9, >= 0.9.0) 45 | faraday-cookie_jar (~> 0.0, >= 0.0.6) 46 | mediawiki_selenium (1.5.0) 47 | cucumber (~> 1.3, >= 1.3.20) 48 | headless (~> 2.0, >= 2.1.0) 49 | json (~> 1.8, >= 1.8.1) 50 | mediawiki_api (~> 0.4, >= 0.4.1) 51 | page-object (~> 1.0) 52 | rest-client (~> 1.6, >= 1.6.7) 53 | rspec-expectations (~> 2.14, >= 2.14.4) 54 | syntax (~> 1.2, >= 1.2.0) 55 | thor (~> 0.19, >= 0.19.1) 56 | mime-types (2.6.2) 57 | minitest (5.8.1) 58 | multi_json (1.11.2) 59 | multi_test (0.1.2) 60 | multipart-post (2.0.0) 61 | netrc (0.10.3) 62 | page-object (1.1.0) 63 | page_navigation (>= 0.9) 64 | selenium-webdriver (>= 2.44.0) 65 | watir-webdriver (>= 0.6.11) 66 | page_navigation (0.9) 67 | data_magic (>= 0.14) 68 | parallel (1.6.1) 69 | parallel_tests (1.9.0) 70 | parallel 71 | parser (2.2.3.0) 72 | ast (>= 1.1, < 3.0) 73 | powerpack (0.1.1) 74 | rainbow (2.0.0) 75 | require_all (1.3.2) 76 | rest-client (1.8.0) 77 | http-cookie (>= 1.0.2, < 2.0) 78 | mime-types (>= 1.16, < 3.0) 79 | netrc (~> 0.7) 80 | rspec-expectations (2.99.2) 81 | diff-lcs (>= 1.1.3, < 2.0) 82 | rubocop (0.34.2) 83 | astrolabe (~> 1.3) 84 | parser (>= 2.2.2.5, < 3.0) 85 | powerpack (~> 0.1) 86 | rainbow (>= 1.99.1, < 3.0) 87 | ruby-progressbar (~> 1.4) 88 | ruby-progressbar (1.7.5) 89 | rubyzip (1.1.7) 90 | selenium-webdriver (2.48.1) 91 | childprocess (~> 0.5) 92 | multi_json (~> 1.0) 93 | rubyzip (~> 1.0) 94 | websocket (~> 1.0) 95 | syntax (1.2.0) 96 | thor (0.19.1) 97 | thread_safe (0.3.5) 98 | tzinfo (1.2.2) 99 | thread_safe (~> 0.1) 100 | unf (0.1.4) 101 | unf_ext 102 | unf_ext (0.0.7.1) 103 | watir-webdriver (0.9.1) 104 | selenium-webdriver (>= 2.46.2) 105 | websocket (1.2.2) 106 | yml_reader (0.5) 107 | 108 | PLATFORMS 109 | ruby 110 | 111 | DEPENDENCIES 112 | activesupport 113 | mediawiki_selenium (~> 1.5.0) 114 | parallel_tests 115 | require_all 116 | rubocop 117 | -------------------------------------------------------------------------------- /features/sensitive.validation.feature: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | 4 | Feature: Checks wikimedia.de fundraising validation functionality in the sensitive banner for Wikipedia 5 | 6 | Background: 7 | When I am on a random Wikipedia article page and provide a B15WMDE_sensitive 8 | And The WMDE_BannerFullForm banner container is visible 9 | And I click the banner amount5 amount option 10 | 11 | Scenario Outline: Checks if the form validation accepts valid address data 12 | When I click sensitive banner deposit option 13 | And I enter sensitive private address data 14 | And I submit the sensitive banner non-debit form by 15 | Then The fundraising frontend shows 16 | 17 | Examples: 18 | | submit_type | 19 | | clicking the submit button | 20 | | pressing the enter key | 21 | 22 | Scenario Outline: Checks if the form validation complains with incomplete address data 23 | When I click sensitive banner deposit option 24 | And I enter sensitive private address data 25 | And I remove the address data 26 | And I submit the sensitive banner non-debit form by clicking the submit button 27 | Then The address donation part should be visible 28 | And An error should show 29 | 30 | Examples: 31 | | field | 32 | | first-name | 33 | | last-name | 34 | | street | 35 | | post-code | 36 | | city | 37 | | email | 38 | 39 | Scenario: Checks if the form validation complains with invalid email 40 | When I click sensitive banner deposit option 41 | And I enter sensitive private address data 42 | And I enter an invalid email 43 | And I submit the sensitive banner non-debit form by clicking the submit button 44 | Then The address donation part should be visible 45 | And An email error should show 46 | And An first-name error should not show 47 | 48 | Scenario: Checks if the form validation complains with invalid postcode 49 | When I click sensitive banner deposit option 50 | And I enter sensitive private address data 51 | And I enter an invalid post-code 52 | And I submit the sensitive banner non-debit form by clicking the submit button 53 | Then The address donation part should be visible 54 | And An post-code error should show 55 | And An first-name error should not show 56 | 57 | Scenario: Checks if the form validation complains with invalid sepa bank data 58 | When I click sensitive banner debit option 59 | And I enter invalid sepa bank data 60 | And I enter sensitive private address data 61 | And I submit the sensitive banner debit form by clicking the submit button 62 | Then The address donation part should be visible 63 | And An iban error should show 64 | And An first-name error should not show 65 | 66 | Scenario: Checks if the form validation complains with invalid non-sepa bank data 67 | When I click sensitive banner debit option 68 | And I click on the nonsepa payment option 69 | And I enter invalid non-sepa bank data 70 | And I enter sensitive private address data 71 | And I submit the sensitive banner debit form by clicking the submit button 72 | Then The address donation part should be visible 73 | And An account-number error should show 74 | And An first-name error should not show 75 | 76 | Scenario: Checks if the form validation converts german account data correctly 77 | When I click sensitive banner debit option 78 | And I click on the nonsepa payment option 79 | And I enter valid non-sepa bank data 80 | And I enter sensitive private address data 81 | Then The sepa bank data should be filled with corresponding data 82 | -------------------------------------------------------------------------------- /features/step_definitions/banner_form_steps.rb: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | 4 | And(/^I click the regularly interval option$/) do 5 | on(ArticlePage).get_element_by_id('interval_multiple', 'input').when_visible.click 6 | end 7 | 8 | When(/^I click the (monthly|quarterly|semiyearly|yearly) interval option$/) do | option | 9 | case option 10 | when 'monthly' 11 | on(ArticlePage).get_element_by_id('interval1', 'input').when_visible.click 12 | when 'quarterly' 13 | on(ArticlePage).get_element_by_id('interval3', 'input').when_visible.click 14 | when 'semiyearly' 15 | on(ArticlePage).get_element_by_id('interval6', 'input').when_visible.click 16 | when 'yearly' 17 | on(ArticlePage).get_element_by_id('interval12', 'input').when_visible.click 18 | else 19 | end 20 | end 21 | 22 | When(/^I confirm the low amount alert$/) do 23 | browser.alert.ok 24 | end 25 | 26 | When(/^The low amount alert shows$/) do 27 | expect(browser.alert.exists?).to be true 28 | end 29 | 30 | Then(/^The regularly details shows$/) do 31 | expect(on(ArticlePage).get_element('interval1').visible?).to be true 32 | end 33 | 34 | And(/^I click the banner (deposit|credit|debit|paypal) option$/) do | option | 35 | on(ArticlePage).click_banner_payment_option(option) 36 | end 37 | 38 | Then(/^The fundraising frontend shows$/) do 39 | on(SpendenFrontendFrontPage) do | page | 40 | page.wait_until do 41 | page.div_spenden_element.visible? 42 | end 43 | end 44 | end 45 | 46 | Then(/^The paypal donation page shows$/) do 47 | on(PaypalFrontPage) do | page | 48 | page.wait_until do 49 | page.table_content_container_element.visible? 50 | end 51 | end 52 | end 53 | 54 | And(/^The (deposit|credit|debit|paypal) option should be selected$/) do | option | 55 | case option 56 | when 'debit' 57 | expect(on(SpendenFrontendFrontPage).radio_debit_element.selected?).to be true 58 | when 'deposit' 59 | expect(on(SpendenFrontendFrontPage).radio_deposit_element.selected?).to be true 60 | when 'credit' 61 | expect(on(SpendenFrontendFrontPage).radio_credit_element.selected?).to be true 62 | when 'paypal' 63 | expect(on(SpendenFrontendFrontPage).radio_paypal_element.selected?).to be true 64 | else 65 | end 66 | end 67 | 68 | Then(/^The (monthly|quarterly|semiyearly|yearly) interval should be selected$/) do | option | 69 | case option 70 | when 'monthly' 71 | expect(on(SpendenFrontendFrontPage).get_element_by_id('interval-display', 'span').when_visible.text).to eq 'monatlich' 72 | when 'quarterly' 73 | expect(on(SpendenFrontendFrontPage).get_element_by_id('interval-display', 'span').when_visible.text).to eq 'quartalsweise' 74 | when 'semiyearly' 75 | expect(on(SpendenFrontendFrontPage).get_element_by_id('interval-display', 'span').when_visible.text).to eq 'halbjährlich' 76 | when 'yearly' 77 | expect(on(SpendenFrontendFrontPage).get_element_by_id('interval-display', 'span').when_visible.text).to eq 'jährlich' 78 | else 79 | end 80 | end 81 | 82 | And(/^I click the banner (.*) amount option$/) do | amount | 83 | on(ArticlePage).get_element_by_id(amount, 'button').when_visible.click 84 | end 85 | 86 | And(/^I enter an random valid amount$/) do 87 | @amount = Helper.generate_random_amount 88 | on(ArticlePage).input_amount_element.when_visible.send_keys @amount 89 | end 90 | 91 | And(/^The (.*) amount value should show$/) do | amount | 92 | expect(on(SpendenFrontendFrontPage).get_donation_amount_element.text).to be == "#{amount},00" 93 | end 94 | 95 | And(/^(.*) should show on the formpage as amount$/) do | amount | 96 | expect(on(SpendenFrontendFrontPage).get_donation_amount_element.text).to be == "#{amount}" 97 | end 98 | 99 | And(/^The given amount should show$/) do 100 | expect(on(SpendenFrontendFrontPage).get_donation_amount_element.text).to be == "#{@amount},00€" 101 | end 102 | -------------------------------------------------------------------------------- /features/sensitive.ui.feature: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | 4 | Feature: Checks wikimedia.de fundraising ui functionality in the sensitive banner for Wikipedia 5 | 6 | Background: 7 | When I am on a random Wikipedia article page and provide a B15WMDE_sensitive 8 | 9 | Scenario: Checks if the banner shows 10 | Then The WMDE_BannerFullForm banner container should be visible 11 | 12 | Scenario: Checks if the banner can be closed 13 | When The WMDE_Banner banner container is visible 14 | And I reset the hide banner cookie centralnotice_wmde15_hide_cookie 15 | And I click the banner close button 16 | Then The WMDE_Banner banner should not be visible 17 | And The hide banner cookie centralnotice_wmde15_hide_cookie should be set 18 | 19 | Scenario: Checks if the low amount warning shows 20 | When I click the banner deposit option 21 | And I submit the sensitive banner non-debit form by clicking the submit button 22 | Then The low amount alert shows 23 | 24 | Scenario: Checks if the form switches the interval options 25 | When The WMDE_BannerFullForm banner container is visible 26 | And I click the regularly interval option 27 | Then The regularly details shows 28 | 29 | Scenario: Checks if the debit payment method opens correctly 30 | When The WMDE_BannerFullForm banner container is visible 31 | And I click sensitive banner debit option 32 | Then The sepa donation part should be visible 33 | And The nonsepa donation part should not be visible 34 | And The person donation part should be visible 35 | And The company donation part should not be visible 36 | And The address donation part should be visible 37 | And The next button should be visible 38 | And The finish donation button should not be visible 39 | 40 | Scenario Outline: Checks if the non-debit payment methods open correctly 41 | When The WMDE_BannerFullForm banner container is visible 42 | And I click sensitive banner option 43 | Then The sepa donation part should not be visible 44 | And The nonsepa donation part should not be visible 45 | And The person donation part should be visible 46 | And The company donation part should not be visible 47 | And The address donation part should be visible 48 | And The next button should not be visible 49 | And The finish donation button should be visible 50 | 51 | Examples: 52 | | payment_method | 53 | | deposit | 54 | | credit | 55 | | paypal | 56 | 57 | Scenario: Checks if the non-sepa payment method opens correctly 58 | When The WMDE_BannerFullForm banner container is visible 59 | And I click sensitive banner debit option 60 | And I click on the nonsepa payment option 61 | Then The nonsepa donation part should be visible 62 | And The sepa donation part should not be visible 63 | 64 | Scenario: Checks if the company from field opens correctly 65 | When The WMDE_BannerFullForm banner container is visible 66 | And I click sensitive banner debit option 67 | And I click the business address type option 68 | Then The company donation part should be visible 69 | And The person donation part should not be visible 70 | 71 | Scenario: Checks if the anonymous from field works correctly 72 | When The WMDE_BannerFullForm banner container is visible 73 | And I click sensitive banner deposit option 74 | And I click the anonymous address type option 75 | Then The company donation part should not be visible 76 | And The person donation part should not be visible 77 | And The address donation part should not be visible 78 | And The sepa donation part should not be visible 79 | And The nonsepa donation part should not be visible 80 | 81 | Scenario: Checks if the anonymous clears fields correctly 82 | When The WMDE_BannerFullForm banner container is visible 83 | And I click sensitive banner deposit option 84 | And I enter sensitive private address data 85 | And I click the anonymous address type option 86 | Then The sensitive private address data should be cleared 87 | 88 | Scenario: Checks if switching the payment method clears fields correctly 89 | When The WMDE_BannerFullForm banner container is visible 90 | And I click sensitive banner debit option 91 | And I enter valid sepa bank data 92 | And I click sensitive banner deposit option 93 | And I click sensitive banner debit option 94 | Then The bank data cleared -------------------------------------------------------------------------------- /features/sensitive.donation.feature: -------------------------------------------------------------------------------- 1 | # @licence GNU GPL v2+ 2 | # @author Christoph Fischer 3 | 4 | Feature: Checks wikimedia.de fundraising donation functionality in the sensitive banner for Wikipedia 5 | 6 | Background: 7 | When I am on a random Wikipedia article page and provide a B15WMDE_sensitive 8 | And The WMDE_BannerFullForm banner container is visible 9 | 10 | Scenario Outline: Checks the deposit donation method and confirmation 11 | When I click sensitive banner deposit option 12 | And I click the banner amount option 13 | And I enter sensitive private address data 14 | And I submit the sensitive banner non-debit form by clicking the submit button 15 | Then The deposit confirmation page shows 16 | And The confirmed amount should be 17 | 18 | Examples: 19 | | amount | result_amount | 20 | # | amount5 | 5,00 | 21 | # | amount15 | 15,00 | 22 | # | amount25 | 25,00 | 23 | # | amount50 | 50,00 | 24 | # | amount75 | 75,00 | 25 | | amount100 | 100,00 | 26 | | amount250 | 250,00 | 27 | 28 | Scenario: Checks the credit card donation method 29 | When I click sensitive banner credit option 30 | And I click the banner amount100 amount option 31 | And I enter sensitive private address data 32 | And I submit the sensitive banner non-debit form by clicking the submit button 33 | Then The credit confirmation page shows 34 | And The 100 amount value should show 35 | And The cardholder should be the surname and name 36 | 37 | Scenario: Checks the paypal donation method 38 | When I click sensitive banner paypal option 39 | And I click the banner amount100 amount option 40 | And I enter sensitive private address data 41 | And I submit the sensitive banner non-debit form by clicking the submit button 42 | Then The paypal form shows 43 | And The paypal donation amount should show 100,00 Euro 44 | 45 | Scenario Outline: Checks the paypal donation method and confirmation 46 | When I click sensitive banner paypal option 47 | And I click the banner amount100 amount option 48 | And I click the address type option 49 | And I enter sensitive address data 50 | And I submit the sensitive banner non-debit form by clicking the submit button 51 | And I login with my paypal credentials 52 | And I click on the paypal continue button 53 | And I click on the paypal back button 54 | Then The normal donation confirmation shows 55 | And The sensitive address data on the confirmation page should be the same 56 | 57 | Examples: 58 | | address_type | 59 | | private | 60 | | business | 61 | 62 | Scenario: Checks the anonymous paypal donation method and confirmation 63 | When I click sensitive banner paypal option 64 | And I click the banner amount100 amount option 65 | And I click the anonymous address type option 66 | And I submit the sensitive banner non-debit form by clicking the submit button 67 | And I login with my paypal credentials 68 | And I click on the paypal continue button 69 | And I click on the paypal back button 70 | Then The normal donation confirmation shows 71 | 72 | Scenario Outline: Checks the debit donation method second step 73 | When I click sensitive banner debit option 74 | And I click the banner amount100 amount option 75 | And I enter valid sepa bank data 76 | And I click the address type option 77 | And I enter sensitive address data 78 | And I submit the sensitive banner debit form by clicking the submit button 79 | Then The debit second step should be visible 80 | And The debit first step should not be visible 81 | And The finish sepa donation button should be visible 82 | And The company donation part should not be visible 83 | And The person donation part should not be visible 84 | And The address donation part should not be visible 85 | And The sepa donation part should not be visible 86 | And The nonsepa donation part should not be visible 87 | And The debit donation amount should show 100 Euro 88 | And The sensitive address data on the debit second step should be the same 89 | 90 | Examples: 91 | | address_type | 92 | | private | 93 | | business | 94 | 95 | Scenario Outline: Checks the debit donation method and final confirmation 96 | When I click sensitive banner debit option 97 | And I click the banner amount100 amount option 98 | And I enter valid sepa bank data 99 | And I click the address type option 100 | And I enter sensitive address data 101 | And I submit the sensitive banner debit form by clicking the submit button 102 | And I confirm the debit contract 103 | And I confirm the notification contract 104 | And I finish the sensitive banner debit form by clicking the submit button 105 | Then The debit donation confirmation shows 106 | And The sensitive address data on the confirmation page should be the same 107 | 108 | Examples: 109 | | address_type | 110 | | private | 111 | | business | -------------------------------------------------------------------------------- /features/step_definitions/sensitive_steps.rb: -------------------------------------------------------------------------------- 1 | When(/^I click sensitive banner (deposit|credit|debit|paypal) option$/) do | option | 2 | on(ArticlePage).click_banner_payment_option(option) 3 | end 4 | 5 | When(/^I click on the nonsepa payment option$/) do 6 | on(ArticlePage).get_element_by_id('debit-type-2', 'input').when_visible.click 7 | end 8 | 9 | When(/^I click the (private|business|anonymous) address type option$/) do |address_type| 10 | if address_type == 'private' 11 | on(ArticlePage).get_element_by_id('address-type-1', 'input').when_visible.click 12 | elsif address_type == 'business' 13 | on(ArticlePage).get_element_by_id('address-type-2', 'input').when_visible.click 14 | else 15 | on(ArticlePage).get_element_by_id('address-type-3', 'input').when_visible.click 16 | end 17 | end 18 | 19 | When(/^I enter sensitive (private|business) address data$/) do |address_type| 20 | if address_type == 'private' 21 | on(ArticlePage).get_element_by_id('salutation-2', 'input').when_visible.click 22 | on(ArticlePage).get_element_by_id('first-name', 'text_field').when_visible.send_keys 'Maxe' 23 | on(ArticlePage).get_element_by_id('last-name', 'text_field').when_visible.send_keys 'Peter' 24 | else 25 | on(ArticlePage).get_element_by_id('company-name', 'text_field').when_visible.send_keys 'Maxe Peter GmbH & Co. KG' 26 | end 27 | 28 | on(ArticlePage).get_element_by_id('street', 'text_field').when_visible.send_keys 'Hansstrasse. 13' 29 | on(ArticlePage).get_element_by_id('city', 'text_field').when_visible.send_keys 'Stadtmuster' 30 | on(ArticlePage).get_element_by_id('post-code', 'text_field').when_visible.send_keys '12345' 31 | on(ArticlePage).get_element_by_id('email', 'text_field').when_visible.send_keys 'max@test.de' 32 | end 33 | 34 | When(/^I remove the (.*) address data$/) do |field| 35 | on(ArticlePage).get_element_by_id(field, 'text_field').when_visible.clear 36 | end 37 | 38 | When(/^I enter an invalid email$/) do 39 | on(ArticlePage).get_element_by_id('email', 'text_field').when_visible.clear 40 | on(ArticlePage).get_element_by_id('email', 'text_field').when_visible.send_keys 'super@totallyinvalidemailaddressforreal.com' 41 | end 42 | 43 | When(/^I enter an invalid post-code$/) do 44 | on(ArticlePage).get_element_by_id('post-code', 'text_field').when_visible.clear 45 | on(ArticlePage).get_element_by_id('post-code', 'text_field').when_visible.send_keys '123' 46 | end 47 | 48 | When(/^I enter valid sepa bank data$/) do 49 | on(ArticlePage).get_element_by_id('iban', 'text_field').when_visible.send_keys 'DE12500105170648489890' 50 | end 51 | 52 | When(/^I enter invalid sepa bank data$/) do 53 | on(ArticlePage).get_element_by_id('iban', 'text_field').when_visible.send_keys 'DE12500105170648489899' 54 | end 55 | 56 | When(/^I enter invalid non-sepa bank data$/) do 57 | on(ArticlePage).get_element_by_id('account-number', 'text_field').when_visible.send_keys '12341241244' 58 | end 59 | 60 | When(/^I submit the sensitive banner non-debit form by clicking the submit button$/) do 61 | on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-finish', 'button').when_visible.click 62 | end 63 | 64 | When(/^I submit the sensitive banner non-debit form by pressing the enter key$/) do 65 | on(ArticlePage).get_element_by_id('email', 'text_field').when_visible.send_keys :enter 66 | end 67 | 68 | When(/^I submit the sensitive banner debit form by clicking the submit button$/) do 69 | on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-next', 'button').when_visible.click 70 | end 71 | 72 | When(/^I submit the sensitive banner deposit form by pressing the enter key$/) do 73 | on(ArticlePage).get_element_by_id('first-name', 'text_field').when_visible.send_keys :enter 74 | end 75 | 76 | When(/^I enter valid non-sepa bank data$/) do 77 | on(ArticlePage).get_element_by_id('account-number', 'text_field').when_visible.send_keys '0648489890' 78 | on(ArticlePage).get_element_by_id('bank-code', 'text_field').when_visible.send_keys '50010517' 79 | end 80 | 81 | Then(/^The sepa bank data should be filled with corresponding data$/) do 82 | expect(on(ArticlePage).get_element_by_id('iban', 'text_field').value).to eq 'DE12500105170648489890' 83 | expect(on(ArticlePage).get_element_by_id('bic', 'text_field').value).to eq 'INGDDEFFXXX' 84 | end 85 | 86 | Then(/^The sensitive private address data should be cleared$/) do 87 | expect(on(ArticlePage).get_element_by_id('first-name', 'text_field').value).to eq '' 88 | expect(on(ArticlePage).get_element_by_id('last-name', 'text_field').value).to eq '' 89 | expect(on(ArticlePage).get_element_by_id('street', 'text_field').value).to eq '' 90 | expect(on(ArticlePage).get_element_by_id('city', 'text_field').value).to eq '' 91 | expect(on(ArticlePage).get_element_by_id('post-code', 'text_field').value).to eq '' 92 | expect(on(ArticlePage).get_element_by_id('email', 'text_field').value).to eq '' 93 | end 94 | 95 | Then(/^The bank data cleared$/) do 96 | expect(on(ArticlePage).get_element_by_id('iban', 'text_field').value).to eq '' 97 | end 98 | 99 | Then(/^The sepa donation part should be visible$/) do 100 | expect(on(ArticlePage).get_element_by_id('WMDE_Banner-sepa', 'div').when_visible).to be_visible 101 | end 102 | 103 | Then(/^The sepa donation part should not be visible$/) do 104 | expect(on(ArticlePage).get_element_by_id('WMDE_Banner-sepa', 'div').when_not_visible).not_to be_visible 105 | end 106 | 107 | Then(/^The nonsepa donation part should be visible$/) do 108 | expect(on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-nosepa', 'div').when_visible).to be_visible 109 | end 110 | 111 | Then(/^The nonsepa donation part should not be visible$/) do 112 | expect(on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-nosepa', 'div').when_not_visible).not_to be_visible 113 | end 114 | 115 | Then(/^The person donation part should be visible$/) do 116 | expect(on(ArticlePage).get_element_by_id('WMDE_Banner-person', 'div').when_visible).to be_visible 117 | end 118 | 119 | Then(/^The person donation part should not be visible$/) do 120 | expect(on(ArticlePage).get_element_by_id('WMDE_Banner-person', 'div').when_not_visible).not_to be_visible 121 | end 122 | 123 | Then(/^The company donation part should be visible$/) do 124 | expect(on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-company', 'div').when_visible).to be_visible 125 | end 126 | 127 | Then(/^The company donation part should not be visible$/) do 128 | expect(on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-company', 'div').when_not_visible).not_to be_visible 129 | end 130 | 131 | Then(/^The address donation part should be visible$/) do 132 | expect(on(ArticlePage).get_element_by_id('WMDE_Banner-address', 'div').when_visible).to be_visible 133 | end 134 | 135 | Then(/^The address donation part should not be visible$/) do 136 | expect(on(ArticlePage).get_element_by_id('WMDE_Banner-address', 'div').when_not_visible).not_to be_visible 137 | end 138 | 139 | Then(/^The next button should be visible$/) do 140 | expect(on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-next', 'button').when_visible).to be_visible 141 | end 142 | 143 | Then(/^The next button should not be visible$/) do 144 | expect(on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-next', 'button').when_not_visible).not_to be_visible 145 | end 146 | 147 | Then(/^The finish donation button should be visible$/) do 148 | expect(on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-finish', 'button').when_visible).to be_visible 149 | end 150 | 151 | Then(/^The finish donation button should not be visible$/) do 152 | expect(on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-finish', 'button').when_not_visible).not_to be_visible 153 | end 154 | 155 | Then(/^The finish sepa donation button should be visible$/) do 156 | expect(on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-finish-sepa', 'button').when_visible).to be_visible 157 | end 158 | 159 | Then(/^The finish sepa donation button should not be visible$/) do 160 | expect(on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-finish-sepa', 'button').when_not_visible).not_to be_visible 161 | end 162 | 163 | Then(/^The debit first step should be visible$/) do 164 | expect(on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-step1', 'div').when_visible).to be_visible 165 | end 166 | 167 | Then(/^The debit first step should not be visible$/) do 168 | expect(on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-step1', 'div').when_not_visible).not_to be_visible 169 | end 170 | 171 | Then(/^The debit second step should be visible$/) do 172 | expect(on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-step2', 'div').when_visible).to be_visible 173 | end 174 | 175 | Then(/^The debit second step should not be visible$/) do 176 | expect(on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-step2', 'div').when_not_visible).not_to be_visible 177 | end 178 | 179 | Then(/^An (.*) error should show$/) do |field| 180 | expect(on(ArticlePage).get_validation_span_by_field(field).when_visible.class_name).to eq 'validation icon-bug' 181 | end 182 | 183 | Then(/^An (.*) error should not show$/) do |field| 184 | expect(on(ArticlePage).get_validation_span_by_field(field).when_visible.class_name).to eq 'validation icon-ok' 185 | end 186 | 187 | Then(/^The deposit confirmation page shows$/) do 188 | expect(on(SpendenFrontendFrontPage).div_deposit_confirmation_element.when_visible).to be_visible 189 | end 190 | 191 | 192 | Then(/^The confirmed amount should be (.*)$/) do |result_amount| 193 | expect(on(SpendenFrontendFrontPage).confirmed_amount_element.when_visible.text).to eq "#{result_amount}€" 194 | end 195 | 196 | 197 | Then(/^The credit confirmation page shows$/) do 198 | expect(on(SpendenFrontendFrontPage).input_holder_element.when_visible).to be_visible 199 | end 200 | 201 | Then(/^The cardholder should be the surname and name$/) do 202 | expect(on(SpendenFrontendFrontPage).input_holder_element.when_visible.value).to eq 'Maxe Peter' 203 | end 204 | 205 | 206 | Then(/^The paypal form shows$/) do 207 | expect(on(SpendenFrontendFrontPage).paypal_main_element.when_visible).to be_visible 208 | end 209 | 210 | Then(/^The paypal donation amount should show (.*) Euro$/) do |result_amount| 211 | expect(on(SpendenFrontendFrontPage).paypal_amount_element.when_visible.text).to eq result_amount 212 | end 213 | 214 | 215 | When(/^I login with my paypal credentials$/) do 216 | on(SpendenFrontendFrontPage).paypal_login_email_element.when_visible.value = ENV['PAYPAL_USERNAME'] 217 | on(SpendenFrontendFrontPage).paypal_login_password_element.when_visible.value = ENV['PAYPAL_PASSWORD'] 218 | on(SpendenFrontendFrontPage).paypal_login_button_element.when_visible.click 219 | end 220 | 221 | When(/^I click on the paypal continue button$/) do 222 | on(SpendenFrontendFrontPage).paypal_continue_button_element.when_visible.click 223 | end 224 | 225 | When(/^I click on the paypal back button$/) do 226 | on(SpendenFrontendFrontPage).paypal_back_element.when_visible.click 227 | end 228 | 229 | Then(/^The normal donation confirmation shows$/) do 230 | expect(on(SpendenFrontendFrontPage).div_normal_confirmation_element.when_visible).to be_visible 231 | end 232 | 233 | Then(/^The sensitive (private|business) address data on the confirmation page should be the same$/) do |address_type| 234 | if address_type == 'private' 235 | expect(on(SpendenFrontendFrontPage).span_confirm_name_element.when_visible.text).to eq 'Maxe Peter' 236 | else 237 | expect(on(SpendenFrontendFrontPage).span_confirm_name_element.when_visible.text).to eq 'Maxe Peter GmbH & Co. KG' 238 | end 239 | expect(on(SpendenFrontendFrontPage).span_confirm_street_element.when_visible.text).to eq 'Hansstrasse. 13' 240 | expect(on(SpendenFrontendFrontPage).span_confirm_post_code_element.when_visible.text).to eq '12345' 241 | expect(on(SpendenFrontendFrontPage).span_confirm_city_element.when_visible.text).to eq 'Stadtmuster' 242 | expect(on(SpendenFrontendFrontPage).span_confirm_mail_element.when_visible.text).to eq 'max@test.de' 243 | end 244 | 245 | Then(/^The debit donation amount should show (.*) Euro$/) do |result_amount| 246 | expect(on(ArticlePage).span_confirm_amount_element.when_visible.text).to eq result_amount 247 | end 248 | 249 | Then(/^The sensitive (private|business) address data on the debit second step should be the same$/) do |address_type| 250 | if address_type == 'private' 251 | expect(on(ArticlePage).span_confirm_salutation_element.when_visible.text).to eq 'Herr Maxe Peter' 252 | else 253 | expect(on(ArticlePage).span_confirm_salutation_element.when_visible.text).to eq 'Maxe Peter GmbH & Co. KG' 254 | end 255 | expect(on(ArticlePage).span_confirm_street_element.when_visible.text).to eq 'Hansstrasse. 13' 256 | expect(on(ArticlePage).span_confirm_city_element.when_visible.text).to eq '12345 Stadtmuster' 257 | expect(on(ArticlePage).span_confirm_mail_element.when_visible.text).to eq 'max@test.de' 258 | end 259 | 260 | 261 | When(/^I confirm the debit contract$/) do 262 | on(ArticlePage).get_element_by_id('confirm_sepa', 'checkbox').when_visible.click 263 | end 264 | 265 | When(/^I confirm the notification contract$/) do 266 | on(ArticlePage).get_element_by_id('confirm_shortterm', 'checkbox').when_visible.click 267 | end 268 | 269 | When(/^I finish the sensitive banner debit form by clicking the submit button$/) do 270 | on(ArticlePage).get_element_by_id('WMDE_BannerFullForm-finish-sepa', 'button').when_visible.click 271 | end 272 | 273 | Then(/^The debit donation confirmation shows$/) do 274 | expect(on(SpendenFrontendFrontPage).div_debit_confirmation_element.when_visible).to be_visible 275 | end 276 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | --------------------------------------------------------------------------------