- Timestamp:
- 20 Sep 2012, 08:49:37 (12 years ago)
- Location:
- main/waeup.kofa/branches/uli-zc-async
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/uli-zc-async
- Property svn:mergeinfo changed
-
main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/batchprocessing.txt
r8472 r9209 75 75 76 76 >>> import cStringIO 77 >>> browser.getLink('Upload CSV file').click()77 >>> browser.getLink('Upload data').click() 78 78 >>> filecontents = cStringIO.StringIO( 79 79 ... open('faculties.csv', 'rb').read()) … … 84 84 Step 1: start batch processing: 85 85 86 >>> browser.getLink(' Batch processing').click()86 >>> browser.getLink('Process data').click() 87 87 >>> button = lookup_submit_value( 88 88 ... 'select', 'faculties_zope.mgr.csv', browser) … … 97 97 'Course Processor', 'CourseTicket Processor', 98 98 'Department Processor', 'Faculty Processor', 99 'Payment Processor', 'Student Processor', 99 'Hostel Processor', 100 'Student Payment Processor', 'Student Processor', 100 101 'StudentStudyCourse Processor (update only)', 101 'StudentStudyLevel Processor', 'Verdict Processor (update only)'] 102 'StudentStudyLevel Processor', 103 'User Processor', 104 'Verdict Processor (update only)'] 102 105 103 106 >>> importerselect.getControl('Faculty Processor').selected = True … … 175 178 176 179 >>> import cStringIO 177 >>> browser.getLink('Upload CSV file').click()180 >>> browser.getLink('Upload data').click() 178 181 >>> filecontents = cStringIO.StringIO( 179 182 ... open('departments.csv', 'rb').read()) … … 184 187 Step 1: start batch processing: 185 188 186 >>> browser.getLink(' Batch processing').click()189 >>> browser.getLink('Process data').click() 187 190 >>> button = lookup_submit_value( 188 191 ... 'select', 'departments_zope.mgr.csv', browser) … … 240 243 241 244 >>> import cStringIO 242 >>> browser.getLink('Upload CSV file').click()245 >>> browser.getLink('Upload data').click() 243 246 >>> filecontents = cStringIO.StringIO( 244 247 ... open('courses.csv', 'rb').read()) … … 249 252 Step 1: start batch processing: 250 253 251 >>> browser.getLink(' Batch processing').click()254 >>> browser.getLink('Process data').click() 252 255 >>> button = lookup_submit_value( 253 256 ... 'select', 'courses_zope.mgr.csv', browser) … … 305 308 306 309 >>> import cStringIO 307 >>> browser.getLink('Upload CSV file').click()310 >>> browser.getLink('Upload data').click() 308 311 >>> filecontents = cStringIO.StringIO( 309 312 ... open('certificates.csv', 'rb').read()) … … 314 317 Step 1: start batch processing: 315 318 316 >>> browser.getLink(' Batch processing').click()319 >>> browser.getLink('Process data').click() 317 320 >>> button = lookup_submit_value( 318 321 ... 'select', 'certificates_zope.mgr.csv', browser) … … 371 374 372 375 >>> import cStringIO 373 >>> browser.getLink('Upload CSV file').click()376 >>> browser.getLink('Upload data').click() 374 377 >>> filecontents = cStringIO.StringIO( 375 378 ... open('mycertcourses.csv', 'rb').read()) … … 380 383 Step 1: start batch processing: 381 384 382 >>> browser.getLink(' Batch processing').click()385 >>> browser.getLink('Process data').click() 383 386 >>> button = lookup_submit_value( 384 387 ... 'select', 'mycertcourses_zope.mgr.csv', browser) … … 420 423 ...File:...mycertcourses_zope.mgr.csv... 421 424 425 Batch processing users 426 ====================== 427 428 >>> browser.open('http://localhost/app/datacenter') 429 430 Prepare a CSV file for users: 431 432 >>> open('users.csv', 'wb').write( 433 ... """name,title,public_name,email,phone,roles 434 ... uli,Uli Fouquet,Chief Developer,uli@abc.de,+49-234-567 435 ... henrik,Henrik Bettermann,Admin,henrik@abc.de,+49-234-567,['waeup.PortalManager'] 436 ... """) 437 438 Upload the file: 439 440 >>> import cStringIO 441 >>> browser.getLink('Upload data').click() 442 >>> filecontents = cStringIO.StringIO( 443 ... open('users.csv', 'rb').read()) 444 >>> filewidget = browser.getControl(name='uploadfile:file') 445 >>> filewidget.add_file(filecontents, 'text/plain', 'users.csv') 446 >>> browser.getControl(name='SUBMIT').click() 447 448 Step 1: start batch processing: 449 450 >>> browser.getLink('Process data').click() 451 >>> button = lookup_submit_value( 452 ... 'select', 'users_zope.mgr.csv', browser) 453 >>> button.click() 454 455 Step 2: select a processor and mode: 456 457 >>> importerselect = browser.getControl(name='importer') 458 >>> importerselect.getControl('User Processor').selected = True 459 >>> modeselect = browser.getControl(name='mode') 460 >>> modeselect.getControl(value='create').selected = True 461 >>> browser.getControl('Proceed to step 3').click() 462 463 Step 3: Fix headerlines 464 465 We get informed that there are no problems with the current header: 466 467 >>> print browser.contents 468 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 469 ... 470 Header fields OK 471 ... 472 473 The submit button is enabled: 474 475 >>> browser.getControl('Perform import').disabled 476 False 477 478 >>> browser.getControl('Perform import').click() 479 480 Step 4: See import results 481 482 The import was successful: 483 484 >>> print browser.contents 485 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 486 ...Successfully processed 2 rows... 487 ...Batch processing finished... 488 ...File:...users_zope.mgr.csv... 422 489 423 490 Pending files … … 444 511 445 512 >>> import cStringIO 446 >>> browser.getLink('Upload CSV file').click()513 >>> browser.getLink('Upload data').click() 447 514 >>> filecontents = cStringIO.StringIO( 448 515 ... open('newfaculties.csv', 'rb').read()) … … 453 520 Step 1: start batch processing: 454 521 455 >>> browser.getLink(' Batch processing').click()522 >>> browser.getLink('Process data').click() 456 523 >>> button = lookup_submit_value( 457 524 ... 'select', 'newfaculties_zope.mgr.csv', browser) … … 515 582 516 583 >>> browser.open('http://localhost/app/datacenter') 517 >>> browser.getLink(' Batch processing').click()584 >>> browser.getLink('Process data').click() 518 585 >>> button = lookup_submit_value( 519 586 ... 'select', 'newfaculties_zope.mgr.create.pending.csv', browser) … … 551 618 >>> sorted(os.listdir(dc_path + '/finished')) 552 619 ['certificates_zope.mgr.create.finished.csv', ..., 553 'newfaculties_zope.mgr.create.finished.csv', 554 'newfaculties_zope.mgr.csv'] 555 620 'users_zope.mgr.create.finished.csv', 'users_zope.mgr.csv'] 621 622 Processed (finished) Files 623 ========================== 624 625 >>> browser.open('http://localhost/app/datacenter/processed') 626 >>> '<a href="download?filename=finished/certificates_zope.mgr.csv">' in browser.contents 627 True 556 628 557 629 Log Files
Note: See TracChangeset for help on using the changeset viewer.