Commit ce219ed2 by stu

changed acceptance_tests to e2e for oep-8 compliance

parent 78eaab3c
...@@ -40,7 +40,7 @@ htmlcov ...@@ -40,7 +40,7 @@ htmlcov
.tox .tox
nosetests.xml nosetests.xml
unittests.xml unittests.xml
acceptance_tests/xunit.xml e2e/xunit.xml
### Internationalization artifacts ### Internationalization artifacts
*.mo *.mo
...@@ -67,8 +67,8 @@ diff_*.html ...@@ -67,8 +67,8 @@ diff_*.html
report report
edx_ecommerce.log edx_ecommerce.log
venv venv
acceptance_tests.*.log e2e.*.log
acceptance_tests.*.png e2e.*.png
# Override config files # Override config files
override.cfg override.cfg
......
...@@ -16,7 +16,7 @@ help: ...@@ -16,7 +16,7 @@ help:
@echo ' make quality run PEP8 and Pylint ' @echo ' make quality run PEP8 and Pylint '
@echo ' make validate Run Python and JavaScript unit tests and linting ' @echo ' make validate Run Python and JavaScript unit tests and linting '
@echo ' make html_coverage generate and view HTML coverage report ' @echo ' make html_coverage generate and view HTML coverage report '
@echo ' make accept run acceptance tests ' @echo ' make e2e run end to end acceptance tests '
@echo ' make extract_translations extract strings to be translated ' @echo ' make extract_translations extract strings to be translated '
@echo ' make dummy_translations generate dummy translations ' @echo ' make dummy_translations generate dummy translations '
@echo ' make compile_translations generate translation files ' @echo ' make compile_translations generate translation files '
...@@ -68,8 +68,8 @@ fast_validate_python: clean ...@@ -68,8 +68,8 @@ fast_validate_python: clean
make quality make quality
quality: quality:
pep8 --config=.pep8 ecommerce acceptance_tests pep8 --config=.pep8 ecommerce e2e
pylint --rcfile=pylintrc ecommerce acceptance_tests pylint --rcfile=pylintrc ecommerce e2e
validate: validate_python validate_js validate: validate_python validate_js
...@@ -90,8 +90,8 @@ fast_diff_coverage: ...@@ -90,8 +90,8 @@ fast_diff_coverage:
coverage xml coverage xml
diff-cover coverage.xml --compare-branch=$(DIFF_COVER_BASE_BRANCH) diff-cover coverage.xml --compare-branch=$(DIFF_COVER_BASE_BRANCH)
accept: e2e:
nosetests --with-ignore-docstrings -v acceptance_tests --with-xunit --xunit-file=acceptance_tests/xunit.xml nosetests --with-ignore-docstrings -v e2e --with-xunit --xunit-file=e2e/xunit.xml
extract_translations: extract_translations:
python manage.py makemessages -l en -v1 -d django --ignore="docs/*" --ignore="src/*" --ignore="i18n/*" --ignore="assets/*" --ignore="node_modules/*" --ignore="ecommerce/static/bower_components/*" --ignore="ecommerce/static/build/*" python manage.py makemessages -l en -v1 -d django --ignore="docs/*" --ignore="src/*" --ignore="i18n/*" --ignore="assets/*" --ignore="node_modules/*" --ignore="ecommerce/static/bower_components/*" --ignore="ecommerce/static/build/*"
...@@ -120,6 +120,6 @@ detect_changed_source_translations: ...@@ -120,6 +120,6 @@ detect_changed_source_translations:
validate_translations: fake_translations detect_changed_source_translations validate_translations: fake_translations detect_changed_source_translations
# Targets in a Makefile which do not produce an output file with the same name as the target name # Targets in a Makefile which do not produce an output file with the same name as the target name
.PHONY: help requirements migrate serve clean validate_python quality validate_js validate html_coverage accept \ .PHONY: help requirements migrate serve clean validate_python quality validate_js validate html_coverage e2e \
extract_translations dummy_translations compile_translations fake_translations pull_translations \ extract_translations dummy_translations compile_translations fake_translations pull_translations \
push_translations update_translations fast_validate_python clean_static push_translations update_translations fast_validate_python clean_static
import requests import requests
from requests.auth import AuthBase from requests.auth import AuthBase
from acceptance_tests.config import ACCESS_TOKEN, ENROLLMENT_API_URL from e2e.config import ACCESS_TOKEN, ENROLLMENT_API_URL
class BearerAuth(AuthBase): class BearerAuth(AuthBase):
......
import os import os
from acceptance_tests.utils import str2bool from e2e.utils import str2bool
ACCESS_TOKEN = os.environ.get('ACCESS_TOKEN') ACCESS_TOKEN = os.environ.get('ACCESS_TOKEN')
......
...@@ -9,8 +9,8 @@ from selenium.webdriver.support import expected_conditions as EC ...@@ -9,8 +9,8 @@ from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.select import Select from selenium.webdriver.support.select import Select
from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import WebDriverWait
from acceptance_tests.api import EnrollmentApiClient from e2e.api import EnrollmentApiClient
from acceptance_tests.config import ( from e2e.config import (
LMS_AUTO_AUTH, LMS_AUTO_AUTH,
ECOMMERCE_URL_ROOT, ECOMMERCE_URL_ROOT,
LMS_PASSWORD, LMS_PASSWORD,
...@@ -26,10 +26,10 @@ from acceptance_tests.config import ( ...@@ -26,10 +26,10 @@ from acceptance_tests.config import (
PAYPAL_EMAIL, PAYPAL_EMAIL,
LMS_HTTPS LMS_HTTPS
) )
from acceptance_tests.expected_conditions import input_provided from e2e.expected_conditions import input_provided
from acceptance_tests.pages import submit_lms_login_form from e2e.pages import submit_lms_login_form
from acceptance_tests.pages.ecommerce import EcommerceLoginPage from e2e.pages.ecommerce import EcommerceLoginPage
from acceptance_tests.pages.lms import LMSLoginPage, LMSDashboardPage, LMSRegistrationPage, LMSLogoutPage from e2e.pages.lms import LMSLoginPage, LMSDashboardPage, LMSRegistrationPage, LMSLogoutPage
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
...@@ -375,7 +375,7 @@ class CouponMixin(EcommerceApiMixin): ...@@ -375,7 +375,7 @@ class CouponMixin(EcommerceApiMixin):
def get_and_delete_coupons(self, partial_title): def get_and_delete_coupons(self, partial_title):
""" """
Get all coupons created in the acceptance tests and delete those Get all coupons created in the e2e tests and delete those
and all associated stock records and vouchers. and all associated stock records and vouchers.
""" """
coupons = self.ecommerce_api_client.coupons.get(title=partial_title)['results'] coupons = self.ecommerce_api_client.coupons.get(title=partial_title)['results']
......
import re import re
from acceptance_tests.config import BULK_PURCHASE_SKU from e2e.config import BULK_PURCHASE_SKU
from acceptance_tests.pages.ecommerce import EcommerceAppPage from e2e.pages.ecommerce import EcommerceAppPage
class BasketPage(EcommerceAppPage): class BasketPage(EcommerceAppPage):
......
...@@ -8,10 +8,10 @@ from selenium.webdriver.support import expected_conditions as EC ...@@ -8,10 +8,10 @@ from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.select import Select from selenium.webdriver.support.select import Select
from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import WebDriverWait
from acceptance_tests.config import ECOMMERCE_URL_ROOT, VERIFIED_COURSE_ID from e2e.config import ECOMMERCE_URL_ROOT, VERIFIED_COURSE_ID
from acceptance_tests.constants import CODE, DEFAULT_END_DATE, DEFAULT_START_DATE from e2e.constants import CODE, DEFAULT_END_DATE, DEFAULT_START_DATE
from acceptance_tests.expected_conditions import option_selected from e2e.expected_conditions import option_selected
from acceptance_tests.pages.ecommerce import EcommerceAppPage from e2e.pages.ecommerce import EcommerceAppPage
def _get_coupon_name(is_discount): def _get_coupon_name(is_discount):
......
from bok_choy.page_object import PageObject from bok_choy.page_object import PageObject
from acceptance_tests.config import ECOMMERCE_URL_ROOT from e2e.config import ECOMMERCE_URL_ROOT
from acceptance_tests.pages.lms import LMSLoginPage from e2e.pages.lms import LMSLoginPage
class EcommerceAppPage(PageObject): # pylint: disable=abstract-method class EcommerceAppPage(PageObject): # pylint: disable=abstract-method
......
...@@ -7,8 +7,8 @@ from bok_choy.promise import EmptyPromise ...@@ -7,8 +7,8 @@ from bok_choy.promise import EmptyPromise
from selenium.common.exceptions import NoSuchElementException, WebDriverException from selenium.common.exceptions import NoSuchElementException, WebDriverException
from selenium.webdriver.support.select import Select from selenium.webdriver.support.select import Select
from acceptance_tests.config import LMS_URL_ROOT, BASIC_AUTH_USERNAME, BASIC_AUTH_PASSWORD, MARKETING_URL_ROOT from e2e.config import LMS_URL_ROOT, BASIC_AUTH_USERNAME, BASIC_AUTH_PASSWORD, MARKETING_URL_ROOT
from acceptance_tests.pages import submit_lms_login_form from e2e.pages import submit_lms_login_form
class LMSPage(PageObject): # pylint: disable=abstract-method class LMSPage(PageObject): # pylint: disable=abstract-method
......
from bok_choy.page_object import PageObject from bok_choy.page_object import PageObject
import requests import requests
from acceptance_tests.config import MARKETING_URL_ROOT, BASIC_AUTH_USERNAME, BASIC_AUTH_PASSWORD from e2e.config import MARKETING_URL_ROOT, BASIC_AUTH_USERNAME, BASIC_AUTH_PASSWORD
class MarketingCourseAboutPage(PageObject): class MarketingCourseAboutPage(PageObject):
......
# Packages required to run acceptance tests # Packages required to run e2e tests
bok-choy==0.5.0 bok-choy==0.5.0
ddt==1.0.1 ddt==1.0.1
django-nose==1.4.2 django-nose==1.4.2
......
...@@ -3,9 +3,9 @@ from unittest import skipUnless ...@@ -3,9 +3,9 @@ from unittest import skipUnless
from bok_choy.promise import EmptyPromise from bok_choy.promise import EmptyPromise
from bok_choy.web_app_test import WebAppTest from bok_choy.web_app_test import WebAppTest
from acceptance_tests.config import ENABLE_SSO_TESTS, MARKETING_URL_ROOT, LMS_URL_ROOT from e2e.config import ENABLE_SSO_TESTS, MARKETING_URL_ROOT, LMS_URL_ROOT
from acceptance_tests.mixins import LogistrationMixin, OttoAuthenticationMixin, LMSLogoutMixin from e2e.mixins import LogistrationMixin, OttoAuthenticationMixin, LMSLogoutMixin
from acceptance_tests.pages.ecommerce import EcommerceDashboardHomePage from e2e.pages.ecommerce import EcommerceDashboardHomePage
@skipUnless(ENABLE_SSO_TESTS, 'Single sign-on tests are not enabled.') @skipUnless(ENABLE_SSO_TESTS, 'Single sign-on tests are not enabled.')
......
...@@ -2,15 +2,15 @@ from unittest import skipUnless ...@@ -2,15 +2,15 @@ from unittest import skipUnless
from bok_choy.web_app_test import WebAppTest from bok_choy.web_app_test import WebAppTest
from acceptance_tests.config import BULK_PURCHASE_SKU, LMS_EMAIL, LMS_PASSWORD from e2e.config import BULK_PURCHASE_SKU, LMS_EMAIL, LMS_PASSWORD
from acceptance_tests.mixins import ( from e2e.mixins import (
EcommerceApiMixin, EcommerceApiMixin,
EnrollmentApiMixin, EnrollmentApiMixin,
LogistrationMixin, LogistrationMixin,
PaymentMixin PaymentMixin
) )
from acceptance_tests.pages.basket import BasketPage, BasketAddProductPage from e2e.pages.basket import BasketPage, BasketAddProductPage
@skipUnless(BULK_PURCHASE_SKU, 'Bulk Purchase SKU not provided, skipping Bulk Purchase tests.') @skipUnless(BULK_PURCHASE_SKU, 'Bulk Purchase SKU not provided, skipping Bulk Purchase tests.')
......
...@@ -3,10 +3,10 @@ from unittest import skipUnless ...@@ -3,10 +3,10 @@ from unittest import skipUnless
from bok_choy.web_app_test import WebAppTest from bok_choy.web_app_test import WebAppTest
from acceptance_tests.config import ENABLE_COUPON_ADMIN_TESTS from e2e.config import ENABLE_COUPON_ADMIN_TESTS
from acceptance_tests.constants import DEFAULT_END_DATE, DEFAULT_START_DATE from e2e.constants import DEFAULT_END_DATE, DEFAULT_START_DATE
from acceptance_tests.mixins import CouponMixin, LogistrationMixin from e2e.mixins import CouponMixin, LogistrationMixin
from acceptance_tests.pages.coupons import CouponsCreatePage, CouponsDetailsPage, CouponsListPage from e2e.pages.coupons import CouponsCreatePage, CouponsDetailsPage, CouponsListPage
@skipUnless(ENABLE_COUPON_ADMIN_TESTS, 'Coupon admin tests are disabled.') @skipUnless(ENABLE_COUPON_ADMIN_TESTS, 'Coupon admin tests are disabled.')
......
...@@ -3,13 +3,13 @@ from unittest import skipUnless ...@@ -3,13 +3,13 @@ from unittest import skipUnless
import ddt import ddt
from bok_choy.web_app_test import WebAppTest from bok_choy.web_app_test import WebAppTest
from acceptance_tests.config import VERIFIED_COURSE_ID, ENABLE_CYBERSOURCE_TESTS from e2e.config import VERIFIED_COURSE_ID, ENABLE_CYBERSOURCE_TESTS
from acceptance_tests.constants import CODE, CYBERSOURCE_DATA1, CYBERSOURCE_DATA2 from e2e.constants import CODE, CYBERSOURCE_DATA1, CYBERSOURCE_DATA2
from acceptance_tests.mixins import (CouponMixin, EcommerceApiMixin, EnrollmentApiMixin, from e2e.mixins import (CouponMixin, EcommerceApiMixin, EnrollmentApiMixin,
LogistrationMixin, UnenrollmentMixin, PaymentMixin) LogistrationMixin, UnenrollmentMixin, PaymentMixin)
from acceptance_tests.pages.basket import BasketPage from e2e.pages.basket import BasketPage
from acceptance_tests.pages.coupons import CouponsCreatePage, CouponsDetailsPage, CouponsListPage, RedeemVoucherPage from e2e.pages.coupons import CouponsCreatePage, CouponsDetailsPage, CouponsListPage, RedeemVoucherPage
from acceptance_tests.pages.ecommerce import EcommerceDashboardHomePage from e2e.pages.ecommerce import EcommerceDashboardHomePage
@ddt.ddt @ddt.ddt
......
from bok_choy.web_app_test import WebAppTest from bok_choy.web_app_test import WebAppTest
from acceptance_tests.config import HONOR_COURSE_ID from e2e.config import HONOR_COURSE_ID
from acceptance_tests.mixins import LogistrationMixin, EcommerceApiMixin, EnrollmentApiMixin, UnenrollmentMixin from e2e.mixins import LogistrationMixin, EcommerceApiMixin, EnrollmentApiMixin, UnenrollmentMixin
class LoginEnrollmentTests(UnenrollmentMixin, EcommerceApiMixin, EnrollmentApiMixin, LogistrationMixin, WebAppTest): class LoginEnrollmentTests(UnenrollmentMixin, EcommerceApiMixin, EnrollmentApiMixin, LogistrationMixin, WebAppTest):
......
...@@ -6,15 +6,15 @@ from selenium.webdriver.common.by import By ...@@ -6,15 +6,15 @@ from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import WebDriverWait
from acceptance_tests.config import (VERIFIED_COURSE_ID, MARKETING_URL_ROOT, from e2e.config import (VERIFIED_COURSE_ID, MARKETING_URL_ROOT,
PAYPAL_PASSWORD, PAYPAL_EMAIL, ENABLE_CYBERSOURCE_TESTS, PAYPAL_PASSWORD, PAYPAL_EMAIL, ENABLE_CYBERSOURCE_TESTS,
BULK_PURCHASE_SKU) BULK_PURCHASE_SKU)
from acceptance_tests.constants import CYBERSOURCE_DATA1, CYBERSOURCE_DATA2 from e2e.constants import CYBERSOURCE_DATA1, CYBERSOURCE_DATA2
from acceptance_tests.mixins import (LogistrationMixin, EnrollmentApiMixin, EcommerceApiMixin, from e2e.mixins import (LogistrationMixin, EnrollmentApiMixin, EcommerceApiMixin,
PaymentMixin, UnenrollmentMixin) PaymentMixin, UnenrollmentMixin)
from acceptance_tests.pages.lms import LMSCourseModePage from e2e.pages.lms import LMSCourseModePage
from acceptance_tests.pages.marketing import MarketingCourseAboutPage from e2e.pages.marketing import MarketingCourseAboutPage
from acceptance_tests.pages.basket import BasketAddProductPage from e2e.pages.basket import BasketAddProductPage
@ddt.ddt @ddt.ddt
......
...@@ -5,10 +5,10 @@ from selenium.webdriver.common.by import By ...@@ -5,10 +5,10 @@ from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import WebDriverWait
from acceptance_tests.config import PROFESSIONAL_COURSE_ID, MARKETING_URL_ROOT from e2e.config import PROFESSIONAL_COURSE_ID, MARKETING_URL_ROOT
from acceptance_tests.mixins import LogistrationMixin, EnrollmentApiMixin from e2e.mixins import LogistrationMixin, EnrollmentApiMixin
from acceptance_tests.pages.lms import LMSCourseModePage from e2e.pages.lms import LMSCourseModePage
from acceptance_tests.pages.marketing import MarketingCourseAboutPage from e2e.pages.marketing import MarketingCourseAboutPage
@skipUnless(PROFESSIONAL_COURSE_ID, 'Professional education tests are not enabled.') @skipUnless(PROFESSIONAL_COURSE_ID, 'Professional education tests are not enabled.')
......
...@@ -83,7 +83,7 @@ class RefundAcceptanceTestMixin(RefundTestMixin): ...@@ -83,7 +83,7 @@ class RefundAcceptanceTestMixin(RefundTestMixin):
self.assertIn(alert_class, classes) self.assertIn(alert_class, classes)
self.assertEqual(alert.find_element_by_css_selector('.message').text, text) self.assertEqual(alert.find_element_by_css_selector('.message').text, text)
@skip("Requires refund processing endpoint. Move to acceptance_tests and re-enable under ticket XCOM-342.") @skip("Requires refund processing endpoint. Move to e2e and re-enable under ticket XCOM-342.")
@ddt.data(True, False) @ddt.data(True, False)
def test_processing_success(self, approve): def test_processing_success(self, approve):
""" """
...@@ -119,7 +119,7 @@ class RefundAcceptanceTestMixin(RefundTestMixin): ...@@ -119,7 +119,7 @@ class RefundAcceptanceTestMixin(RefundTestMixin):
# Verify that an alert is displayed. # Verify that an alert is displayed.
self.assert_alert_displayed('alert-success', 'Refund {} has been processed.'.format(self.refund.id)) self.assert_alert_displayed('alert-success', 'Refund {} has been processed.'.format(self.refund.id))
@skip("This test is flaky in Travis. Move to acceptance_tests and re-enable under ticket XCOM-342.") @skip("This test is flaky in Travis. Move to e2e and re-enable under ticket XCOM-342.")
@ddt.data(True, False) @ddt.data(True, False)
def test_processing_failure(self, approve): def test_processing_failure(self, approve):
""" """
...@@ -164,7 +164,7 @@ class RefundAcceptanceTestMixin(RefundTestMixin): ...@@ -164,7 +164,7 @@ class RefundAcceptanceTestMixin(RefundTestMixin):
'Please try again, or contact the E-Commerce Development Team.'.format(refund_id=refund_id) 'Please try again, or contact the E-Commerce Development Team.'.format(refund_id=refund_id)
) )
@skip("This test is flaky in Travis. Move to acceptance_tests and re-enable under ticket XCOM-342.") @skip("This test is flaky in Travis. Move to e2e and re-enable under ticket XCOM-342.")
@ddt.data(True, False) @ddt.data(True, False)
def test_cancel_action(self, approve): def test_cancel_action(self, approve):
""" """
......
...@@ -10,4 +10,4 @@ ...@@ -10,4 +10,4 @@
-r ../optional.txt -r ../optional.txt
-r ../production.txt -r ../production.txt
-r ../test.txt -r ../test.txt
-r ../../acceptance_tests/requirements.txt -r ../../e2e/requirements.txt
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment