Ignore:
Timestamp:
20 Sep 2012, 08:49:37 (12 years ago)
Author:
uli
Message:

Merge changes from update branch (includes trunk changes until r9107).

Location:
main/waeup.kofa/branches/uli-zc-async
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/uli-zc-async

  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/batchprocessing.txt

    r8472 r9209  
    7575
    7676    >>> import cStringIO
    77     >>> browser.getLink('Upload CSV file').click()
     77    >>> browser.getLink('Upload data').click()
    7878    >>> filecontents = cStringIO.StringIO(
    7979    ...   open('faculties.csv', 'rb').read())
     
    8484Step 1: start batch processing:
    8585
    86     >>> browser.getLink('Batch processing').click()
     86    >>> browser.getLink('Process data').click()
    8787    >>> button = lookup_submit_value(
    8888    ...   'select', 'faculties_zope.mgr.csv', browser)
     
    9797    'Course Processor', 'CourseTicket Processor',
    9898    'Department Processor', 'Faculty Processor',
    99     'Payment Processor', 'Student Processor',
     99    'Hostel Processor',
     100    'Student Payment Processor', 'Student Processor',
    100101    'StudentStudyCourse Processor (update only)',
    101     'StudentStudyLevel Processor', 'Verdict Processor (update only)']
     102    'StudentStudyLevel Processor',
     103    'User Processor',
     104    'Verdict Processor (update only)']
    102105
    103106    >>> importerselect.getControl('Faculty Processor').selected = True
     
    175178
    176179    >>> import cStringIO
    177     >>> browser.getLink('Upload CSV file').click()
     180    >>> browser.getLink('Upload data').click()
    178181    >>> filecontents = cStringIO.StringIO(
    179182    ...   open('departments.csv', 'rb').read())
     
    184187Step 1: start batch processing:
    185188
    186     >>> browser.getLink('Batch processing').click()
     189    >>> browser.getLink('Process data').click()
    187190    >>> button = lookup_submit_value(
    188191    ...   'select', 'departments_zope.mgr.csv', browser)
     
    240243
    241244    >>> import cStringIO
    242     >>> browser.getLink('Upload CSV file').click()
     245    >>> browser.getLink('Upload data').click()
    243246    >>> filecontents = cStringIO.StringIO(
    244247    ...   open('courses.csv', 'rb').read())
     
    249252Step 1: start batch processing:
    250253
    251     >>> browser.getLink('Batch processing').click()
     254    >>> browser.getLink('Process data').click()
    252255    >>> button = lookup_submit_value(
    253256    ...   'select', 'courses_zope.mgr.csv', browser)
     
    305308
    306309    >>> import cStringIO
    307     >>> browser.getLink('Upload CSV file').click()
     310    >>> browser.getLink('Upload data').click()
    308311    >>> filecontents = cStringIO.StringIO(
    309312    ...   open('certificates.csv', 'rb').read())
     
    314317Step 1: start batch processing:
    315318
    316     >>> browser.getLink('Batch processing').click()
     319    >>> browser.getLink('Process data').click()
    317320    >>> button = lookup_submit_value(
    318321    ...   'select', 'certificates_zope.mgr.csv', browser)
     
    371374
    372375    >>> import cStringIO
    373     >>> browser.getLink('Upload CSV file').click()
     376    >>> browser.getLink('Upload data').click()
    374377    >>> filecontents = cStringIO.StringIO(
    375378    ...   open('mycertcourses.csv', 'rb').read())
     
    380383Step 1: start batch processing:
    381384
    382     >>> browser.getLink('Batch processing').click()
     385    >>> browser.getLink('Process data').click()
    383386    >>> button = lookup_submit_value(
    384387    ...   'select', 'mycertcourses_zope.mgr.csv', browser)
     
    420423    ...File:...mycertcourses_zope.mgr.csv...
    421424
     425Batch processing users
     426======================
     427
     428    >>> browser.open('http://localhost/app/datacenter')
     429
     430Prepare 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
     438Upload 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
     448Step 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
     455Step 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
     463Step 3: Fix headerlines
     464
     465We 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
     473The submit button is enabled:
     474
     475    >>> browser.getControl('Perform import').disabled
     476    False
     477
     478    >>> browser.getControl('Perform import').click()
     479
     480Step 4: See import results
     481
     482The 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...
    422489
    423490Pending files
     
    444511
    445512    >>> import cStringIO
    446     >>> browser.getLink('Upload CSV file').click()
     513    >>> browser.getLink('Upload data').click()
    447514    >>> filecontents = cStringIO.StringIO(
    448515    ...   open('newfaculties.csv', 'rb').read())
     
    453520Step 1: start batch processing:
    454521
    455     >>> browser.getLink('Batch processing').click()
     522    >>> browser.getLink('Process data').click()
    456523    >>> button = lookup_submit_value(
    457524    ...   'select', 'newfaculties_zope.mgr.csv', browser)
     
    515582
    516583    >>> browser.open('http://localhost/app/datacenter')
    517     >>> browser.getLink('Batch processing').click()
     584    >>> browser.getLink('Process data').click()
    518585    >>> button = lookup_submit_value(
    519586    ...   'select', 'newfaculties_zope.mgr.create.pending.csv', browser)
     
    551618    >>> sorted(os.listdir(dc_path + '/finished'))
    552619    ['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
     622Processed (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
    556628
    557629Log Files
Note: See TracChangeset for help on using the changeset viewer.