Merge pull request #937 from edx/zoldak/add-cert-tests
Add more certificates test for newly implemented features
This commit is contained in:
@@ -28,9 +28,6 @@ Feature: Verified certificates
|
|||||||
When I submit valid payment information
|
When I submit valid payment information
|
||||||
Then I see that my payment was successful
|
Then I see that my payment was successful
|
||||||
|
|
||||||
|
|
||||||
# Not yet implemented LMS-982
|
|
||||||
@skip
|
|
||||||
Scenario: Verified courses display correctly on dashboard
|
Scenario: Verified courses display correctly on dashboard
|
||||||
Given I have submitted photos to verify my identity
|
Given I have submitted photos to verify my identity
|
||||||
When I submit valid payment information
|
When I submit valid payment information
|
||||||
@@ -57,8 +54,6 @@ Feature: Verified certificates
|
|||||||
When I edit my name
|
When I edit my name
|
||||||
Then I see the new name on the confirmation page.
|
Then I see the new name on the confirmation page.
|
||||||
|
|
||||||
# Currently broken LMS-1009
|
|
||||||
@skip
|
|
||||||
Scenario: I can return to the verify flow
|
Scenario: I can return to the verify flow
|
||||||
Given I have submitted photos to verify my identity
|
Given I have submitted photos to verify my identity
|
||||||
When I leave the flow and return
|
When I leave the flow and return
|
||||||
@@ -72,9 +67,8 @@ Feature: Verified certificates
|
|||||||
And I press the payment button
|
And I press the payment button
|
||||||
Then I am at the payment page
|
Then I am at the payment page
|
||||||
|
|
||||||
# Design not yet finalized
|
|
||||||
@skip
|
|
||||||
Scenario: I can take a verified certificate course for free
|
Scenario: I can take a verified certificate course for free
|
||||||
Given I have submitted photos to verify my identity
|
Given I am logged in
|
||||||
When I give a reason why I cannot pay
|
And the course has an honor mode
|
||||||
Then I see that I am registered for a verified certificate course on my dashboard
|
When I give a reason why I cannot pay
|
||||||
|
Then I should see the course on my dashboard
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ def create_cert_course():
|
|||||||
name = 'Certificates'
|
name = 'Certificates'
|
||||||
course_id = '{org}/{number}/{name}'.format(
|
course_id = '{org}/{number}/{name}'.format(
|
||||||
org=org, number=number, name=name)
|
org=org, number=number, name=name)
|
||||||
|
world.scenario_dict['course_id'] = course_id
|
||||||
world.scenario_dict['COURSE'] = world.CourseFactory.create(
|
world.scenario_dict['COURSE'] = world.CourseFactory.create(
|
||||||
org=org, number=number, display_name=name)
|
org=org, number=number, display_name=name)
|
||||||
|
|
||||||
@@ -44,6 +45,18 @@ def register():
|
|||||||
assert world.is_css_present('section.wrapper h3.title')
|
assert world.is_css_present('section.wrapper h3.title')
|
||||||
|
|
||||||
|
|
||||||
|
@step(u'the course has an honor mode')
|
||||||
|
def the_course_has_an_honor_mode(step):
|
||||||
|
create_cert_course()
|
||||||
|
honor_mode = world.CourseModeFactory.create(
|
||||||
|
course_id=world.scenario_dict['course_id'],
|
||||||
|
mode_slug='honor',
|
||||||
|
mode_display_name='honor mode',
|
||||||
|
min_price=0,
|
||||||
|
)
|
||||||
|
assert isinstance(honor_mode, CourseMode)
|
||||||
|
|
||||||
|
|
||||||
@step(u'I select the audit track$')
|
@step(u'I select the audit track$')
|
||||||
def select_the_audit_track(step):
|
def select_the_audit_track(step):
|
||||||
create_cert_course()
|
create_cert_course()
|
||||||
@@ -171,8 +184,8 @@ def submit_payment(step):
|
|||||||
world.css_click(button_css)
|
world.css_click(button_css)
|
||||||
|
|
||||||
|
|
||||||
@step(u'I have submitted photos to verify my identity')
|
@step(u'I have submitted face and ID photos$')
|
||||||
def submitted_photos_to_verify_my_identity(step):
|
def submitted_face_and_id_photos(step):
|
||||||
step.given('I am logged in')
|
step.given('I am logged in')
|
||||||
step.given('I select the verified track')
|
step.given('I select the verified track')
|
||||||
step.given('I go to step "1"')
|
step.given('I go to step "1"')
|
||||||
@@ -182,6 +195,11 @@ def submitted_photos_to_verify_my_identity(step):
|
|||||||
step.given('I capture my "photo_id" photo')
|
step.given('I capture my "photo_id" photo')
|
||||||
step.given('I approve my "photo_id" photo')
|
step.given('I approve my "photo_id" photo')
|
||||||
step.given('I go to step "3"')
|
step.given('I go to step "3"')
|
||||||
|
|
||||||
|
|
||||||
|
@step(u'I have submitted photos to verify my identity')
|
||||||
|
def submitted_photos_to_verify_my_identity(step):
|
||||||
|
step.given('I have submitted face and ID photos')
|
||||||
step.given('I select a contribution amount')
|
step.given('I select a contribution amount')
|
||||||
step.given('I confirm that the details match')
|
step.given('I confirm that the details match')
|
||||||
step.given('I go to step "4"')
|
step.given('I go to step "4"')
|
||||||
@@ -207,12 +225,13 @@ def see_the_course_on_my_dashboard(step):
|
|||||||
|
|
||||||
@step(u'I see that I am on the verified track')
|
@step(u'I see that I am on the verified track')
|
||||||
def see_that_i_am_on_the_verified_track(step):
|
def see_that_i_am_on_the_verified_track(step):
|
||||||
assert False, 'Implement this step after the design is done'
|
id_verified_css = 'li.course-item article.course.verified'
|
||||||
|
assert world.is_css_present(id_verified_css)
|
||||||
|
|
||||||
|
|
||||||
@step(u'I leave the flow and return$')
|
@step(u'I leave the flow and return$')
|
||||||
def leave_the_flow_and_return(step):
|
def leave_the_flow_and_return(step):
|
||||||
world.browser.back()
|
world.visit('verify_student/verified/edx/999/Certificates')
|
||||||
|
|
||||||
|
|
||||||
@step(u'I am at the verified page$')
|
@step(u'I am at the verified page$')
|
||||||
@@ -220,24 +239,24 @@ def see_the_payment_page(step):
|
|||||||
assert world.css_find('button#pay_button')
|
assert world.css_find('button#pay_button')
|
||||||
|
|
||||||
|
|
||||||
@step(u'I press the payment button')
|
@step(u'I edit my name$')
|
||||||
def press_payment_button(step):
|
|
||||||
assert False, 'This step must be implemented'
|
|
||||||
@step(u'I have submitted face and ID photos')
|
|
||||||
def submitted_face_and_id_photos(step):
|
|
||||||
assert False, 'This step must be implemented'
|
|
||||||
@step(u'I edit my name')
|
|
||||||
def edit_my_name(step):
|
def edit_my_name(step):
|
||||||
assert False, 'This step must be implemented'
|
btn_css = 'a.retake-photos'
|
||||||
@step(u'I see the new name on the confirmation page.')
|
world.css_click(btn_css)
|
||||||
def sesee_the_new_name_on_the_confirmation_page(step):
|
|
||||||
assert False, 'This step must be implemented'
|
|
||||||
@step(u'I have submitted photos')
|
@step(u'I give a reason why I cannot pay$')
|
||||||
def submitted_photos(step):
|
def give_a_reason_why_i_cannot_pay(step):
|
||||||
assert False, 'This step must be implemented'
|
register()
|
||||||
@step(u'I am registered for the course')
|
|
||||||
def seam_registered_for_the_course(step):
|
link_css = 'h5 i.expandable-icon'
|
||||||
assert False, 'This step must be implemented'
|
world.css_click(link_css)
|
||||||
@step(u'I return to the student dashboard')
|
|
||||||
def return_to_the_student_dashboard(step):
|
cb_css = 'input#honor-code'
|
||||||
assert False, 'This step must be implemented'
|
world.css_click(cb_css)
|
||||||
|
|
||||||
|
text_css = 'li.field-explain textarea'
|
||||||
|
world.css_find(text_css).type('I cannot afford it.')
|
||||||
|
|
||||||
|
btn_css = 'input[value="Select Certificate"]'
|
||||||
|
world.css_click(btn_css)
|
||||||
|
|||||||
Reference in New Issue
Block a user