Commit 539f1ea2 by Dean Dieker

moved accordion out of static since it will use courses module

parent 2427d146
...@@ -12,7 +12,5 @@ Feature: Use the Accordion ...@@ -12,7 +12,5 @@ Feature: Use the Accordion
I should see an element with class of "user" within "3" seconds I should see an element with class of "user" within "3" seconds
I visit "http://stage-edx-001.m.edx.org/courses/MITx/6.00x/2012_Fall/info" I visit "http://stage-edx-001.m.edx.org/courses/MITx/6.00x/2012_Fall/info"
I click "Courseware" I click "Courseware"
I should see an element with id of "open_close_accordion"
I should see an element with class of "ui-accordion"
I should see an element with id of "accordion" I should see an element with id of "accordion"
I click on every item in every week of the course I click on every item in every week of the course
\ No newline at end of file
...@@ -5,6 +5,7 @@ from selenium.webdriver import ActionChains ...@@ -5,6 +5,7 @@ from selenium.webdriver import ActionChains
from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import WebDriverWait
from helpers import * from helpers import *
import re import re
from courses import *
@step(u'I should see an element with class of "(.*)" within "(.*)" seconds') @step(u'I should see an element with class of "(.*)" within "(.*)" seconds')
...@@ -17,17 +18,18 @@ def i_should_see_an_element_with_class_of_classname(step,classname): ...@@ -17,17 +18,18 @@ def i_should_see_an_element_with_class_of_classname(step,classname):
@step(u'I click on every item in every week of the course') @step(u'I click on every item in every week of the course')
def i_click_on_every_item_in_every_week_of_the_course(step): def i_click_on_every_item_in_every_week_of_the_course(step):
weeks = world.browser.find_elements_by_class_name('ui-accordion-header') get_courseware()
weeks[2].click weeks = world.browser.find_elements_by_xpath("//*[@id='accordion']//nav//h3")
#for week in weeks: for week in weeks:
# week.click() week.click()
# wait_until_class_renders('p',1) wait_until_class_renders('p',1)
nodes = world.browser.find_elements_by_xpath("//*[@id='accordion']//nav//ul[@class='ui-accordion-content-active']//li") nodes = world.browser.find_elements_by_xpath("//*[@id='accordion']//nav//ul[@class='ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active']//li")
i = len(nodes) i = len(nodes)
j = 1 j = 1
while j <= i: while j <= i:
node = world.browser.find_element_by_xpath("//ul[@class='ui-accordion-content-active']//li["+str(j)+"]//a//p").click() node = world.browser.find_element_by_xpath("//*[@id='accordion']//nav//ul[@class='ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active']//li["+str(1)+"]//a//p")
i += 1 goodnodetext = re.sub(r'\s','_',node.text)
wait_until_class_renders('p',2) node.click()
# goodnodetext = re.sub(r'\s','_',node.text) j += 1
# wait_until_id_renders("sequence_i4x-MITx-6_00x-sequential-"+goodnodetext,3) clean = re.sub('\"','',goodnodetext)
\ No newline at end of file wait_until_id_renders("sequence_i4x-MITx-6_00x-sequential-"+clean,3)
\ No newline at end of file
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