Try to open prof section before creating it.
authorW. Trevor King <wking@drexel.edu>
Wed, 30 Jun 2010 13:35:12 +0000 (09:35 -0400)
committerW. Trevor King <wking@drexel.edu>
Wed, 30 Jun 2010 13:35:12 +0000 (09:35 -0400)
sitecore/prof/import.py

index cd857a23a619617707f60e819d1d1792a9d11922..6faefcb2a63064697d69665bb46d83f88a534cd7 100644 (file)
@@ -51,10 +51,12 @@ class ProfessorAdder (object):
 
     def __call__(self, prof):
         self.create_prof_page(prof)
-        self.s.open_nav_section(raw_name)
         TODO
 
     def create_prof_page(self, prof):
+        name = '%s %s' % (prof.name.first_middle, prof.name.last)
+        self.s.open_nav_section(name)
+        return
         self.s.open_nav_section('Copy of Shyamalendu Bose')
         old_windows = self.s.w.get_window_handles()
         self.s.w.find_element_by_link_text('Copy To').click()
@@ -69,13 +71,14 @@ class ProfessorAdder (object):
         name = self.s.w.find_element_by_id('Filename')
         name.clear()
         name.send_keys(
-            '/sitecore/content/Home/physics/contact/facultyDirectory/%s %s'
-            % (prof.name.first_middle, prof.name.last))
+            '/sitecore/content/Home/physics/contact/facultyDirectory/%s'
+            % name)
         self.s.w.find_element_by_id('OK').click()
         time.sleep(self.s.wait_time)
         current_window = self.s.w.get_current_window_handle()
         self.s.logger.info('handled copy popup %s, back to %s'
                            % (popup, current_window))
+        self.s.open_nav_section(name)
 
 
 def main(argv):