Commit 4b708daa by Dean Dieker Committed by Mark L. Chang

moved accordion out of static since it will use courses module

parent f03ab8a5
Feature: Use the Accordion
In order to access courseware
As a registered student
We'll attempt to access all the information
Scenario: Click on every Week's Content
Given I visit "http://anant:agarwal@stage-edx-001.m.edx.org/"
When I click "LOG IN"
And I login with "ddieker+admin@gmail.com" in the "email" field
And I login with "password" in the "password" field
And I press "Access My Courses"
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 click "Courseware"
I should see an element with id of "accordion"
I click on every item in every week of the course
\ No newline at end of file
from lettuce import * #before, world
from selenium import *
import lettuce_webdriver.webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.support.ui import WebDriverWait
from helpers import *
import re
from courses import *
@step(u'I should see an element with class of "(.*)" within "(.*)" seconds')
def i_should_see_an_element_with_class_of_classname_within_duraion_seconds(step,classname,duration):
wait_until_class_renders(classname, int(duration))
@step(u'I should see an element with class of "(.*)"')
def i_should_see_an_element_with_class_of_classname(step,classname):
world.browser.find_element_by_class_name(classname)
@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):
get_courseware()
weeks = world.browser.find_elements_by_xpath("//*[@id='accordion']//nav//h3")
for week in weeks:
week.click()
wait_until_class_renders('p',1)
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)
j = 1
while j <= i:
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")
goodnodetext = re.sub(r'\s','_',node.text)
node.click()
j += 1
clean = re.sub('\"','',goodnodetext)
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