self.s = sitecore_connection
def setup(self):
- s.expand_nav_section('Media Library')
- s.expand_nav_section('Images')
- s.expand_nav_section('physics')
- s.expand_nav_section('headshots')
+ #self.s.expand_nav_section('sitecore')
+ #self.s.expand_nav_section('Content')
+ self.s.expand_nav_section('Home')
+ self.s.expand_nav_section('physics')
+ self.s.expand_nav_section('contact')
+ self.s.expand_nav_section('facultyDirectory')
def __call__(self, prof):
- raw_name = TODO
- s.open_nav_section(raw_name)
+ self.create_prof_page(prof)
+ self.s.open_nav_section(raw_name)
TODO
+ def create_prof_page(self, prof):
+ self.s.open_nav_section('Copy of Shyamalendu Bose')
+ self.s.w.find_element_by_link_text('Copy To').click()
+ time.sleep(self.s.wait_time)
+ windows = self.w.get_window_handles()
+ current_window = self.w.get_current_window_handle()
+ self.logger.info('handling copy popup %s (from %s)'
+ % (current_window, windows))
+ name = self.s.find_element_by_id('Filename')
+ name.clear()
+ name.send_keys(
+ '/sitecore/content/Home/physics/contact/facultyDirectory/%s %s'
+ % (prof.name.first, prof.name.last))
+ self.s.w.find_element_by_link_text('Copy').click()
+ time.sleep(self.s.wait_time)
+
+
def main(argv):
import optparse
usage = """%prog [options] PROF_FILE
a = ProfessorAdder(s)
a.setup()
for prof in profs:
- a.aadd_profs(s, profs)
+ a.add_profs(s, profs)
finally:
s.stop()