diff --git a/akvo/rsr/features/partner_site_routing.feature b/akvo/rsr/features/partner_site_routing.feature deleted file mode 100644 index c9d4d07c78..0000000000 --- a/akvo/rsr/features/partner_site_routing.feature +++ /dev/null @@ -1,17 +0,0 @@ -Feature: Routing middleware - In order to access the proper RSR page - As a user - I want RSR to show me the appropriate page based on my request URL - - Scenario: Route normal RSR URL - Given I access RSR from the url "www.akvo.org" I would like to access a normal RSR instance - Given I access RSR from the url "akvo.org" I would like to access a normal RSR instance - Given I access RSR from the url "localhost" I would like to access a normal RSR instance - Given I access RSR from the url "127.0.0.1" I would like to access a normal RSR instance - Given I access RSR from the url "akvo.dev" I would like to access a normal RSR instance - - Scenario: Route partner site RSR URL - Given I access RSR from the url "projects.akvoapp.org" I would like to access a partner sites RSR instance - - Scenario: Route nonvalid partner sites URL - Given I access RSR from the nonvalid url "nonvalid.partner.org" I want to see a 404 page diff --git a/akvo/rsr/features/steps.py b/akvo/rsr/features/steps.py deleted file mode 100644 index 6b434f22a1..0000000000 --- a/akvo/rsr/features/steps.py +++ /dev/null @@ -1,63 +0,0 @@ -# -*- coding: utf-8 -*- -""" - Akvo RSR is covered by the GNU Affero General Public License. - See more details in the license.txt file located at the root folder of the - Akvo RSR module. For additional details on the GNU license please - see < http://www.gnu.org/licenses/agpl.html >. - - Tests need to be executed by Lettuces Django integration: - python manage.py harvest rsr/features/partner_site_routing.feature -""" -from __future__ import absolute_import -from django.http import HttpRequest, Http404 -from lettuce import before, step, world -from akvo.rsr.middleware import PartnerSitesRouterMiddleware - - -@before.all -def setUp(): - """Make the middleware available to the world""" - world.mw = PartnerSitesRouterMiddleware() - - -@step(u'Given I access RSR from the url "([^"]*)" I would like to access \ -a normal RSR instance') -def given_a_default_rsr_url(step, normal_url): - """Tests that the middlweare returns None on a default URL""" - akvo_request = get_request(normal_url) - assert world.mw.process_request(akvo_request) == None - - -@step(u'Given I access RSR from the url "([^"]*)" I would like to access \ -a partner sites RSR instance') -def given_a_partner_site_url(step, partner_sites_url): - """Tests that a partner_site is available for a valid partner site""" - valid_request = get_request(partner_sites_url) - world.mw.process_request(valid_request) - try: - if valid_request.partner_site: - assert True - except AttributeError: - assert False - - -@step(u'Given I access RSR from the nonvalid url "([^"]*)" I want to see \ -a 404 page') -def given_a_nonvalid_partner_site_url(step, nonvalid_url): - """Tests that a nonvalid URL generates a 404 Not Found""" - nonvalid_request = get_request(nonvalid_url) - try: - world.mw.process_request(nonvalid_request) - except Http404: - assert True - else: - assert False - - -# Help functions -def get_request(url, port='8000'): - """Returns a Django request object with specified url and port""" - tmp_request = HttpRequest() - tmp_request.META['SERVER_NAME'] = url - tmp_request.META['SERVER_PORT'] = port - return tmp_request diff --git a/features/README b/features/README deleted file mode 100644 index 8eddd36f55..0000000000 --- a/features/README +++ /dev/null @@ -1,57 +0,0 @@ -Installaion -=========== -Follow the instructions outlined here: -https://github.com/akvo/akvo-rsr/wiki/Akvo-RSR-developer-guide (up to "Build your local development environment") - -Preconditions -============= -Some of the tests require accounts to be set up with appropriate permissions (e.g. a test administration account to enable the creation of projects) and a number of configuration files to be set up. The following templates are provided to assist: - -/features/site_under_test.py.template -/features/donations/auth.py.template - -Create copies of these files by navigating to the directories in which they are located and executing the following commands: - ->> cp site_under_test.py.template site_under_test.py ->> cd donations ->> cp auth.py.template auth.py - -Then edit the copies (site_under_test.py and auth.py) to contain the relevant passwords, accounts and configurations. (These files are listed in the .gitignore file to avoid passwords accidently being checked in) - -Using Lettuce -============= -1) Navigate to the directory that contains the "features" subdirectory (e.g. currently the root directory in the RSR code base) - -2) Enter one of the two options on the command line: - ->> lettuce -to run the full suite of available tests - -or - ->> lettuce features/ - -e.g. - ->> lettuce smoke_tests/server_tests.feature - -which will run only the tests contained in the server_tests.feature file - -Piping Output to a Logfile -========================== -Use '>' to create/overwrite a file or '>>' to append to an existing file - -For example ->> lettuce --verbosity=2 donations/ > log.txt - -This command runs lettuce and writes the results to the log file called "log.txt". The verbosity level dictates the amount of detail contained in the output of the test run. - -It can be useful to include the date and time the tests were started in title of the logfile. This can be done using output from the "date" command. The following command: - ->> lettuce --verbosity=2 donations/ > logfile_`date +"%d.%m.%Y_%Hh%Mm%Ss"`.txt - -Produces a log file in the directory in which the command was run with a name such as: "logfile_27.03.2013_11h29m07s.txt" - -Using PayPal Sandbox test accounts -================================== -When running tests that utilise the PayPal sandbox it is necessary to set environment variable that holds the business email address set up on the PayPal test account on the server being targetted for testing. This can only be done by someone who has been given permission to access and edit the file on the server. diff --git a/features/__init__.py b/features/__init__.py deleted file mode 100644 index 724dc4bed4..0000000000 --- a/features/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- - -# Akvo RSR is covered by the GNU Affero General Public License. -# See more details in the license.txt file located at the root folder of the Akvo RSR module. -# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. - -# Initialiser for the root RSR features module. diff --git a/features/admin/__init__.py b/features/admin/__init__.py deleted file mode 100644 index 5d6cd0df35..0000000000 --- a/features/admin/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- - -# Akvo RSR is covered by the GNU Affero General Public License. -# See more details in the license.txt file located at the root folder of the Akvo RSR module. -# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. - -# Initialiser for the RSR admin module. diff --git a/features/admin/auth.py.template b/features/admin/auth.py.template deleted file mode 100644 index edbe0844f8..0000000000 --- a/features/admin/auth.py.template +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- - -from lettuce import world - - -world.AKVO_ADMIN_USER = 'admintest' -world.AKVO_ADMIN_PASSWORD = '[SOME_PW]' diff --git a/features/donations/__init__.py b/features/donations/__init__.py deleted file mode 100644 index bf7492d074..0000000000 --- a/features/donations/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- - -# Akvo RSR is covered by the GNU Affero General Public License. -# See more details in the license.txt file located at the root folder of the Akvo RSR module. -# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. - -# Initialiser for the RSR donations module. diff --git a/features/donations/auth.py.template b/features/donations/auth.py.template deleted file mode 100644 index db3ce144d8..0000000000 --- a/features/donations/auth.py.template +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- - -from lettuce import world - - -world.PAYPAL_MASTER_USER ='test@akvo.org' -world.PAYPAL_MASTER_PASSWORD = '[SOME_PW]' -world.PAYPAL_TEST_USER = 'test_1352204974_per@akvo.org' -world.PAYPAL_TEST_USER_PASSWORD = '[SOME_PW]' diff --git a/features/donations/config/__init__.py b/features/donations/config/__init__.py deleted file mode 100644 index ede860259e..0000000000 --- a/features/donations/config/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- - -# Akvo RSR is covered by the GNU Affero General Public License. -# See more details in the license.txt file located at the root folder of the Akvo RSR module. -# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. - -# Initialiser for the RSR donations.config module. diff --git a/features/donations/config/mollie.py b/features/donations/config/mollie.py deleted file mode 100644 index 26ae02e039..0000000000 --- a/features/donations/config/mollie.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- - -from lettuce import world - - -world.MOLLIE_FEE_BASE = 1.20 # ¢99 plus -world.MOLLIE_VAT_PCT = 20 # Dutch VAT changed on Mollie fee -world.MOLLIE_NOTIFICATION_EMAIL = 'test@akvo.org' -world.MOLLIE_PARTNER_ID = '281135' diff --git a/features/donations/config/paypal.py b/features/donations/config/paypal.py deleted file mode 100644 index 8fab94cddf..0000000000 --- a/features/donations/config/paypal.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- - -from lettuce import world - - -world.DECIMALS_DEBUG = 0 # set to 0 if this flag is not switched on in the test target (or 1 if it is) -world.PAYPAL_TEST_VISA = '4131363167241088' -world.PAYPAL_TEST_VISA_EXP_MONTH = '11' -world.PAYPAL_TEST_VISA_EXP_YEAR = '2017' -world.PAYPAL_MAX_DONATION_AMOUNT = '8000' -world.PAYPAL_FEE_PCT_USD = 3.9 # 3.9% transaction fee -world.PAYPAL_FEE_BASE_USD = 0.30 # plus ¢30 -world.PAYPAL_FEE_PCT_EUR = 3.4 # 3.4% transaction fee -world.PAYPAL_FEE_BASE_EUR = 0.35 # plus ¢35 diff --git a/features/donations/donation_steps.py b/features/donations/donation_steps.py deleted file mode 100644 index cf97e5e991..0000000000 --- a/features/donations/donation_steps.py +++ /dev/null @@ -1,425 +0,0 @@ -# -*- coding: utf-8 -*- - -from lettuce import step, world, before -from time import sleep, time - -from admin.auth import * -from donations.auth import * -from donations.config.mollie import * -from donations.config.paypal import * - - -@before.each_feature -def log_in_to_paypal_test_environment(feature): -# '''Figure out the URL to the project''' -# world.browser.visit('http://%s' % world.SITE_UNDER_TEST) -# element = world.browser.find_link_by_partial_href('donate').first -# world.project_URL = '/'.join(element['href'].split('/')[:-2]) + '/' - '''Log in to paypal to ensure the environment is active''' - world.browser.visit('https://developer.paypal.com/') - world.browser.fill('login_email', world.PAYPAL_MASTER_USER) - world.browser.fill('login_password', world.PAYPAL_MASTER_PASSWORD) - world.browser.check('cb_auto_login') - world.browser.find_by_name('submit').first.click() - -@before.each_scenario -def navigate_to_homepage(scenario): - world.browser.visit('http://%s/rsr/projects/' % world.SITE_UNDER_TEST) - -@step(u'When I create and publish "([^"]*)" uniquely named "([^"]*)" projects with a budget of "([^"]*)"') -def when_i_create_and_publish_group1_uniquely_named_group2_projects(step, num_of_projects, currency, project_budget): - count = 0 - while count < int(num_of_projects): - world.browser.click_link_by_text('Projects') - world.browser.click_link_by_partial_href('project/add/') - project_name = 'DonationTestProject' + str(time()) - world.browser.fill('title', project_name) - world.browser.fill('subtitle', 'This is a project created for donation tests') - world.browser.driver.find_element_by_xpath('//*[@id="id_status"]/option[2]').click() - world.browser.driver.find_element_by_xpath('//*[@id="id_categories"]/option[6]').click() - world.browser.fill('project_plan_summary', 'This is a project created for donation tests') - world.browser.fill('sustainability', 'This is a project created for donation tests') - if currency == 'euro': - world.browser.driver.find_element_by_xpath('//*[@id="id_currency"]/option[2]').click() - elif currency == 'dollar': - world.browser.driver.find_element_by_xpath('//*[@id="id_currency"]/option[1]').click() - world.browser.fill('goals_overview', 'This is a project created for donation tests') - world.browser.driver.find_element_by_xpath('//*[@id="id_budget_items-0-label"]/option[3]').click() - world.browser.fill('budget_items-0-amount', project_budget) - world.browser.driver.find_element_by_xpath('//*[@id="id_partnerships-0-partner_type"]/option[2]').click() - world.browser.find_by_name('_save').first.click() - world.browser.click_link_by_partial_href('admin/rsr/') - world.browser.click_link_by_partial_href('/rsr/admin/rsr/publishingstatus/') - world.browser.click_link_by_text(project_name) - world.browser.driver.find_element_by_xpath('//*[@id="id_status"]/option[2]').click() - world.browser.find_by_name('_save').first.click() - world.browser.click_link_by_partial_href('admin/rsr/') - count = count+1 - -@step(u'Then I can log out of RSR admin') -def then_i_can_log_out_of_rsr_admin(step): - world.browser.click_link_by_partial_href('admin/logout/') - -@step(u'When I go to project listing page') -def when_i_go_to_project_listing_page(step): - world.browser.find_link_by_href('href="/rsr/projects/all/"') - -@step(u'When I find the first project still to be funded in €') -def when_i_find_the_first_project_still_to_be_funded_in(step): - project_table = world.browser.find_by_tag('tbody').first - project_rows = project_table.find_by_tag('tr') - count = 0 - while count < len(project_rows): - if 'Donate' in project_rows[count].text and u"€" in project_rows[count].text: - element = project_rows[count].find_by_css('a').last - world.project_needing_euro_URL = '/'.join(element['href'].split('/')[:-2]) + '/' - break - count = count + 1 - - row_text = project_rows[count].text.split('\n') - - last_word = len(row_text)-1 - - world.percentage_raised_all_page = int(''.join([c for c in row_text[last_word-1] if c in '1234567890'])) - world.total_budget_all_page = int(''.join([c for c in row_text[last_word-2] if c in '1234567890'])) - world.browser.visit(world.project_needing_euro_URL) - -@step(u'When I find the first project still to be funded in "([^"]*)"') -def when_i_find_the_first_project_still_to_be_funded_in(step, currency): - if currency == "dollars": - currency_symbol = u"$" - elif currency == "euros": - currency_symbol = u"€" - - project_table = world.browser.find_by_tag('tbody').first - project_rows = project_table.find_by_tag('tr') - count = 0 - while count < len(project_rows): - if 'Donate' in project_rows[count].text and currency_symbol in project_rows[count].text: - element = project_rows[count].find_by_css('a').last - if currency == "dollars": - world.project_needing_dollars_URL = '/'.join(element['href'].split('/')[:-2]) + '/' - elif currency == "euros": - world.project_needing_euro_URL = '/'.join(element['href'].split('/')[:-2]) + '/' - break - count = count + 1 - - row_text = project_rows[count].text.split('\n') - - last_word = len(row_text)-1 - - world.percentage_raised_all_page = int(''.join([c for c in row_text[last_word-1] if c in '1234567890'])) - world.total_budget_all_page = int(''.join([c for c in row_text[last_word-2] if c in '1234567890'])) - if currency == "dollars": - world.browser.visit(world.project_needing_dollars_URL) - elif currency == "euros": - world.browser.visit(world.project_needing_euro_URL) - -@step(u'When I find the first "([^"]*)" project requiring the maximum allowed PayPal donation or less, which has not received any donations') -def when_i_find_the_first_group1_project_requiring_the_maximum_allowed_paypal_donation_or_less_which_has_not_received_any_donations(step, currency): - if currency == "euro": - currency_symbol = u"€" - elif currency == "dollar": - currency_symbol = u"$" - project_table = world.browser.find_by_tag('tbody').first - project_rows = project_table.find_by_tag('tr') - count = 0 - while count < len(project_rows): - if 'Donate' in project_rows[count].text and currency_symbol in project_rows[count].text and '0 %' in project_rows[count].text: - element = project_rows[count].find_by_css('a').last - world.project_needing_funding_URL = '/'.join(element['href'].split('/')[:-2]) + '/' - row_text = project_rows[count].text.split('\n') - last_word = len(row_text)-1 - world.total_budget_all_page = int(''.join([c for c in row_text[last_word-2] if c in '1234567890'])) - if world.total_budget_all_page <= int(world.PAYPAL_MAX_DONATION_AMOUNT): - world.percentage_raised_all_page = int(''.join([c for c in row_text[last_word-1] if c in '1234567890'])) - break - count = count + 1 - world.browser.visit(world.project_needing_funding_URL) - -@step(u'When I note how many "([^"]*)" have been raised and how much is still needed') -def when_i_note_how_many_group1_have_been_raised_and_how_much_is_still_needed(step, currency): - if currency == "euros": - currency_symbol = u"€" - elif currency == "dollars": - currency_symbol = u"$" - element = world.browser.find_by_css('.fundingbox-table').first - raised_text, still_needed_text = element.text.split('\n') - total_budget_text = world.browser.find_by_css('.fundingbox-table').last.text - - #print "Original text: \n" + total_budget_text - #raised_text, still_needed_text = element.text.split('\n') - #print "Captured text: " + raised_text - - world.money_raised = int(raised_text.split(currency_symbol)[-1].strip().replace(",", "")) - world.money_still_needed = int(still_needed_text.split(currency_symbol)[-1].strip().replace(",", "")) - world.total_budget = int(total_budget_text.split(currency_symbol)[-1].strip().replace(",", "")) - #print world.total_budget - -@step(u'Then these amounts should agree with those on the project listing page') -def then_these_amounts_should_agree_with_those_on_the_project_listing_page(step): - assert world.total_budget_all_page == world.total_budget - assert (world.total_budget - world.money_raised) == world.money_still_needed - assert world.percentage_raised_all_page == world.money_raised * 100 / world.total_budget - -@step(u'When I click on the "([^"]*)" link') -def when_i_click_on_the_group1_link(step, link_name): - #world.browser.driver.execute_script('window.onbeforeunload = function() {}') - world.browser.click_link_by_text(link_name) - -@step(u'When I click on the link with "([^"]*)" in the URL for the project') -def when_i_click_on_the_link_with_group1_in_the_url_for_the_project(step, link_name): - world.browser.click_link_by_partial_href(link_name) - -@step(u'When I enter "([^"]*)" in the "([^"]*)" field') -def when_i_enter_group1_in_the_group2_field(step, input_value, field_name): - value = input_value - if input_value == "the estimated amount including fees to fully fund the project": - value = world.fully_fund_with_fees_estimate - elif input_value == "half the estimated amount including fees left to donate": - value = world.fully_fund_with_fees_estimate / 2 - world.first_donation = value - elif input_value == "the full estimated amound including fees plus an additional one percent": - value = int(float(world.fully_fund_with_fees_estimate)*1.01) - world.browser.fill(field_name, value) - -@step(u'When I enter the full budget required for the project in the "([^"]*)" field') -def when_i_enter_the_full_budget_required_for_the_project_in_the_group1_field(step, field_name): - world.browser.fill(field_name, world.total_budget_all_page) - -@step(u'When I click on the donate button') -def when_i_click_on_the_donate_button(step): - world.browser.find_by_name('submit').first.click() - -@step(u'When I enter the PayPal test username in the "([^"]*)" field') -def when_i_enter_the_paypal_test_username_in_the_group1_field(step, field_name): - world.browser.fill(field_name, world.PAYPAL_TEST_USER) - -@step(u'When I enter the PayPal test password in the "([^"]*)" field') -def when_i_enter_the_paypal_test_password_in_the_group1_field(step, field_name): - world.browser.fill(field_name, world.PAYPAL_TEST_USER_PASSWORD) - -@step(u'When I click on the PayPal login button') -def when_i_click_on_the_donate_button(step): - world.browser.find_by_name('login.x').first.click() - -@step(u'When I Click on the Continue button') -def when_i_click_on_the_continue_button_continue_x(step): - world.browser.find_by_name('continue.x').first.click() - -@step(u'When I click on the Back to Akvos test store button') -def when_i_click_on_the_back_to_akvo_s_test_store_button_merchant_return_link(step): - world.browser.find_by_name('merchant_return_link').first.click() - alert = world.browser.get_alert() - alert.accept() - #world.browser.visit(world.project_URL) - -@step(u'When I note the new values of how much has been raised and how much is still needed') -def when_i_note_how_much_has_been_raised_and_how_much_is_still_needed(step): - element = world.browser.find_by_css('.fundingbox-table').first - raised_text, still_needed_text = element.text.split('\n') - world.new_money_raised = int(raised_text.split(u"€")[-1].strip().replace(",", "")) - world.new_money_still_needed = int(still_needed_text.split(u"€")[-1].strip().replace(",", "")) - -@step(u'Then I see that the amount raised has been incremented by "([^"]*)" and the amount left to raise decremented by the same amount') -def then_i_see_that_the_amount_raised_has_been_incremented_by_group1_and_the_amount_left_to_raise_decremented_by_the_same_amount(step, amount): - assert world.new_money_raised == (world.money_raised + int(amount)) - assert world.new_money_still_needed == (world.money_still_needed - int(amount)) - -@step(u'Then I see this error message "([^"]*)"') -def then_i_see_this_error_message_group1(step, expected_error): - element = world.browser.find_by_css('.errorlist').first - errortext = element.find_by_tag('li').first.text - assert errortext == expected_error - -@step(u'When I enter more funds than are needed in the "([^"]*)" field') -def when_i_enter_more_funds_than_are_needed_in_the_group1_field(step, field_name): - input_value = (world.money_still_needed * 2) - world.browser.fill(field_name, input_value) - -@step(u'When I enter the remaining amount needed in the "([^"]*)" field') -def when_i_enter_the_remaining_amount_needed_in_the_group1_field(step, field_name): - input_value = world.money_still_needed - world.browser.fill(field_name, input_value) - -@step(u'Then I see that the amount raised and the amount left to raise are unchanged') -def then_i_see_that_the_amount_raised_and_the_amount_left_to_raise_are_unchanged(step): - assert world.new_money_raised == world.money_raised - assert world.new_money_still_needed == world.money_still_needed - -@step(u'When I return to the euro project requiring funding') -def when_i_return_to_the_euro_project_requiring_funding(step): - world.browser.visit(world.project_needing_euro_URL) - -@step(u'When I wait "([^"]*)" minutes') -def when_i_wait_group1_minutes(step, minutes): - wait_seconds = float(minutes) * 60 - sleep(wait_seconds) - -@step(u'When I take note of the invoice number') -def when_i_take_note_of_the_invoice_number(step): - world.paypal_invoice_number = world.browser.find_by_css('.donate_details_right').first.text - -@step(u'When I log in to RSR admin') -def when_i_log_in_to_rsr_admin(step): - world.browser.find_link_by_text('Akvo RSR login').first.click() - world.browser.fill('username', world.AKVO_ADMIN_USER) - world.browser.fill('password', world.AKVO_ADMIN_PASSWORD) - world.browser.find_by_xpath('//*[@id="login-form"]/div[4]/input').first.click() - -@step(u'Then I see the error message "([^"]*)" each time I leave one of the fields blank') -def then_i_see_the_error_message_group1_each_time_i_leave_one_of_the_fields_blank(step, expected_error): - world.browser.fill('name', 'Akvo Test') - world.browser.fill('email', 'test@akvo.org') - world.browser.fill('email2', 'test@akvo.org') - world.browser.click_link_by_partial_href('donate_form') - world.browser.click_link_by_partial_href('donate_form') - element = world.browser.find_by_css('.errorlist').first - errortext = element.find_by_tag('li').first.text - assert errortext == expected_error - - world.browser.fill('amount', '10') - world.browser.fill('name', '') - world.browser.fill('email', 'test@akvo.org') - world.browser.fill('email2', 'test@akvo.org') - world.browser.click_link_by_partial_href('donate_form') - element = world.browser.find_by_css('.errorlist').first - errortext = element.find_by_tag('li').first.text - assert errortext == expected_error - - world.browser.fill('amount', '10') - world.browser.fill('name', 'Akvo Test') - world.browser.fill('email', '') - world.browser.fill('email2', 'test@akvo.org') - world.browser.click_link_by_partial_href('donate_form') - element = world.browser.find_by_css('.errorlist').first - errortext = element.find_by_tag('li').first.text - assert errortext == expected_error - - world.browser.fill('amount', '10') - world.browser.fill('name', 'Akvo Test') - world.browser.fill('email', 'test@akvo.org') - world.browser.fill('email2', '') - world.browser.click_link_by_partial_href('donate_form') - element = world.browser.find_by_css('.errorlist').first - errortext = element.find_by_tag('li').first.text - assert errortext == expected_error - -@step(u'When I enter the information to make an anonymous donation') -def when_i_enter_the_information_to_make_an_anonymous_donation(step): - world.browser.select('country_code', 'IE') - world.browser.fill('first_name', 'Akvo') - world.browser.fill('last_name', 'Test') - world.browser.fill('expdate_month', world.PAYPAL_TEST_VISA_EXP_MONTH) - world.browser.fill('expdate_year', world.PAYPAL_TEST_VISA_EXP_YEAR) - world.browser.fill('address1', '180 Akvo central') - world.browser.fill('city', 'Amsterdam') - - -@step(u'Then I see that the invoice is present and is in the "([^"]*)" state') -def then_i_see_that_the_invoice_is_present_and_is_in_the_group1_state(step, group1): - world.browser.click_link_by_text('Invoices') - world.browser.find_link_by_text(world.paypal_invoice_number).first - - -@step(u'When I find the first project in € that has not yet received any donations') -def when_i_find_the_first_project_in_that_has_not_yet_received_any_donations(step): - project_table = world.browser.find_by_tag('tbody').first - project_rows = project_table.find_by_tag('tr') - count = 0 - while count < len(project_rows): - if 'Donate' in project_rows[count].text and u"€" in project_rows[count].text: - element = project_rows[count].find_by_css('a').last - - row_text = project_rows[count].text.split('\n') - - last_word = len(row_text)-1 - - percentage_raised = int(''.join([c for c in row_text[last_word-1] if c in '1234567890'])) - if percentage_raised == 0: - - world.percentage_raised_all_page = percentage_raised - world.total_budget_all_page = int(''.join([c for c in row_text[last_word-2] if c in '1234567890'])) - world.project_needing_euro_URL = '/'.join(element['href'].split('/')[:-2]) + '/' - print "project with 0 donations" + world.project_needing_euro_URL - break - count = count + 1 - - - world.browser.visit(world.project_needing_euro_URL) - - -@step(u'Then I see that the project appears as fully funded') -def then_i_see_that_the_project_appears_as_fully_funded(step): - element = world.browser.find_by_css('.green').first - assert element.text == 'Fully funded' - -@step(u'When I enter half the amount left to donate in the "([^"]*)" field') -def when_i_enter_half_the_amount_left_to_donate_in_the_group1_field(step, field_name): - input_value = (world.money_still_needed / 2) - world.browser.fill(field_name, input_value) - -@step(u'Then I see the half of the project funds listed against "([^"]*)" in the donors list') -def then_i_see_the_half_of_the_project_funds_listed_against_group1_in_the_donors_list(step, donor_name): - donation_amount = (world.money_still_needed / 2) - - element = world.browser.find_by_css('.project_budget_table').first - print element.text - - print "the amount I expect to see would be" - print donation_amount - print "This needs to be completed - does the donor only appear after the donation is confirmed?" - -@step(u'Then I see that the invoices are present and is in the "([^"]*)" state') -def then_i_see_that_the_invoices_are_present_and_is_in_the_group1_state(step, group1): - assert False, 'This step must be implemented' - -@step(u'Then I see "([^"]*)" listed against "([^"]*)" in the donors list') -def then_i_see_group1_listed_against_group2_in_the_donors_list(step, donation, donor_name): - - donations_table = world.browser.find_by_css('.project_budget_table').last - donation_found = 0 -# print donations_table.text - donation_rows = donations_table.find_by_tag('tr') - count = 0 - if donation == "the estimated project funds required including PayPal fees": - donation = world.fully_fund_with_fees_estimate - elif donation == "the first donation amount": - donation = world.first_donation - while count < len(donation_rows): -# print "the row under scrutiny is" -# print donation_rows[count].text - if donor_name in donation_rows[count].text and str(donation) in donation_rows[count].text: - donation_found = 1 - count = count + 1 -# print "the amount I expect to see would be" -# print donation -# print "against" -# print donor_name -# print "This needs to be completed - does the donor only appear after the donation is confirmed?" - if donation_found == 0: - assert False, 'The donation does not appear in the list of donations' - -#@step(u'When I note how many dollars have been raised and how much is still needed') -#def when_i_note_how_many_group1_have_been_raised_and_how_much_is_still_needed(step): -# element = world.browser.find_by_css('.fundingbox-table').first -# raised_text, still_needed_text = element.text.split('\n') -# total_budget_text = world.browser.find_by_css('.fundingbox-table').last.text - -# print "Original text: \n" + total_budget_text -# raised_text, still_needed_text = element.text.split('\n') -# print "Captured text: " + raised_text - -# world.money_raised = int(raised_text.split(u"$")[-1].strip().replace(",", "")) -# world.money_still_needed = int(still_needed_text.split(u"$")[-1].strip().replace(",", "")) -# world.total_budget = int(total_budget_text.split(u"$")[-1].strip().replace(",", "")) - -@step(u'When I take note of the amount that is suggested is needed to fully fund the project including PayPal fees') -def when_i_take_not_of_the_amount_that_is_suggested_is_needed_to_fully_fund_the_project_including_paypal_fees(step): - grey_elements = world.browser.find_by_css('.grey') - last_letter = len(grey_elements.first.text)-1 - world.fully_fund_with_fees_estimate = int(''.join([c for c in grey_elements.first.text if c in '1234567890'])) - - - - diff --git a/features/donations/donations.feature b/features/donations/donations.feature deleted file mode 100644 index af493ce46a..0000000000 --- a/features/donations/donations.feature +++ /dev/null @@ -1,244 +0,0 @@ -Feature: Project listing pages smoke testing - In order to check the basic functionality of the donations mechanism - As a smoke testing user - I want to confirm that I am able to make a donation and that it is recorded correctly - - Background: Navigate to the list of all projects from the home page - -# Scenario: I can create 8 € projects and 4 $ projects -# When I log in to RSR admin -# When I create and publish "1" uniquely named "euro" projects with a budget of "7000" -# When I create and publish "1" uniquely named "dollar" projects with a budget of "7000ß" -# Then I can log out of RSR admin - -# Scenario: (1) I can fully fund a € project with a single donation using PayPal, see the updated project total and see the amount donated displayed against the donor's name (complete) -# When I go to project listing page -# When I find the first "euro" project requiring the maximum allowed PayPal donation or less, which has not received any donations -# When I note how many "euros" have been raised and how much is still needed -# When I click on the "Donate" link -# When I click on the link with "paypal" in the URL for the project -# When I take note of the amount that is suggested is needed to fully fund the project including PayPal fees -# When I enter "the estimated amount including fees to fully fund the project" in the "amount" field -# When I enter "FullFunds Test" in the "name" field -# When I enter "test@akvo.org" in the "email" field -# When I enter "test@akvo.org" in the "email2" field -# When I click on the link with "donate_form" in the URL for the project -# When I click on the donate button -# When I enter the PayPal test username in the "login_email" field -# When I enter the PayPal test password in the "login_password" field -# When I click on the PayPal login button -# When I Click on the Continue button -# When I click on the Back to Akvos test store button -# When I click on the "Return to Project" link -# Then I see that the project appears as fully funded -# When I click on the link with "funding" in the URL for the project -# Then I see "the estimated project funds required including PayPal fees" listed against "FullFunds Test" in the donors list - -# Scenario: (2) I can fully fund a $ project with a single donation, see the updated project total and see the amount donated displayed against the donor's name (complete) -# When I go to project listing page -# When I find the first "dollar" project requiring the maximum allowed PayPal donation or less, which has not received any donations -# When I note how many "dollars" have been raised and how much is still needed -# When I click on the "Donate" link -# When I click on the link with "paypal" in the URL for the project -# When I take note of the amount that is suggested is needed to fully fund the project including PayPal fees -# When I enter "the estimated amount including fees to fully fund the project" in the "amount" field -# When I enter "FullFunds Test" in the "name" field -# When I enter "test@akvo.org" in the "email" field -# When I enter "test@akvo.org" in the "email2" field -# When I click on the link with "donate_form" in the URL for the project -# When I click on the donate button -# When I enter the PayPal test username in the "login_email" field -# When I enter the PayPal test password in the "login_password" field -# When I click on the PayPal login button -# When I Click on the Continue button -# When I click on the Back to Akvos test store button -# When I click on the "Return to Project" link -# Then I see that the project appears as fully funded -# When I click on the link with "funding" in the URL for the project -# Then I see "the estimated project funds required including PayPal fees" listed against "FullFunds Test" in the donors list - -# Scenario: (3) I can fully fund a € project with a single donation using iDeal, see the updated project total and see the amount donated displayed against the donor's name -# When I go to project listing page -# When I find the first "euro" project requiring the maximum allowed PayPal donation or less, which has not received any donations -# When I note how many "euros" have been raised and how much is still needed -# When I click on the "Donate" link -# When I click on the link with "paypal" in the URL for the project -# When I take note of the amount that is suggested is needed to fully fund the project including PayPal fees -# When I enter "the estimated amount including fees to fully fund the project" in the "amount" field -# When I enter "FullFunds Test" in the "name" field -# When I enter "test@akvo.org" in the "email" field -# When I enter "test@akvo.org" in the "email2" field -# When I click on the link with "donate_form" in the URL for the project -# When I click on the donate button -# When I enter the PayPal test username in the "login_email" field -# When I enter the PayPal test password in the "login_password" field -# When I click on the PayPal login button -# When I Click on the Continue button -# When I click on the Back to Akvos test store button -# When I click on the "Return to Project" link -# Then I see that the project appears as fully funded -# When I click on the link with "funding" in the URL for the project -# Then I see "the estimated project funds required including PayPal fees" listed against "FullFunds Test" in the donors list - -# Scenario: (4) I can fully fund a € project in two donations with PayPal, see the updated project total and see the amount donated displayed against the donors' names (complete) -# When I go to project listing page -# When I find the first "euro" project requiring the maximum allowed PayPal donation or less, which has not received any donations -# When I note how many "euros" have been raised and how much is still needed -# When I click on the "Donate" link -# When I click on the link with "paypal" in the URL for the project -# When I take note of the amount that is suggested is needed to fully fund the project including PayPal fees -# When I enter "half the estimated amount including fees left to donate" in the "amount" field -# When I enter "Akvo Test" in the "name" field -# When I enter "test@akvo.org" in the "email" field -# When I enter "test@akvo.org" in the "email2" field -# When I click on the link with "donate_form" in the URL for the project -# When I click on the donate button -# When I enter the PayPal test username in the "login_email" field -# When I enter the PayPal test password in the "login_password" field -# When I click on the PayPal login button -# When I Click on the Continue button -# When I click on the Back to Akvos test store button -# When I click on the "Return to Project" link -# When I click on the "Donate" link -# When I click on the link with "paypal" in the URL for the project -# When I take note of the amount that is suggested is needed to fully fund the project including PayPal fees -# When I enter "the estimated amount including fees to fully fund the project" in the "amount" field -# When I enter "Akvo Test2" in the "name" field -# When I enter "test@akvo.org" in the "email" field -# When I enter "test@akvo.org" in the "email2" field -# When I click on the link with "donate_form" in the URL for the project -# When I click on the donate button -# When I enter the PayPal test username in the "login_email" field -# When I enter the PayPal test password in the "login_password" field -# When I click on the PayPal login button -# When I Click on the Continue button -# When I click on the Back to Akvos test store button -# When I click on the "Return to Project" link -# Then I see that the project appears as fully funded -# When I click on the link with "funding" in the URL for the project -# Then I see "the first donation amount" listed against "Akvo Test" in the donors list -# Then I see "the estimated project funds required including PayPal fees" listed against "Akvo Test2" in the donors list - -# Scenario: (5) I can fully fund a $ project in two donations with PayPal, see the updated project total and see the amount donated displayed against he donors' names (complete) -# When I go to project listing page -# When I find the first "dollar" project requiring the maximum allowed PayPal donation or less, which has not received any donations -# When I note how many "dollars" have been raised and how much is still needed -# When I click on the "Donate" link -# When I click on the link with "paypal" in the URL for the project -# When I take note of the amount that is suggested is needed to fully fund the project including PayPal fees -# When I enter "half the estimated amount including fees left to donate" in the "amount" field -# When I enter "Akvo Test" in the "name" field -# When I enter "test@akvo.org" in the "email" field -# When I enter "test@akvo.org" in the "email2" field -# When I click on the link with "donate_form" in the URL for the project -# When I click on the donate button -# When I enter the PayPal test username in the "login_email" field -# When I enter the PayPal test password in the "login_password" field -# When I click on the PayPal login button -# When I Click on the Continue button -# When I click on the Back to Akvos test store button -# When I click on the "Return to Project" link -# When I click on the "Donate" link -# When I click on the link with "paypal" in the URL for the project -# When I take note of the amount that is suggested is needed to fully fund the project including PayPal fees -# When I enter "the estimated amount including fees to fully fund the project" in the "amount" field -# When I enter "Akvo Test2" in the "name" field -# When I enter "test@akvo.org" in the "email" field -# When I enter "test@akvo.org" in the "email2" field -# When I click on the link with "donate_form" in the URL for the project -# When I click on the donate button -# When I enter the PayPal test username in the "login_email" field -# When I enter the PayPal test password in the "login_password" field -# When I click on the PayPal login button -# When I Click on the Continue button -# When I click on the Back to Akvos test store button -# When I click on the "Return to Project" link -# Then I see that the project appears as fully funded -# When I click on the link with "funding" in the URL for the project -# Then I see "the first donation amount" listed against "Akvo Test" in the donors list -# Then I see "the estimated project funds required including PayPal fees" listed against "Akvo Test2" in the donors list - -# Scenario: (6) I can fully fund a € project in two donations with iDeal, see the updated project total and see the amount donated displayed against the donors' names -# When I go to project listing page -# When I find the first "euro" project requiring the maximum allowed PayPal donation or less, which has not received any donations -# When I note how many "euros" have been raised and how much is still needed -# When I click on the "Donate" link -# When I click on the link with "paypal" in the URL for the project -# When I take note of the amount that is suggested is needed to fully fund the project including PayPal fees -# When I enter "half the estimated amount including fees left to donate" in the "amount" field -# When I enter "Akvo Test" in the "name" field -# When I enter "test@akvo.org" in the "email" field -# When I enter "test@akvo.org" in the "email2" field -# When I click on the link with "donate_form" in the URL for the project -# When I click on the donate button -# When I enter the PayPal test username in the "login_email" field -# When I enter the PayPal test password in the "login_password" field -# When I click on the PayPal login button -# When I Click on the Continue button -# When I click on the Back to Akvos test store button -# When I click on the "Return to Project" link -# When I click on the "Donate" link -# When I click on the link with "paypal" in the URL for the project -# When I take note of the amount that is suggested is needed to fully fund the project including PayPal fees -# When I enter "the estimated amount including fees to fully fund the project" in the "amount" field -# When I enter "Akvo Test2" in the "name" field -# When I enter "test@akvo.org" in the "email" field -# When I enter "test@akvo.org" in the "email2" field -# When I click on the link with "donate_form" in the URL for the project -# When I click on the donate button -# When I enter the PayPal test username in the "login_email" field -# When I enter the PayPal test password in the "login_password" field -# When I click on the PayPal login button -# When I Click on the Continue button -# When I click on the Back to Akvos test store button -# When I click on the "Return to Project" link -# Then I see that the project appears as fully funded -# When I click on the link with "funding" in the URL for the project -# Then I see "the first donation amount" listed against "Akvo Test" in the donors list -# Then I see "the estimated project funds required including PayPal fees" listed against "Akvo Test2" in the donors list - -# Scenario: (7) I can see an appropriate error message when I attempt to overfund a € project using PayPal by more than 2% (complete) -# When I go to project listing page -# When I find the first project still to be funded in € -# When I note how many "euros" have been raised and how much is still needed -# When I click on the "Donate" link -# When I click on the link with "paypal" in the URL for the project -# When I take note of the amount that is suggested is needed to fully fund the project including PayPal fees -# When I enter "the full estimated amound including fees plus an additional one percent" in the "amount" field -# When I enter "Akvo Test" in the "name" field -# When I enter "test@akvo.org" in the "email" field -# When I enter "test@akvo.org" in the "email2" field -# When I click on the link with "donate_form" in the URL for the project -# Then I see this error message "You cannot donate more than the project actually needs!" - -# Scenario: (8) I can see an appropriate error message when I attempt to overfund a € project using PayPal by more than 2% (complete) -# When I go to project listing page -# When I find the first project still to be funded in "dollars" -# When I note how many "dollars" have been raised and how much is still needed -# When I click on the "Donate" link -# When I click on the link with "paypal" in the URL for the project -# When I take note of the amount that is suggested is needed to fully fund the project including PayPal fees -# When I enter "the full estimated amound including fees plus an additional one percent" in the "amount" field -# When I enter "Akvo Test" in the "name" field -# When I enter "test@akvo.org" in the "email" field -# When I enter "test@akvo.org" in the "email2" field -# When I click on the link with "donate_form" in the URL for the project -# Then I see this error message "You cannot donate more than the project actually needs!" - -# Scenario: (9) I can see an appropriate error message when I attempt to overfund a € project using iDeal by more than 2% -# When I go to project listing page -# When I find the first project still to be funded in "dollars" -# When I note how many "dollars" have been raised and how much is still needed -# When I click on the "Donate" link -# When I click on the link with "paypal" in the URL for the project -# When I take note of the amount that is suggested is needed to fully fund the project including PayPal fees -# When I enter "the full estimated amound including fees plus an additional one percent" in the "amount" field -# When I enter "Akvo Test" in the "name" field -# When I enter "test@akvo.org" in the "email" field -# When I enter "test@akvo.org" in the "email2" field -# When I click on the link with "donate_form" in the URL for the project -# Then I see this error message "You cannot donate more than the project actually needs!" - -# Scenario: (10) I can successfully overfund a € project using PayPal by 1% and see the amount by which the project is overfunded on the project page -# Scenario: (11) I can successfully overfund a $ project using PayPal by 1% and see the amount by which the project is overfunded on the project page -# Scenario: (12) I can successfully overfund a € project using iDeal by 1% and see the amount by which the project is overfunded on the project page diff --git a/features/donations/github_issue_142/__init__.py b/features/donations/github_issue_142/__init__.py deleted file mode 100644 index c289bac7e9..0000000000 --- a/features/donations/github_issue_142/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- - -# Akvo RSR is covered by the GNU Affero General Public License. -# See more details in the license.txt file located at the root folder of the Akvo RSR module. -# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. - -# Initialiser for the RSR smoke_tests module. diff --git a/features/donations/github_issue_142/donation_steps.py b/features/donations/github_issue_142/donation_steps.py deleted file mode 100644 index b2fa740a02..0000000000 --- a/features/donations/github_issue_142/donation_steps.py +++ /dev/null @@ -1,428 +0,0 @@ -# -*- coding: utf-8 -*- - -from lettuce import step, world, before -from time import sleep, time - -from admin.auth import * -from donations.auth import * -from donations.config.mollie import * -from donations.config.paypal import * - -@before.each_feature -def log_in_to_paypal_test_environment(feature): -## '''Figure out the URL to the project''' -## world.browser.visit('http://%s' % world.SITE_UNDER_TEST) -## element = world.browser.find_link_by_partial_href('donate').first -## world.project_URL = '/'.join(element['href'].split('/')[:-2]) + '/' - '''Log in to paypal to ensure the environment is active''' - world.browser.visit('https://www.paypal.com/') - world.browser.fill('login_email', world.PAYPAL_MASTER_USER) - world.browser.fill('login_password', world.PAYPAL_MASTER_PASSWORD) - world.browser.find_by_name('submit.x').first.click() - sleep(10) - world.browser.visit('https://developer.paypal.com/') - -# world.browser.check('cb_auto_login') -# world.browser.find_by_name('submit').first.click() - -#@before.each_scenario -#def navigate_to_homepage(scenario): -# world.browser.visit('http://%s/rsr/projects/' % world.SITE_UNDER_TEST) - -@step(u'When I go to the projects homepage') -def when_i_go_to_the_project_homepage(step): - world.browser.visit('http://%s/rsr/projects/' % world.SITE_UNDER_TEST) - -@step(u'When I create and publish "([^"]*)" uniquely named "([^"]*)" projects with a budget of "([^"]*)"') -def when_i_create_and_publish_group1_uniquely_named_group2_projects(step, num_of_projects, currency, project_budget): - count = 0 - while count < int(num_of_projects): - world.browser.click_link_by_text('Projects') - world.browser.click_link_by_partial_href('project/add/') - project_name = 'DonationTestProject' + str(time()) - world.browser.fill('title', project_name) - world.browser.fill('subtitle', 'This is a project created for donation tests') - world.browser.driver.find_element_by_xpath('//*[@id="id_status"]/option[2]').click() - world.browser.driver.find_element_by_xpath('//*[@id="id_categories"]/option[6]').click() - world.browser.fill('project_plan_summary', 'This is a project created for donation tests') - world.browser.fill('sustainability', 'This is a project created for donation tests') - if currency == 'euro': - world.browser.driver.find_element_by_xpath('//*[@id="id_currency"]/option[2]').click() - elif currency == 'dollar': - world.browser.driver.find_element_by_xpath('//*[@id="id_currency"]/option[1]').click() - world.browser.fill('goals_overview', 'This is a project created for donation tests') - world.browser.driver.find_element_by_xpath('//*[@id="id_budget_items-0-label"]/option[3]').click() - world.browser.fill('budget_items-0-amount', project_budget) - world.browser.driver.find_element_by_xpath('//*[@id="id_partnerships-0-partner_type"]/option[2]').click() - world.browser.find_by_name('_save').first.click() - world.browser.click_link_by_partial_href('admin/rsr/') - world.browser.click_link_by_partial_href('/rsr/admin/rsr/publishingstatus/') - world.browser.click_link_by_text(project_name) - world.browser.driver.find_element_by_xpath('//*[@id="id_status"]/option[2]').click() - world.browser.find_by_name('_save').first.click() - world.browser.click_link_by_partial_href('admin/rsr/') - count = count+1 - -@step(u'When I configure Mollie in RSR admin to ensure it is in test mode') -def when_i_configure_mollie_in_rsr_admin_to_ensure_it_is_in_test_mode(step): - world.browser.click_link_by_text('Mollie/iDEAL gateways') - world.browser.click_link_by_text('Default') - world.browser.fill('notification_email', world.MOLLIE_NOTIFICATION_EMAIL) - world.browser.fill('partner_id', world.MOLLIE_PARTNER_ID) - world.browser.find_by_name('_save').first.click() - -@step(u'When I log out of RSR admin') -def then_i_can_log_out_of_rsr_admin(step): - world.browser.click_link_by_partial_href('admin/logout/') - -@step(u'When I go to project listing page') -def when_i_go_to_project_listing_page(step): - world.browser.find_link_by_href('href="/rsr/projects/all/"') - -@step(u'When I select "([^"]*)" from the select your bank drop down') -def when_i_select_group1_from_the_select_your_bank_drop_down(step, group1): - world.browser.find_by_xpath('//*[@id="id_bank"]/option[11]').first.click() - -@step(u'When I find the first project still to be funded in "([^"]*)"') -def when_i_find_the_first_project_still_to_be_funded_in(step, currency): - if currency == "dollars": - currency_symbol = u"$" - elif currency == "euros": - currency_symbol = u"€" - - project_table = world.browser.find_by_tag('tbody').first - project_rows = project_table.find_by_tag('tr') - count = 0 - while count < len(project_rows): - if 'Donate' in project_rows[count].text and currency_symbol in project_rows[count].text: - element = project_rows[count].find_by_css('a').last - if currency == "dollars": - world.project_needing_dollars_URL = '/'.join(element['href'].split('/')[:-2]) + '/' - elif currency == "euros": - world.project_needing_euro_URL = '/'.join(element['href'].split('/')[:-2]) + '/' - break - count = count + 1 - - row_text = project_rows[count].text.split('\n') - - last_word = len(row_text)-1 - - world.percentage_raised_all_page = int(''.join([c for c in row_text[last_word-1] if c in '1234567890'])) - world.total_budget_all_page = int(''.join([c for c in row_text[last_word-2] if c in '1234567890'])) - if currency == "dollars": - world.browser.visit(world.project_needing_dollars_URL) - elif currency == "euros": - world.browser.visit(world.project_needing_euro_URL) - -@step(u'When I find the first "([^"]*)" project requiring the maximum allowed PayPal donation or less, which has not received any donations') -def when_i_find_the_first_group1_project_requiring_the_maximum_allowed_paypal_donation_or_less_which_has_not_received_any_donations(step, currency): - if currency == "euro": - currency_symbol = u"€" - elif currency == "dollar": - currency_symbol = u"$" - project_table = world.browser.find_by_tag('tbody').first - project_rows = project_table.find_by_tag('tr') - count = 0 - while count < len(project_rows): - if 'Donate' in project_rows[count].text and currency_symbol in project_rows[count].text and '0 %' in project_rows[count].text: - element = project_rows[count].find_by_css('a').last - world.project_needing_funding_URL = '/'.join(element['href'].split('/')[:-2]) + '/' - row_text = project_rows[count].text.split('\n') - last_word = len(row_text)-1 - world.total_budget_all_page = int(''.join([c for c in row_text[last_word-2] if c in '1234567890'])) - if world.total_budget_all_page <= int(world.PAYPAL_MAX_DONATION_AMOUNT): - world.percentage_raised_all_page = int(''.join([c for c in row_text[last_word-1] if c in '1234567890'])) - break - count = count + 1 - world.browser.visit(world.project_needing_funding_URL) - -@step(u'When I note how many "([^"]*)" have been raised and how much is still needed') -def when_i_note_how_many_group1_have_been_raised_and_how_much_is_still_needed(step, currency): - if currency == "euros": - currency_symbol = u"€" - elif currency == "dollars": - currency_symbol = u"$" - element = world.browser.find_by_css('.fundingbox-table').first - raised_text, still_needed_text = element.text.split('\n') - total_budget_text = world.browser.find_by_css('.fundingbox-table').last.text - - #print "Original text: \n" + total_budget_text - #raised_text, still_needed_text = element.text.split('\n') - #print "Captured text: " + raised_text - - world.money_raised = int(raised_text.split(currency_symbol)[-1].strip().replace(",", "")) - world.money_still_needed = int(still_needed_text.split(currency_symbol)[-1].strip().replace(",", "")) - world.total_budget = int(total_budget_text.split(currency_symbol)[-1].strip().replace(",", "")) - #print world.total_budget - -@step(u'Then these amounts should agree with those on the project listing page') -def then_these_amounts_should_agree_with_those_on_the_project_listing_page(step): - assert world.total_budget_all_page == world.total_budget - assert (world.total_budget - world.money_raised) == world.money_still_needed - assert world.percentage_raised_all_page == world.money_raised * 100 / world.total_budget - -@step(u'When I click on the "([^"]*)" link') -def when_i_click_on_the_group1_link(step, link_name): - #world.browser.driver.execute_script('window.onbeforeunload = function() {}') - world.browser.click_link_by_text(link_name) - -@step(u'When I click on the link with "([^"]*)" in the URL for the project') -def when_i_click_on_the_link_with_group1_in_the_url_for_the_project(step, link_name): - world.browser.click_link_by_partial_href(link_name) - -@step(u'When I enter "([^"]*)" in the "([^"]*)" field') -def when_i_enter_group1_in_the_group2_field(step, input_value, field_name): - value = input_value - if input_value == "the estimated amount including fees to fully fund the project": - value = world.fully_fund_with_fees_estimate - elif input_value == "half the estimated amount including fees left to donate": - value = world.fully_fund_with_fees_estimate / 2 - world.first_donation = value - elif input_value == "the full estimated amount including fees plus an additional three percent": - value = int(float(world.fully_fund_with_fees_estimate)*1.03) - world.browser.fill(field_name, value) - -@step(u'When I enter the full budget required for the project in the "([^"]*)" field') -def when_i_enter_the_full_budget_required_for_the_project_in_the_group1_field(step, field_name): - world.browser.fill(field_name, world.total_budget_all_page) - -@step(u'When I click on the donate button') -def when_i_click_on_the_donate_button(step): - world.browser.find_by_name('submit').first.click() - -@step(u'When I enter the PayPal test username in the "([^"]*)" field') -def when_i_enter_the_paypal_test_username_in_the_group1_field(step, field_name): - world.browser.fill(field_name, world.PAYPAL_TEST_USER) - -@step(u'When I enter the PayPal test password in the "([^"]*)" field') -def when_i_enter_the_paypal_test_password_in_the_group1_field(step, field_name): - world.browser.fill(field_name, world.PAYPAL_TEST_USER_PASSWORD) - -@step(u'When I click on the PayPal login button') -def when_i_click_on_the_donate_button(step): - world.browser.find_by_name('login.x').first.click() - -@step(u'When I Click on the Continue button') -def when_i_click_on_the_continue_button_continue_x(step): - world.browser.find_by_name('continue.x').first.click() - -@step(u'When I click on the Back to Akvos test store button') -def when_i_click_on_the_back_to_akvo_s_test_store_button_merchant_return_link(step): - world.browser.find_by_name('merchant_return_link').first.click() - alert = world.browser.get_alert() - alert.accept() - #world.browser.visit(world.project_URL) - -@step(u'When I note the new values of how much has been raised and how much is still needed') -def when_i_note_how_much_has_been_raised_and_how_much_is_still_needed(step): - element = world.browser.find_by_css('.fundingbox-table').first - raised_text, still_needed_text = element.text.split('\n') - world.new_money_raised = int(raised_text.split(u"€")[-1].strip().replace(",", "")) - world.new_money_still_needed = int(still_needed_text.split(u"€")[-1].strip().replace(",", "")) - -@step(u'Then I see that the amount raised has been incremented by "([^"]*)" and the amount left to raise decremented by the same amount') -def then_i_see_that_the_amount_raised_has_been_incremented_by_group1_and_the_amount_left_to_raise_decremented_by_the_same_amount(step, amount): - assert world.new_money_raised == (world.money_raised + int(amount)) - assert world.new_money_still_needed == (world.money_still_needed - int(amount)) - -@step(u'Then I see this error message "([^"]*)"') -def then_i_see_this_error_message_group1(step, expected_error): - element = world.browser.find_by_css('.errorlist').first - errortext = element.find_by_tag('li').first.text - assert errortext == expected_error - -@step(u'When I enter more funds than are needed in the "([^"]*)" field') -def when_i_enter_more_funds_than_are_needed_in_the_group1_field(step, field_name): - input_value = (world.money_still_needed * 2) - world.browser.fill(field_name, input_value) - -@step(u'When I enter the remaining amount needed in the "([^"]*)" field') -def when_i_enter_the_remaining_amount_needed_in_the_group1_field(step, field_name): - input_value = world.money_still_needed - world.browser.fill(field_name, input_value) - -@step(u'Then I see that the amount raised and the amount left to raise are unchanged') -def then_i_see_that_the_amount_raised_and_the_amount_left_to_raise_are_unchanged(step): - assert world.new_money_raised == world.money_raised - assert world.new_money_still_needed == world.money_still_needed - -@step(u'When I return to the euro project requiring funding') -def when_i_return_to_the_euro_project_requiring_funding(step): - world.browser.visit(world.project_needing_euro_URL) - -@step(u'When I wait "([^"]*)" minutes') -def when_i_wait_group1_minutes(step, minutes): - wait_seconds = float(minutes) * 60 - sleep(wait_seconds) - -@step(u'When I wait "([^"]*)" seconds') -def when_i_wait_group1_minutes(step, seconds): - sleep(float(seconds)) - -@step(u'When I take note of the invoice number') -def when_i_take_note_of_the_invoice_number(step): - world.paypal_invoice_number = world.browser.find_by_css('.donate_details_right').first.text - -@step(u'When I log in to RSR admin') -def when_i_log_in_to_rsr_admin(step): - world.browser.find_link_by_text('Akvo RSR login').first.click() - world.browser.fill('username', world.AKVO_ADMIN_USER) - world.browser.fill('password', world.AKVO_ADMIN_PASSWORD) - world.browser.find_by_xpath('//*[@id="login-form"]/div[4]/input').first.click() - -@step(u'Then I see the error message "([^"]*)" each time I leave one of the fields blank') -def then_i_see_the_error_message_group1_each_time_i_leave_one_of_the_fields_blank(step, expected_error): - world.browser.fill('name', 'Akvo Test') - world.browser.fill('email', 'test@akvo.org') - world.browser.fill('email2', 'test@akvo.org') - world.browser.click_link_by_partial_href('donate_form') - world.browser.click_link_by_partial_href('donate_form') - element = world.browser.find_by_css('.errorlist').first - errortext = element.find_by_tag('li').first.text - assert errortext == expected_error - - world.browser.fill('amount', '10') - world.browser.fill('name', '') - world.browser.fill('email', 'test@akvo.org') - world.browser.fill('email2', 'test@akvo.org') - world.browser.click_link_by_partial_href('donate_form') - element = world.browser.find_by_css('.errorlist').first - errortext = element.find_by_tag('li').first.text - assert errortext == expected_error - - world.browser.fill('amount', '10') - world.browser.fill('name', 'Akvo Test') - world.browser.fill('email', '') - world.browser.fill('email2', 'test@akvo.org') - world.browser.click_link_by_partial_href('donate_form') - element = world.browser.find_by_css('.errorlist').first - errortext = element.find_by_tag('li').first.text - assert errortext == expected_error - - world.browser.fill('amount', '10') - world.browser.fill('name', 'Akvo Test') - world.browser.fill('email', 'test@akvo.org') - world.browser.fill('email2', '') - world.browser.click_link_by_partial_href('donate_form') - element = world.browser.find_by_css('.errorlist').first - errortext = element.find_by_tag('li').first.text - assert errortext == expected_error - -@step(u'When I enter the information to make an anonymous donation') -def when_i_enter_the_information_to_make_an_anonymous_donation(step): - world.browser.select('country_code', 'IE') - world.browser.fill('first_name', 'Akvo') - world.browser.fill('last_name', 'Test') - world.browser.fill('expdate_month', world.PAYPAL_TEST_VISA_EXP_MONTH) - world.browser.fill('expdate_year', world.PAYPAL_TEST_VISA_EXP_YEAR) - world.browser.fill('address1', '180 Akvo central') - world.browser.fill('city', 'Amsterdam') - - -@step(u'Then I see that the invoice is present and is in the "([^"]*)" state') -def then_i_see_that_the_invoice_is_present_and_is_in_the_group1_state(step, group1): - world.browser.click_link_by_text('Invoices') - world.browser.find_link_by_text(world.paypal_invoice_number).first - - -@step(u'When I find the first project in € that has not yet received any donations') -def when_i_find_the_first_project_in_that_has_not_yet_received_any_donations(step): - project_table = world.browser.find_by_tag('tbody').first - project_rows = project_table.find_by_tag('tr') - count = 0 - while count < len(project_rows): - if 'Donate' in project_rows[count].text and u"€" in project_rows[count].text: - element = project_rows[count].find_by_css('a').last - - row_text = project_rows[count].text.split('\n') - - last_word = len(row_text)-1 - - percentage_raised = int(''.join([c for c in row_text[last_word-1] if c in '1234567890'])) - if percentage_raised == 0: - - world.percentage_raised_all_page = percentage_raised - world.total_budget_all_page = int(''.join([c for c in row_text[last_word-2] if c in '1234567890'])) - world.project_needing_euro_URL = '/'.join(element['href'].split('/')[:-2]) + '/' - print "project with 0 donations" + world.project_needing_euro_URL - break - count = count + 1 - - - world.browser.visit(world.project_needing_euro_URL) - - -@step(u'Then I see that the project appears as fully funded') -def then_i_see_that_the_project_appears_as_fully_funded(step): - element = world.browser.find_by_css('.green').first - assert element.text == 'Fully funded' - -@step(u'When I enter half the amount left to donate in the "([^"]*)" field') -def when_i_enter_half_the_amount_left_to_donate_in_the_group1_field(step, field_name): - input_value = (world.money_still_needed / 2) - world.browser.fill(field_name, input_value) - -@step(u'Then I see the half of the project funds listed against "([^"]*)" in the donors list') -def then_i_see_the_half_of_the_project_funds_listed_against_group1_in_the_donors_list(step, donor_name): - donation_amount = (world.money_still_needed / 2) - - element = world.browser.find_by_css('.project_budget_table').first - print element.text - - print "the amount I expect to see would be" - print donation_amount - print "This needs to be completed - does the donor only appear after the donation is confirmed?" - -@step(u'Then I see that the invoices are present and is in the "([^"]*)" state') -def then_i_see_that_the_invoices_are_present_and_is_in_the_group1_state(step, group1): - assert False, 'This step must be implemented' - -@step(u'Then I see "([^"]*)" listed against "([^"]*)" in the donors list') -def then_i_see_group1_listed_against_group2_in_the_donors_list(step, donation, donor_name): - - donations_table = world.browser.find_by_css('.project_budget_table').last - donation_found = 0 -# print donations_table.text - donation_rows = donations_table.find_by_tag('tr') - count = 0 - if donation == "the estimated project funds required including PayPal fees": - donation = world.fully_fund_with_fees_estimate - elif donation == "the first donation amount": - donation = world.first_donation - while count < len(donation_rows): -# print "the row under scrutiny is" -# print donation_rows[count].text - if donor_name in donation_rows[count].text and str(donation) in donation_rows[count].text: - donation_found = 1 - count = count + 1 -# print "the amount I expect to see would be" -# print donation -# print "against" -# print donor_name -# print "This needs to be completed - does the donor only appear after the donation is confirmed?" - if donation_found == 0: - assert False, 'The donation does not appear in the list of donations' - -#@step(u'When I note how many dollars have been raised and how much is still needed') -#def when_i_note_how_many_group1_have_been_raised_and_how_much_is_still_needed(step): -# element = world.browser.find_by_css('.fundingbox-table').first -# raised_text, still_needed_text = element.text.split('\n') -# total_budget_text = world.browser.find_by_css('.fundingbox-table').last.text - -# print "Original text: \n" + total_budget_text -# raised_text, still_needed_text = element.text.split('\n') -# print "Captured text: " + raised_text - -# world.money_raised = int(raised_text.split(u"$")[-1].strip().replace(",", "")) -# world.money_still_needed = int(still_needed_text.split(u"$")[-1].strip().replace(",", "")) -# world.total_budget = int(total_budget_text.split(u"$")[-1].strip().replace(",", "")) - -@step(u'When I take note of the amount that is suggested is needed to fully fund the project including fees') -def when_i_take_not_of_the_amount_that_is_suggested_is_needed_to_fully_fund_the_project_including_paypal_fees(step): - grey_elements = world.browser.find_by_css('.grey') - last_letter = len(grey_elements.first.text)-1 - world.fully_fund_with_fees_estimate = int(''.join([c for c in grey_elements.first.text if c in '1234567890'])) - - - - diff --git a/features/donations/github_issue_142/donations.feature b/features/donations/github_issue_142/donations.feature deleted file mode 100644 index ba7a964581..0000000000 --- a/features/donations/github_issue_142/donations.feature +++ /dev/null @@ -1,320 +0,0 @@ -Feature: Project listing pages smoke testing - In order to check the basic functionality of the donations mechanism - As a smoke testing user - I want to confirm that I am able to make a donation and that it is recorded correctly - -# Scenario: I can create 8 € projects and 4 $ projects -# When I log in to RSR admin -# When I create and publish "8" uniquely named "euro" projects with a budget of "7000" -# When I create and publish "4" uniquely named "dollar" projects with a budget of "7000" -# Then I can log out of RSR admin - - Scenario: I can fully fund a € project with a single donation using PayPal, see the updated project total and see the amount donated displayed against the donor's name - When I go to the projects homepage - When I log in to RSR admin - When I create and publish "1" uniquely named "euro" projects with a budget of "7000" - When I log out of RSR admin - When I go to the projects homepage - When I go to project listing page - When I find the first "euro" project requiring the maximum allowed PayPal donation or less, which has not received any donations - When I note how many "euros" have been raised and how much is still needed - When I click on the "Donate" link - When I click on the link with "paypal" in the URL for the project - When I take note of the amount that is suggested is needed to fully fund the project including fees - When I enter "8000" in the "amount" field - When I enter "the estimated amount including fees to fully fund the project" in the "amount" field - When I enter "FullFunds Test" in the "name" field - When I enter "test@akvo.org" in the "email" field - When I enter "test@akvo.org" in the "email2" field - When I click on the link with "donate_form" in the URL for the project - When I click on the donate button - When I enter the PayPal test username in the "login_email" field - When I enter the PayPal test password in the "login_password" field - When I click on the PayPal login button - When I Click on the Continue button - When I click on the Back to Akvos test store button - When I click on the "Return to Project" link - Then I see that the project appears as fully funded - When I click on the link with "funding" in the URL for the project - Then I see "the estimated project funds required including PayPal fees" listed against "FullFunds Test" in the donors list - - Scenario: I can fully fund a $ project with a single donation using PayPal, see the updated project total and see the amount donated displayed against the donor's name - When I go to the projects homepage - When I log in to RSR admin - When I create and publish "1" uniquely named "dollar" projects with a budget of "7000" - When I log out of RSR admin - When I go to the projects homepage - When I go to project listing page - When I find the first "dollar" project requiring the maximum allowed PayPal donation or less, which has not received any donations - When I note how many "dollars" have been raised and how much is still needed - When I click on the "Donate" link - When I click on the link with "paypal" in the URL for the project - When I take note of the amount that is suggested is needed to fully fund the project including fees - When I enter "the estimated amount including fees to fully fund the project" in the "amount" field - When I enter "FullFunds Test" in the "name" field - When I enter "test@akvo.org" in the "email" field - When I enter "test@akvo.org" in the "email2" field - When I click on the link with "donate_form" in the URL for the project - When I click on the donate button - When I enter the PayPal test username in the "login_email" field - When I enter the PayPal test password in the "login_password" field - When I click on the PayPal login button - When I Click on the Continue button - When I click on the Back to Akvos test store button - When I click on the "Return to Project" link - Then I see that the project appears as fully funded - When I click on the link with "funding" in the URL for the project - Then I see "the estimated project funds required including PayPal fees" listed against "FullFunds Test" in the donors list - - Scenario: I can fully fund a € project with a single donation using iDeal, see the updated project total and see the amount donated displayed against the donor's name - When I go to the projects homepage - When I log in to RSR admin - When I create and publish "1" uniquely named "euro" projects with a budget of "10000" - When I log out of RSR admin - When I go to the projects homepage - When I log in to RSR admin - When I configure Mollie in RSR admin to ensure it is in test mode - When I log out of RSR admin - When I go to the projects homepage - When I go to project listing page - When I find the first project still to be funded in "euros" - When I note how many "euros" have been raised and how much is still needed - When I click on the "Donate" link - When I click on the link with "ideal" in the URL for the project - When I take note of the amount that is suggested is needed to fully fund the project including fees - When I enter "the estimated amount including fees to fully fund the project" in the "amount" field - When I enter "FullFunds MollieTest" in the "name" field - When I enter "test@akvo.org" in the "email" field - When I enter "test@akvo.org" in the "email2" field - When I select "TBM Bank (Test Bank)" from the select your bank drop down - When I click on the link with "donate_form" in the URL for the project - When I click on the link with "mollie" in the URL for the project - When I click on the link with "true" in the URL for the project - When I wait "10" seconds - When I click on the "Return to Project" link - Then I see that the project appears as fully funded - When I click on the link with "funding" in the URL for the project - Then I see "the estimated project funds required including PayPal fees" listed against "FullFunds MollieTest" in the donors list - - Scenario: I can fully fund a € project in two donations using PayPal, see the updated project total and see the amount donated displayed against the donors' names - When I go to the projects homepage - When I log in to RSR admin - When I create and publish "1" uniquely named "euro" projects with a budget of "14000" - When I log out of RSR admin - When I go to the projects homepage - When I go to project listing page - When I find the first project still to be funded in "euros" - When I note how many "euros" have been raised and how much is still needed - When I click on the "Donate" link - When I click on the link with "paypal" in the URL for the project - When I take note of the amount that is suggested is needed to fully fund the project including fees - When I enter "half the estimated amount including fees left to donate" in the "amount" field - When I enter "Akvo Test" in the "name" field - When I enter "test@akvo.org" in the "email" field - When I enter "test@akvo.org" in the "email2" field - When I click on the link with "donate_form" in the URL for the project - When I click on the donate button - When I enter the PayPal test username in the "login_email" field - When I enter the PayPal test password in the "login_password" field - When I click on the PayPal login button - When I Click on the Continue button - When I click on the Back to Akvos test store button - When I click on the "Return to Project" link - When I click on the "Donate" link - When I click on the link with "paypal" in the URL for the project - When I take note of the amount that is suggested is needed to fully fund the project including fees - When I enter "the estimated amount including fees to fully fund the project" in the "amount" field - When I enter "Akvo Test2" in the "name" field - When I enter "test@akvo.org" in the "email" field - When I enter "test@akvo.org" in the "email2" field - When I click on the link with "donate_form" in the URL for the project - When I click on the donate button - When I enter the PayPal test username in the "login_email" field - When I enter the PayPal test password in the "login_password" field - When I click on the PayPal login button - When I Click on the Continue button - When I click on the Back to Akvos test store button - When I click on the "Return to Project" link - Then I see that the project appears as fully funded - When I click on the link with "funding" in the URL for the project - Then I see "the first donation amount" listed against "Akvo Test" in the donors list - Then I see "the estimated project funds required including PayPal fees" listed against "Akvo Test2" in the donors list - - Scenario: I can fully fund a $ project in two donations using PayPal, see the updated project total and see the amount donated displayed against he donors' names (complete) - When I go to the projects homepage - When I log in to RSR admin - When I create and publish "1" uniquely named "dollar" projects with a budget of "14000" - When I log out of RSR admin - When I go to the projects homepage - When I go to project listing page - When I find the first project still to be funded in "dollars" - When I note how many "dollars" have been raised and how much is still needed - When I click on the "Donate" link - When I click on the link with "paypal" in the URL for the project - When I take note of the amount that is suggested is needed to fully fund the project including fees - When I enter "half the estimated amount including fees left to donate" in the "amount" field - When I enter "Akvo Test" in the "name" field - When I enter "test@akvo.org" in the "email" field - When I enter "test@akvo.org" in the "email2" field - When I click on the link with "donate_form" in the URL for the project - When I click on the donate button - When I enter the PayPal test username in the "login_email" field - When I enter the PayPal test password in the "login_password" field - When I click on the PayPal login button - When I Click on the Continue button - When I click on the Back to Akvos test store button - When I click on the "Return to Project" link - When I click on the "Donate" link - When I click on the link with "paypal" in the URL for the project - When I take note of the amount that is suggested is needed to fully fund the project including fees - When I enter "the estimated amount including fees to fully fund the project" in the "amount" field - When I enter "Akvo Test2" in the "name" field - When I enter "test@akvo.org" in the "email" field - When I enter "test@akvo.org" in the "email2" field - When I click on the link with "donate_form" in the URL for the project - When I click on the donate button - When I enter the PayPal test username in the "login_email" field - When I enter the PayPal test password in the "login_password" field - When I click on the PayPal login button - When I Click on the Continue button - When I click on the Back to Akvos test store button - When I click on the "Return to Project" link - Then I see that the project appears as fully funded - When I click on the link with "funding" in the URL for the project - Then I see "the first donation amount" listed against "Akvo Test" in the donors list - Then I see "the estimated project funds required including PayPal fees" listed against "Akvo Test2" in the donors list - - Scenario: I can fully fund a € project in two donations using iDeal, see the updated project total and see the amount donated displayed against the donors' names - When I go to the projects homepage - When I log in to RSR admin - When I create and publish "1" uniquely named "euro" projects with a budget of "14000" - When I log out of RSR admin - When I go to the projects homepage - When I log in to RSR admin - When I configure Mollie in RSR admin to ensure it is in test mode - When I log out of RSR admin - When I go to the projects homepage - When I go to project listing page - When I find the first project still to be funded in "euros" - When I note how many "euros" have been raised and how much is still needed - When I click on the "Donate" link - When I click on the link with "ideal" in the URL for the project - When I take note of the amount that is suggested is needed to fully fund the project including fees - When I enter "half the estimated amount including fees left to donate" in the "amount" field - When I enter "FirstDoation MollieTest" in the "name" field - When I enter "test@akvo.org" in the "email" field - When I enter "test@akvo.org" in the "email2" field - When I select "TBM Bank (Test Bank)" from the select your bank drop down - When I click on the link with "donate_form" in the URL for the project - When I click on the link with "mollie" in the URL for the project - When I click on the link with "true" in the URL for the project - When I wait "10" seconds - When I click on the "Return to Project" link - When I click on the "Donate" link - When I click on the link with "ideal" in the URL for the project - When I take note of the amount that is suggested is needed to fully fund the project including fees - When I enter "the estimated amount including fees to fully fund the project" in the "amount" field - When I enter "SecondDonation MollieTest" in the "name" field - When I enter "test@akvo.org" in the "email" field - When I enter "test@akvo.org" in the "email2" field - When I select "TBM Bank (Test Bank)" from the select your bank drop down - When I click on the link with "donate_form" in the URL for the project - When I click on the link with "mollie" in the URL for the project - When I click on the link with "true" in the URL for the project - When I wait "10" seconds - When I click on the "Return to Project" link - Then I see that the project appears as fully funded - When I click on the link with "funding" in the URL for the project - Then I see "the first donation amount" listed against "FirstDoation MollieTest" in the donors list - Then I see "the estimated project funds required including PayPal fees" listed against "SecondDonation MollieTest" in the donors list - - Scenario: I can see an appropriate error message when I attempt to overfund a € project including estimated fees using PayPal - When I go to the projects homepage - When I log in to RSR admin - When I create and publish "1" uniquely named "euro" projects with a budget of "7000" - When I log out of RSR admin - When I go to the projects homepage - When I go to project listing page - When I find the first project still to be funded in "euros" - When I note how many "euros" have been raised and how much is still needed - When I click on the "Donate" link - When I click on the link with "paypal" in the URL for the project - When I take note of the amount that is suggested is needed to fully fund the project including fees - When I enter "the full estimated amount including fees plus an additional three percent" in the "amount" field - When I enter "Akvo Test" in the "name" field - When I enter "test@akvo.org" in the "email" field - When I enter "test@akvo.org" in the "email2" field - When I click on the link with "donate_form" in the URL for the project - Then I see this error message "You cannot donate more than the project actually needs!" - - Scenario: I can see an appropriate error message when I attempt to overfund a $ project including estimated fees using PayPal - When I go to the projects homepage - When I log in to RSR admin - When I create and publish "1" uniquely named "dollar" projects with a budget of "7000" - When I log out of RSR admin - When I go to the projects homepage - When I go to project listing page - When I find the first project still to be funded in "dollars" - When I note how many "dollars" have been raised and how much is still needed - When I click on the "Donate" link - When I click on the link with "paypal" in the URL for the project - When I take note of the amount that is suggested is needed to fully fund the project including fees - When I enter "the full estimated amount including fees plus an additional three percent" in the "amount" field - When I enter "Akvo Test" in the "name" field - When I enter "test@akvo.org" in the "email" field - When I enter "test@akvo.org" in the "email2" field - When I click on the link with "donate_form" in the URL for the project - Then I see this error message "You cannot donate more than the project actually needs!" - - Scenario: I can see an appropriate error message when I attempt to overfund a € project including estimated fees using iDeal - When I go to the projects homepage - When I log in to RSR admin - When I create and publish "1" uniquely named "euro" projects with a budget of "7000" - When I log out of RSR admin - When I go to the projects homepage - When I log in to RSR admin - When I configure Mollie in RSR admin to ensure it is in test mode - When I log out of RSR admin - When I go to the projects homepage - When I go to project listing page - When I find the first project still to be funded in "euros" - When I note how many "euros" have been raised and how much is still needed - When I click on the "Donate" link - When I click on the link with "ideal" in the URL for the project - When I take note of the amount that is suggested is needed to fully fund the project including fees - When I enter "the full estimated amount including fees plus an additional three percent" in the "amount" field - When I enter "Akvo Test" in the "name" field - When I enter "test@akvo.org" in the "email" field - When I enter "test@akvo.org" in the "email2" field - When I click on the link with "donate_form" in the URL for the project - Then I see this error message "You cannot donate more than the project actually needs!" - - Scenario: I can fully fund a €1M project with a single donation using iDeal, see the updated project total and see the amount donated displayed against the donor's name - When I go to the projects homepage - When I log in to RSR admin - When I create and publish "1" uniquely named "euro" projects with a budget of "1000000" - When I log out of RSR admin - When I go to the projects homepage - When I log in to RSR admin - When I configure Mollie in RSR admin to ensure it is in test mode - When I log out of RSR admin - When I go to the projects homepage - When I go to project listing page - When I find the first project still to be funded in "euros" - When I note how many "euros" have been raised and how much is still needed - When I click on the "Donate" link - When I click on the link with "ideal" in the URL for the project - When I take note of the amount that is suggested is needed to fully fund the project including fees - When I enter "the estimated amount including fees to fully fund the project" in the "amount" field - When I enter "FullFunds MollieTest" in the "name" field - When I enter "test@akvo.org" in the "email" field - When I enter "test@akvo.org" in the "email2" field - When I select "TBM Bank (Test Bank)" from the select your bank drop down - When I click on the link with "donate_form" in the URL for the project - When I click on the link with "mollie" in the URL for the project - When I click on the link with "true" in the URL for the project - When I wait "10" seconds - When I click on the "Return to Project" link - Then I see that the project appears as fully funded - When I click on the link with "funding" in the URL for the project - Then I see "the estimated project funds required including PayPal fees" listed against "FullFunds MollieTest" in the donors list diff --git a/features/organisation/__init__.py b/features/organisation/__init__.py deleted file mode 100644 index 553903a38e..0000000000 --- a/features/organisation/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- - -# Akvo RSR is covered by the GNU Affero General Public License. -# See more details in the license.txt file located at the root folder of the Akvo RSR module. -# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. - -# Initialiser for the RSR organisation module. diff --git a/features/organisation/all_fields.feature b/features/organisation/all_fields.feature deleted file mode 100644 index 23c3696dc5..0000000000 --- a/features/organisation/all_fields.feature +++ /dev/null @@ -1,20 +0,0 @@ -Feature: Enter and view all information possible about an organisation - As an Akvo administrator - I want to enter non-required information in all organisation fields - In order to help showcase the organisation on the Akvo site - - Background: - Given that I have signed in to Admin and created the minimum new organisation - Click the new organisation's link under Organisation listing page in RSR - - Scenario: Add & view general information - - - - Scenario: Add & view Contact information - - - Scenario: Add & view more Location information - - - Scenario: Add & view Description about the organisation \ No newline at end of file diff --git a/features/organisation/create_new.feature b/features/organisation/create_new.feature deleted file mode 100644 index 18f468b9b5..0000000000 --- a/features/organisation/create_new.feature +++ /dev/null @@ -1,25 +0,0 @@ -Feature: Creating a new organisation - In order to add a new partner to Akvo RSR - As an Akvo Administrator - I want to create a new organisation - - Background: - Given that I have signed in to Admin as an Akvo Administrator - Record number of "Project partners" shown on home page - Record number of organisations shown on all-organisations page - Click "Organisations" link under RSR - Then I should see the Organisation listing page - - - Scenario: Create a new organisation - Given I am on the admin Organisation listing page - When I click "Add Organisation" button - Then I should see the "Add Organisation" form - - Fill in required fields - Click "Save" - Then number of "Project partners" shown on the home page should be +1 - Then number of organisations shown on all-organisations page should be +1 - Then the new organisation should appear on all-organisations page - Then an organisation page has been created for the new organisation - diff --git a/features/partner_sites/__init__.py b/features/partner_sites/__init__.py deleted file mode 100644 index 8d6268a8be..0000000000 --- a/features/partner_sites/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- - -# Akvo RSR is covered by the GNU Affero General Public License. -# See more details in the license.txt file located at the root folder of the Akvo RSR module. -# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. - -# Initialiser for the RSR partner_sites module. diff --git a/features/partner_sites/access.feature b/features/partner_sites/access.feature deleted file mode 100644 index d005724057..0000000000 --- a/features/partner_sites/access.feature +++ /dev/null @@ -1,54 +0,0 @@ -Feature: Visit partner sites - In order to use partner sites - As a user - I want to be able to access a partner sites pages - - Background: - Given that a partner sites "akvoqa.akvo.org" exists - And the user is not signed in - - Scenario: Access home page - Go to home page - Then I want to see the text "Find projects" - And also see the text "Sign in" - - Scenario: Access project page - Go to home page - Click on the link "Test project" - Then I want to see the text "Test project" - - Scenario: Access funding page - Go to home page - Click on the link "Test project" - Click on the link "See funding and milestone details" - Then I want to see the text "Raised equals donations minus transaction fees" - - Scenario: Access updates list page - Go to home page - Click on the link "Test project" - Click on the link "See all" (This seems like an issue) - Then I want to see the text "Project updates" - - Scenario: Access updates list page - Go to home page - Click on the link "Test project" - Click on the first update (This seems like an issue) - Then I want to see the text "Back to project updates" - - Scenario: Access project partner page - Go to home page - Click on the first partner on the first project in the partner column - Then I want to see the text "People who get" - - Scenario: Access project partner list page - Go to home page - Click on the link "Test project" - Click on the link "Project partners" - Then I want to see the text "Project partners" - - Scenario: Access donation flow - Go to home page - Click on the link "Test project" - Click on "Donate" - Then I want to see the text "Test project" - And see the button "Donate" diff --git a/features/partner_sites/admin/__init__.py b/features/partner_sites/admin/__init__.py deleted file mode 100644 index 8e0776b2f6..0000000000 --- a/features/partner_sites/admin/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- - -# Akvo RSR is covered by the GNU Affero General Public License. -# See more details in the license.txt file located at the root folder of the Akvo RSR module. -# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. - -# Initialiser for the RSR partner_sites.admin module. diff --git a/features/partner_sites/admin/add.feature b/features/partner_sites/admin/add.feature deleted file mode 100644 index 26f4db4bcd..0000000000 --- a/features/partner_sites/admin/add.feature +++ /dev/null @@ -1,26 +0,0 @@ -Feature: Add new partner site - In order for an RSR Organisation to have a partner site - As a organisation administrator/editor??? - I want to be able to create a partner sites - - Background: - Given the user is signed in - And that the users organisation have public projects - And the organisation to have a premium account - - Scenario: Get new partner site form - Given I Open the Admin partner site page (admin/rsr/partnersite/) - When I click "Add partner site" button - Then I want to see the users organisation pre loaded on the form - - Scenario: Successful creation of partner site - Given I open the Admin partner site page (admin/rsr/partnersite/) - When I click "Add partner site" button - And I fill in "Hostname" with "akvoqa" - And I fill in "CNAME" with "projects" plus local domain - And I fill in "Return URL" with local domain - And I fill in "About box text" with "Test text" - And I select the "Enabled" button - And I click on "Save" - And I open the new partner sites - Then I want to see "Find projects" diff --git a/features/partner_sites/admin/auth.feature b/features/partner_sites/admin/auth.feature deleted file mode 100644 index 1a8b9a07a1..0000000000 --- a/features/partner_sites/admin/auth.feature +++ /dev/null @@ -1,29 +0,0 @@ -Feature: Sign on on partner sites - In order to be able to make updates - As a RSR user - I want to be able to sign in on partner sites - - Background: - Given a RSR editor named "AkvoQAAdmin" - And that Akvo have an enabled partner site - - Scenario: Successfull sign in - Go to Akvo´s partner sites - Access the link "Sign in" - Fill the field "username" with "QAUser" - Fill the field "password" with "correct" - Click on "Sign in" - Then I want to see the text "Hello Daniel!" - - Scenario: Signing out - Go to Akvo´s partner sites - Access the link "Sign out" - Then I want to see the text "Sign in" - - Scenario: Unsuccessfull sign in - Go to Akvo´s partner sites - Access the link "Sign in" - Fill the field "username" with "QAUser" - Fill the field "password" with "wrong" - Click on "Sign in" - Then I want to see the text "Error when signing in" diff --git a/features/partner_sites/admin/steps.py b/features/partner_sites/admin/steps.py deleted file mode 100644 index dc673e19b1..0000000000 --- a/features/partner_sites/admin/steps.py +++ /dev/null @@ -1,49 +0,0 @@ -# -*- coding: utf-8 -*- -""" - Akvo RSR is covered by the GNU Affero General Public License. - See more details in the license.txt file located at the root folder of the - Akvo RSR module. For additional details on the GNU license please - see < http://www.gnu.org/licenses/agpl.html >. - - Tests need to be executed by Lettuces Django integration: - python manage.py harvest rsr/features/partner_site_routing.feature -""" - -from lettuce import before, step, world -from splinter.browser import Browser - - -@before.all -def setUp(): - world.browser = Browser() - -@step(u'Go to Akvo´s partner sites') -def go_to_akvo_s_partner_sites(step): - url = 'http://akvo.akvoapp.org' - world.browser.visit(url) - if world.browser.is_text_present('Find projects'): - assert True - else: - assert False, 'Did not find projects on the partner site page' - -@step(u'Access the link "([^"]*)"') -def access_the_link_group1(step, group1): - world.browser.find_link_by_text(group1).first.click() - assert True - -@step(u'Fill the field "([^"]*)" with "([^"]*)"') -def fill_the_field_group1_with_group2(step, group1, group2): - world.browser.fill(group1, group2) - assert True - -@step(u'Click on "([^"]*)"') -def click_on_group1(step, group1): - world.browser.find_link_by_text('Sign in').first.click() - assert True - -@step(u'Then I want to see the text "([^"]*)"') -def then_i_want_to_see_the_text_group1(step, group1): - assert world.browser.is_text_present(group1) - -def partner_site_url(): - return 'akvo.akvoapp.org' diff --git a/features/partner_sites/ps_home_page_loads.feature b/features/partner_sites/ps_home_page_loads.feature deleted file mode 100644 index 968aa55464..0000000000 --- a/features/partner_sites/ps_home_page_loads.feature +++ /dev/null @@ -1,18 +0,0 @@ -Feature: A partner site home page should load without any errors - As a project partner - I want a partner site that displays a list of my projects and some branding - In order to share my work with the online community - - Scenario: I can view a list of projects for a specified partner organisation - Load the "" page - Then I should see a list of projects for the organisation - - - Examples: - | partner_site_home | - | akvo.akvotest*.org | - | aqua4all.akvotest*.org | - | connect4change.akvotest*.org | - | akvo.akvoapp.org | - | aqua4all.akvoapp.org | - | connect4change.akvoapp.org | diff --git a/features/projects/__init__.py b/features/projects/__init__.py deleted file mode 100644 index 89a0fd96e9..0000000000 --- a/features/projects/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- - -# Akvo RSR is covered by the GNU Affero General Public License. -# See more details in the license.txt file located at the root folder of the Akvo RSR module. -# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. - -# Initialiser for the RSR projects module. diff --git a/features/projects/filtering/__init__.py b/features/projects/filtering/__init__.py deleted file mode 100644 index 0bbdc6bcd1..0000000000 --- a/features/projects/filtering/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- - -# Akvo RSR is covered by the GNU Affero General Public License. -# See more details in the license.txt file located at the root folder of the Akvo RSR module. -# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. - -# Initialiser for the RSR projects.filtering module. diff --git a/features/projects/filtering/filtering_projects.feature b/features/projects/filtering/filtering_projects.feature deleted file mode 100644 index 89927ef592..0000000000 --- a/features/projects/filtering/filtering_projects.feature +++ /dev/null @@ -1,18 +0,0 @@ -Feature: Searching for projects - As a project partner - I want to search for projects that mention particular keywords - In order to find related projects easily - - Background: - Given that I have signed in - Click the "Projects" page tab - - Scenario: I can search for projects with specified keywords in the project name - Fill the filter text field with the word "ecological" - Click the "Filter" button - Then I see a list of projects that have my search phrase in the project name - - Scenario: I can search for projects with specified keywords in the project subtitle - Fill the filter text field with the phrase "water & sanitation" - Click the "Filter" button - Then I see a list of projects that have my search phrase in the project subtitle diff --git a/features/projects/navigating/__init__.py b/features/projects/navigating/__init__.py deleted file mode 100644 index 0bbdc6bcd1..0000000000 --- a/features/projects/navigating/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- - -# Akvo RSR is covered by the GNU Affero General Public License. -# See more details in the license.txt file located at the root folder of the Akvo RSR module. -# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. - -# Initialiser for the RSR projects.filtering module. diff --git a/features/projects/navigating/project_navigating.feature b/features/projects/navigating/project_navigating.feature deleted file mode 100644 index 7a881e208e..0000000000 --- a/features/projects/navigating/project_navigating.feature +++ /dev/null @@ -1,38 +0,0 @@ -Feature: Project pages smoke testing - In order to check the basic functioning of the project pages - As a smoke testing user - I want to browse the project pages to check that they render properly - - Background: Navigate to the project main page for the project that has the first update on the home page - - Scenario: I can navigate to the project main page - When I navigate to the project main page - Then I am shown the main page of the project - - Scenario: I can navigate to the project update page - When I navigate to the project main page - When I click on the topmost link in the Latest updates section - Then I expect to see the page for the selected update - - Scenario: I can navigate to the project listing page - When I navigate to the project main page - When I click on the See all ► link in the Latest updates section - Then I am shown the updates listing page of the project - - Scenario: I can navigate to the project funding details page - When I navigate to the project main page - When I click on the See funding details ► - Then I am shown the funding details page of the project - - Scenario: I can navigate to a project partners page - When I navigate to the project main page - When I click on the See details ► link in the Project partners section - Then I am shown the project partners page for the project - - Scenario: I can navigate to a project partners page - When I navigate to the project main page - When I click on the See all ► link in the Comments section - Then I am shown the comments page for the project - - - diff --git a/features/projects/navigating/project_navigating_steps.py b/features/projects/navigating/project_navigating_steps.py deleted file mode 100644 index ed87226999..0000000000 --- a/features/projects/navigating/project_navigating_steps.py +++ /dev/null @@ -1,81 +0,0 @@ -# -*- coding: utf-8 -*- - -from lettuce import step, world, before - -@before.each_feature -def get_project_info(feature): - '''Figure out the title of the project update and the URL to the project''' - world.browser.visit('http://%s/' % world.SITE_UNDER_TEST) - element = world.browser.find_by_css('#project_update_0').first - world.project_update_title = element.find_by_tag('h2').first.text - world.project_URL = '/'.join(element.find_by_tag('a').first['href'].split('/')[:-3]) + '/' - - -@before.each_scenario -def navigate_to_project(scenario): - world.browser.visit(world.project_URL) - -@step(u'When I navigate to the project main page') -def when_i_navigate_to_the_project_main_page(step): - "To get output for each scenario that is starts out navigating to the project main page" - pass - -# Scenario: I can navigate to a project main page -@step(u'Then I am shown the main page of the project') -def then_i_am_shown_the_main_page_of_the_project(step): - key_words = ('Summary', 'Location', 'Funding', 'Latest updates', 'Tools for this page', 'Project partners', - 'Project in depth', 'Related to this project', 'Comments', 'About Akvo.org', - ) - for key_word in key_words: - assert world.browser.is_text_present(key_word) - - -# Scenario: I can navigate to a project update page -@step(u'When I click on the topmost link in the Latest updates section') -def when_i_click_on_the_topmost_link_in_the_latest_updates_section(step): - world.browser.click_link_by_text(world.project_update_title) - -@step(u'Then I expect to see the page for the selected update') -def then_i_expect_to_see_the_page_for_the_selected_update(step): - assert world.browser.is_text_present(world.project_update_title) - - -# Scenario: I can navigate to the project listing page -@step(u'When I click on the See all ► link in the Latest updates section') -def when_i_click_on_the_see_all_link_in_the_latest_updates_section(step): - world.browser.find_link_by_partial_text(u'See all ')[0].click() - -@step(u'Then I am shown the updates listing page of the project') -def then_i_am_shown_the_updates_listing_page_of_the_project(step): - assert world.browser.is_text_present(world.project_update_title) - assert world.browser.is_text_present('Project updates') - - -# Scenario: I can navigate to the project funding details page -@step(u'When I click on the See funding details ►') -def when_i_click_on_the_see_funding_details(step): - world.browser.click_link_by_partial_text('See funding details ') - -@step(u'Then I am shown the funding details page of the project') -def then_i_am_shown_the_funding_details_page_of_the_project(step): - assert world.browser.is_text_present('Funding details') - - -# Scenario: I can navigate to a project partners page -@step(u'When I click on the See details ► link in the Project partners section') -def when_i_click_on_the_see_details_link_in_the_project_partners_section(step): - world.browser.click_link_by_partial_text('See details ') - -@step(u'Then I am shown the project partners page for the project') -def then_i_am_shown_the_project_partners_page_for_the_project(step): - assert world.browser.is_text_present('Project partners') - - -@step(u'When I click on the See all ► link in the Comments section') -def when_i_click_on_the_see_all_link_in_the_comments_section(step): - world.browser.find_link_by_partial_text(u'See all ')[1].click() - -@step(u'Then I am shown the comments page for the project') -def then_i_am_shown_the_comments_page_for_the_project(step): - assert world.browser.is_text_present('New comment') - assert world.browser.is_text_present('All comments') diff --git a/features/projects/navigating/projects_navigating.feature b/features/projects/navigating/projects_navigating.feature deleted file mode 100644 index 30531d1aaf..0000000000 --- a/features/projects/navigating/projects_navigating.feature +++ /dev/null @@ -1,24 +0,0 @@ -Feature: Project listing pages smoke testing - In order to check the basic functioning of the project listing pages - As a smoke testing user - I want to browse the project listing pages to check that they render properly - - Scenario: I can navigate to the project list - Go to project listing page - Then I see the first page of the project listing - - Scenario: I can navigate between the different pages of the project listing - Go to project listing page - When I click on the "next ››" link at the top of the list - Then I click on the "‹‹ previous" link at the bottom of the list - Then I see the first page of the project listing - - Scenario: I can navigate to a project displayed in the project list - Go to project listing page - When I click on the link of the first project in the project list - Then I see the main page of that project - - Scenario: I can get a list of all projects in a Focus Area - Go to project listing page - When I click on the first link in the "Focus area" column of the project listing - Then I am shown a project listing with projects for a Focus area diff --git a/features/projects/navigating/projects_navigating_steps.py b/features/projects/navigating/projects_navigating_steps.py deleted file mode 100644 index d6b36b51bc..0000000000 --- a/features/projects/navigating/projects_navigating_steps.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -from lettuce import step, world - - -@step(u'Go to project listing page') -def go_to_project_listing_page(step): - world.browser.visit('http://%s/rsr/projects/all/' % world.SITE_UNDER_TEST) - - -# Scenario: I can navigate to the project list -@step(u'Then I see the first page of the project listing') -def then_i_see_the_first_page_of_the_project_listing(step): - assert world.browser.title == 'Akvo.org - All projects' - - -# Scenario: I can navigate between the different pages of the project listing -@step(u'When I click on the "([^"]*)" link at the top of the list') -def when_i_click_on_the_group1_link_at_the_top_of_the_list(step, group1): - world.browser.find_by_css('a.next').first.click() - -@step(u'Then I click on the "([^"]*)" link at the bottom of the list') -def then_i_click_on_the_group1_link_at_the_bottom_of_the_list(step, group1): - world.browser.find_by_css('a.prev').last.click() - - -# Scenario: I can navigate to a project displayed in the project list -@step(u'When I click on the link of the first project in the project list') -def when_i_click_on_the_link_of_the_fist_project_in_the_project_list(step): - project_link = world.browser.find_by_tag('table').first.find_by_tag('td').first.find_by_tag('a').first.find_by_tag('p').last - world.project_title = project_link.text - project_link.click() - -@step(u'Then I see the main page of that project') -def then_i_see_the_main_page_of_that_project(step): - assert world.browser.title == 'Akvo.org - %s' % world.project_title - - -# Scenario: I can get a list of all projects in a Focus Area -@step(u'When I click on the first link in the "([^"]*)" column of the project listing') -def when_i_click_on_the_first_link_in_the_group1_column_of_the_project_listing(step, group1): - fa_link = world.browser.find_by_tag('table').first.find_by_tag('td')[5].find_by_tag('a').first - world.focus_area = fa_link.text - fa_link.click() - -@step(u'Then I am shown a project listing with projects for a Focus area') -def then_i_am_shown_a_project_listing_with_projects_for_a_focus_area(step): - assert world.browser.title == 'Akvo.org - Projects - %s' % world.focus_area - diff --git a/features/sign_in/__init__.py b/features/sign_in/__init__.py deleted file mode 100644 index e93523ae49..0000000000 --- a/features/sign_in/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- - -# Akvo RSR is covered by the GNU Affero General Public License. -# See more details in the license.txt file located at the root folder of the Akvo RSR module. -# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. - -# Initialiser for the RSR sign_in module. diff --git a/features/sign_in/si_akvoadmin.feature b/features/sign_in/si_akvoadmin.feature deleted file mode 100644 index 9a0164d888..0000000000 --- a/features/sign_in/si_akvoadmin.feature +++ /dev/null @@ -1,48 +0,0 @@ -Feature: Signing in to Akvo RSR - As an Akvo Administrator - I want to be able to sign in to my Akvo Administrator account - In order to work on RSR partner accounts. - - Background: - Open Akvo home page - I should see an Admin section in the footer - I should see an "Akvo RSR login" link under Admin - Click "Akvo RSR login" link - Then I should see the "Akvo RSR administration" form - - Scenario: Successful Akvo adminstrator sign in - Fill in administrator username and password - Click "Log in" button - Then I should see the full Site administration page - Then I should see a "Change password" link and a "Log out" link - - Scenario: Successful Akvo administrator sign in with enter key - Fill in administrator username and password - Click "Log in" button - Then I should see the full Site administration page - Then I should see a "Change password" link and a "Log out" link - - Scenario: Missing password - Fill in username only - Click "Log in" button - Then I should see an "Please correct the error below" - And I should see a "This field is required" message by Password field - - Scenario: Missing username - Fill in password only - Click "Log in" button - Then I should see an "Please correct the error below" - And I should see a "This field is required" message by Username field - - Scenario: Missing username and password - Click "Sign in" button - Click "Log in" button - Then I should see an "Please correct the errors below" - And I should see a "This field is required" message by Password field - And I should see a "This field is required" message by Username field - - Scenario: Inactive account - Fill in username and password for an inactive account - Click "Log in" button - Then I should see an "Error when signing in" message - And I should see a "This account is inactive" error message \ No newline at end of file diff --git a/features/sign_in/si_orgadmin.feature b/features/sign_in/si_orgadmin.feature deleted file mode 100644 index d67bb59eef..0000000000 --- a/features/sign_in/si_orgadmin.feature +++ /dev/null @@ -1,19 +0,0 @@ -Feature: Signing in to Akvo RSR - As an Akvo RSR Oranisation Administrator - I want to be able to sign in to my Organisation Administrator account - In order to administrate my Akvo RSR projects. - - Background: - Open Akvo home page - I should see an Admin section in the footer - I should see an "Akvo RSR login" link under Admin - Click "Akvo RSR login" link - Then I should see the "Akvo RSR administration" form - - Scenario: Successful organisation admin sign in - Fill in organisation admin username and password - Click "Log in" button - Then I should see the organisation's limited Site administration page - Then I should see a "Change password" link and a "Log out" link - Click "Organisations" link - Then I should see only my organisation listed diff --git a/features/sign_in/si_user.feature b/features/sign_in/si_user.feature deleted file mode 100644 index 60363a577e..0000000000 --- a/features/sign_in/si_user.feature +++ /dev/null @@ -1,51 +0,0 @@ -Feature: Signing in to Akvo RSR - As a registered user - I want to be able to sign in to my Akvo account - In order to access cool premium features. - - Background: - Open Akvo home page - I should see a "Register" link - I should see a "Sign in" link - Click "Sign in" link - Then I should see the "Sign in" form - - Scenario: Successful sign in with Sign in button - Fill in username and password - Click "Sign in" button - Then I should see the Akvo home page again - Then I should see a "My Akvo" link and a "Sign out" link - - Scenario: Successful sign in with enter key - Fill in username and password - Press Enter key - Then I should see the Akvo home page again - Then I should see a "My Akvo" link and a "Sign out" link - - Scenario: Unsuccessful sign in with Sign in button - Fill in unregistered username and password - Click "Sign in" button - Then I should see an "Error when signing in" message - And I should see "Please enter a correct username and password" message - - Scenario: Missing password - Fill in username only - Click "Sign in" button - Then I should see an "Error when signing in" message - And I should see a "Missing password" error message - - Scenario: Missing username - Fill in password only - Click "Sign in" button - Then I should see an "Error when signing in" message - And I should see a "Missing username" error message - - Scenario: Missing username and password - Click "Sign in" button - Then I should see an "Error: Are you a moron? Fill in something, gherkin head!" - - Scenario: Inactive account - Fill in username and password - Click "Sign in" button - Then I should see an "Error when signing in" message - And I should see a "This account is inactive" error message diff --git a/features/site_under_test.py.template b/features/site_under_test.py.template deleted file mode 100644 index bae4dfd674..0000000000 --- a/features/site_under_test.py.template +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- - -from lettuce import world - - -world.SITE_UNDER_TEST = 'test.akvo.org' diff --git a/features/smoke_tests/__init__.py b/features/smoke_tests/__init__.py deleted file mode 100644 index c289bac7e9..0000000000 --- a/features/smoke_tests/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- - -# Akvo RSR is covered by the GNU Affero General Public License. -# See more details in the license.txt file located at the root folder of the Akvo RSR module. -# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. - -# Initialiser for the RSR smoke_tests module. diff --git a/features/smoke_tests/home_page.feature b/features/smoke_tests/home_page.feature deleted file mode 100644 index 53470d1e78..0000000000 --- a/features/smoke_tests/home_page.feature +++ /dev/null @@ -1,27 +0,0 @@ -Feature: Home page navigation - As anyone - I want to view the Akvo home page - In order to see what's available - - Scenario: View home page - Go to home page - Then I should see the title "Akvo.org - See it happen" - And I also see a "Projects" link - - Scenario: Home page displays recent project updates - Go to home page - Then I should see "Most recent project updates" - Then I click on the first project update - Then I expect to see the page for the selected update - - Scenario: Home page displays recent blog posts - Go to home page - Then I should see "Recent blog posts" - Then I click on the first blog post - Then I expect to see details for the selected post - - Scenario: Home page displays accordion with focus areas - Go to home page - Then I should see "Project focus areas" - Then I click on the last focus area link - Then I expect to see a list of projects for the focus area diff --git a/features/smoke_tests/home_page_steps.py b/features/smoke_tests/home_page_steps.py deleted file mode 100644 index dd677052c7..0000000000 --- a/features/smoke_tests/home_page_steps.py +++ /dev/null @@ -1,65 +0,0 @@ -# -*- coding: utf-8 -*- - -from lettuce import after, before, step, world -from splinter.browser import Browser - - -@step('Go to home page') -def go_to_home_page(step): - world.browser.visit('http://%s/' % world.SITE_UNDER_TEST) - -@step('Then I should see the title "([^"]*)"') -def then_i_should_see_the_title(step, expected_title): - assert world.browser.title == expected_title - -@step('And I also see a "([^"]*)" link') -def and_i_also_see_link(step, expected_link_text): - assert world.browser.find_link_by_text(expected_link_text) - -@step('And I also see a "([^"]*)" link') -def and_i_also_see_a_projects_link(step, projects_link): - assert world.browser.find_link_by_text(projects_link) - -@step('Then I should see "([^"]*)"') -def then_i_should_see_text(step, expected_text): - assert world.browser.is_text_present(expected_text) - - -# Scenario: Home page displays recent project updates -@step('Then I click on the first project update') -def then_i_click_on_the_first_project_update(step): - element = world.browser.find_by_css('#project_update_0').first - title = world.project_update_title = element.find_by_tag('h2').first.text - element.find_by_css('div div a').first.click() - -@step('Then I expect to see the page for the selected update') -def then_i_expect_to_see_details_for_the_selected_update(step): - assert world.browser.is_text_present(world.project_update_title) - - -# Scenario: Home page displays recent blog posts -@step(u'Then I click on the first blog post') -def then_i_click_on_the_first_blog_post(step): - blog_block = world.browser.find_by_css('.span-12 .last').last - blog_link = blog_block.find_by_css('a').first - blog_title = world.blog_post_title = blog_block.find_by_css('h2').first.text - blog_link.click() - -@step(u'Then I expect to see details for the selected post') -def then_i_expect_to_see_details_for_the_selected_post(step): - assert world.browser.is_text_present(world.blog_post_title) - - -# Scenario: Home page displays accordion with focus areas -@step(u'Then I click on the last focus area link') -def then_i_click_on_the_last_focus_area_link(step): - accordion_block = world.browser.find_by_id('index-accordion').first - accordion_link = accordion_block.find_by_css('a').last - accordion_title_anchor = accordion_block.find_by_css('h3').last.find_by_css('a').first - accordion_title = world.accordion_title = accordion_title_anchor.text - accordion_title_anchor.click() - accordion_link.click() - -@step(u'Then I expect to see a list of projects for the focus area') -def then_i_expect_to_see_a_list_of_projects_for_the_focus_area(step): - assert world.browser.is_text_present(world.accordion_title) diff --git a/features/terrain.py b/features/terrain.py deleted file mode 100644 index acefeef456..0000000000 --- a/features/terrain.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- - -from lettuce import after, before, step, world -from splinter.browser import Browser - -from site_under_test import * - - -@before.all -def setUp(): - world.browser = Browser('firefox') - -@after.all -def tearDown(test_results): - world.browser.quit() diff --git a/features/test_files/logfiles/.donotremove b/features/test_files/logfiles/.donotremove deleted file mode 100644 index 2e7213083e..0000000000 --- a/features/test_files/logfiles/.donotremove +++ /dev/null @@ -1 +0,0 @@ -This file was created to enable an empty directory structure to be checked in to Github so as to create a structured for the future test log files. \ No newline at end of file diff --git a/manage.py b/manage.py index 00fb511aa6..d9d3671c13 100644 --- a/manage.py +++ b/manage.py @@ -16,7 +16,6 @@ from django.core.management import execute_from_command_line except ImportError as e: - import sys message = """Error: Can't find the 'settings' module, it appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the settings module does indeed exist, it's causing an ImportError somehow.)\n"""