Merge pull request #602 from edx/jonahstanley/fix-acceptance-template
Changed css_selector
This commit is contained in:
@@ -56,10 +56,8 @@ def i_have_opened_a_new_course(_step):
|
|||||||
|
|
||||||
@step('(I select|s?he selects) the new course')
|
@step('(I select|s?he selects) the new course')
|
||||||
def select_new_course(_step, whom):
|
def select_new_course(_step, whom):
|
||||||
course_link_xpath = '//div[contains(@class, "courses")]//a[contains(@class, "class-link")]//span[contains(., "{name}")]/..'.format(
|
course_link_css = 'a.course-link'
|
||||||
name="Robot Super Course")
|
world.css_click(course_link_css)
|
||||||
element = world.browser.find_by_xpath(course_link_xpath)
|
|
||||||
element.click()
|
|
||||||
|
|
||||||
|
|
||||||
@step(u'I press the "([^"]*)" notification button$')
|
@step(u'I press the "([^"]*)" notification button$')
|
||||||
@@ -179,8 +177,7 @@ def create_a_course():
|
|||||||
user.groups.add(group)
|
user.groups.add(group)
|
||||||
user.save()
|
user.save()
|
||||||
world.browser.reload()
|
world.browser.reload()
|
||||||
|
course_link_css = 'a.course-link'
|
||||||
course_link_css = 'span.class-name'
|
|
||||||
world.css_click(course_link_css)
|
world.css_click(course_link_css)
|
||||||
course_title_css = 'span.course-title'
|
course_title_css = 'span.course-title'
|
||||||
assert_true(world.is_css_present(course_title_css))
|
assert_true(world.is_css_present(course_title_css))
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ def have_a_course_with_two_sections(step):
|
|||||||
def navigate_to_the_course_overview_page(step):
|
def navigate_to_the_course_overview_page(step):
|
||||||
create_studio_user(is_staff=True)
|
create_studio_user(is_staff=True)
|
||||||
log_into_studio()
|
log_into_studio()
|
||||||
course_locator = '.class-name'
|
course_locator = 'a.course-link'
|
||||||
world.css_click(course_locator)
|
world.css_click(course_locator)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ def delete_other_user(_step, name):
|
|||||||
email="{0}{1}".format(name, EMAIL_EXTENSION))
|
email="{0}{1}".format(name, EMAIL_EXTENSION))
|
||||||
world.css_click(to_delete_css)
|
world.css_click(to_delete_css)
|
||||||
# confirm prompt
|
# confirm prompt
|
||||||
|
# need to wait for the animation to be done, there isn't a good success condition that won't work both on latest chrome and jenkins
|
||||||
|
world.wait(.5)
|
||||||
world.css_click(".wrapper-prompt-warning .action-primary")
|
world.css_click(".wrapper-prompt-warning .action-primary")
|
||||||
|
|
||||||
|
|
||||||
@@ -93,7 +95,7 @@ def other_user_login(_step, name):
|
|||||||
@step(u'I( do not)? see the course on my page')
|
@step(u'I( do not)? see the course on my page')
|
||||||
@step(u's?he does( not)? see the course on (his|her) page')
|
@step(u's?he does( not)? see the course on (his|her) page')
|
||||||
def see_course(_step, inverted, gender='self'):
|
def see_course(_step, inverted, gender='self'):
|
||||||
class_css = 'span.class-name'
|
class_css = 'h3.course-title'
|
||||||
all_courses = world.css_find(class_css, wait_time=1)
|
all_courses = world.css_find(class_css, wait_time=1)
|
||||||
all_names = [item.html for item in all_courses]
|
all_names = [item.html for item in all_courses]
|
||||||
if inverted:
|
if inverted:
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ def i_create_a_course(step):
|
|||||||
|
|
||||||
@step('I click the course link in My Courses$')
|
@step('I click the course link in My Courses$')
|
||||||
def i_click_the_course_link_in_my_courses(step):
|
def i_click_the_course_link_in_my_courses(step):
|
||||||
course_css = 'span.class-name'
|
course_css = 'a.course-link'
|
||||||
world.css_click(course_css)
|
world.css_click(course_css)
|
||||||
|
|
||||||
############ ASSERTIONS ###################
|
############ ASSERTIONS ###################
|
||||||
@@ -44,7 +44,7 @@ def courseware_page_has_loaded_in_studio(step):
|
|||||||
|
|
||||||
@step('I see the course listed in My Courses$')
|
@step('I see the course listed in My Courses$')
|
||||||
def i_see_the_course_in_my_courses(step):
|
def i_see_the_course_in_my_courses(step):
|
||||||
course_css = 'span.class-name'
|
course_css = 'h3.class-title'
|
||||||
assert world.css_has_text(course_css, world.scenario_dict['COURSE'].display_name)
|
assert world.css_has_text(course_css, world.scenario_dict['COURSE'].display_name)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,13 +24,10 @@ def go_to_uploads(_step):
|
|||||||
def upload_file(_step, file_name):
|
def upload_file(_step, file_name):
|
||||||
upload_css = 'a.upload-button'
|
upload_css = 'a.upload-button'
|
||||||
world.css_click(upload_css)
|
world.css_click(upload_css)
|
||||||
|
|
||||||
file_css = 'input.file-input'
|
|
||||||
upload = world.css_find(file_css)
|
|
||||||
#uploading the file itself
|
#uploading the file itself
|
||||||
path = os.path.join(TEST_ROOT, 'uploads/', file_name)
|
path = os.path.join(TEST_ROOT, 'uploads/', file_name)
|
||||||
upload._element.send_keys(os.path.abspath(path))
|
world.browser.execute_script("$('input.file-input').css('display', 'block')")
|
||||||
|
world.browser.attach_file('file', os.path.abspath(path))
|
||||||
close_css = 'a.close-button'
|
close_css = 'a.close-button'
|
||||||
world.css_click(close_css)
|
world.css_click(close_css)
|
||||||
|
|
||||||
@@ -80,6 +77,9 @@ def check_download(_step, file_name):
|
|||||||
r = get_file(file_name)
|
r = get_file(file_name)
|
||||||
downloaded_text = r.text
|
downloaded_text = r.text
|
||||||
assert cur_text == downloaded_text
|
assert cur_text == downloaded_text
|
||||||
|
#resetting the file back to its original state
|
||||||
|
with open(os.path.abspath(path), 'w') as cur_file:
|
||||||
|
cur_file.write("This is an arbitrary file for testing uploads")
|
||||||
|
|
||||||
|
|
||||||
@step(u'I modify "([^"]*)"$')
|
@step(u'I modify "([^"]*)"$')
|
||||||
|
|||||||
Reference in New Issue
Block a user