Changeset 6613 for main/waeup.sirp/trunk/src/waeup/sirp/browser
- Timestamp:
- 15 Aug 2011, 07:13:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt
r6611 r6613 470 470 ... 471 471 472 We can grant local roles: 473 474 >>> browser.open('http://localhost/myuniversity/faculties/TF/TD/manage') 475 >>> browser.getControl(name="user").value = ['bob'] 476 >>> browser.getControl(name="local_role").value = ['waeup.local.DepartmentOfficer'] 477 >>> browser.getControl("Add local role").click() 478 >>> print browser.contents 479 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 480 ...<td>bob</td> 481 ... 482 483 The local role can be removed again: 484 485 >>> browser.open('http://localhost/myuniversity/faculties/TF/TD/manage') 486 >>> ctrl = browser.getControl(name='role_id') 487 >>> browser.getControl("Remove selected local roles").click() 488 >>> print browser.contents 489 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 490 ...No local role selected... 491 ... 492 493 >>> browser.open('http://localhost/myuniversity/faculties/TF/TD/manage') 494 >>> ctrl = browser.getControl(name='role_id') 495 >>> ctrl.getControl(value='bob|waeup.local.DepartmentOfficer').selected = True 496 >>> browser.getControl("Remove selected local roles").click() 497 >>> print browser.contents 498 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 499 ...Successfully removed:... 500 ... 501 472 502 Deleting departments 473 503 -------------------- … … 519 549 520 550 >>> dept_url = 'http://localhost/myuniversity/faculties/TF/TD' 521 >>> browser.open(dept_url + '/addcourse') 551 >>> browser.open(dept_url + '/manage') 552 >>> browser.getControl('Add course').click() 522 553 >>> print browser.contents 523 554 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... … … 651 682 True 652 683 684 >>> browser.getControl('Cancel', index=0).click() 685 >>> browser.getLink('Manage department').click() 686 >>> browser.getControl('Remove selected courses').click() 687 >>> 'No course selected' in browser.contents 688 True 689 653 690 >>> browser.getControl(name='val_id').getControl(value='COURSE1').selected = True 654 691 >>> browser.getControl('Remove selected courses').click() … … 681 718 682 719 >>> dept_url = 'http://localhost/myuniversity/faculties/TF/TD' 683 >>> browser.open(dept_url + '/addcertificate') 720 >>> browser.open(dept_url + '/manage') 721 >>> browser.getControl('Add certificate').click() 684 722 >>> print browser.contents 685 723 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... … … 794 832 >>> browser.open('http://localhost/myuniversity/faculties/TF/TD/@@manage#tab-3') 795 833 >>> 'My renamed cert' in browser.contents 834 True 835 836 >>> browser.getControl('Remove selected certificates').click() 837 >>> 'No certificate selected' in browser.contents 796 838 True 797 839 … … 859 901 860 902 >>> cert_url = dept_url + '/certificates/CERT1' 861 >>> browser.open(cert_url + '/addcertificatecourse') 903 >>> browser.open(cert_url + '/manage') 904 >>> browser.getControl('Add course referrer').click() 862 905 >>> print browser.contents 863 906 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... … … 887 930 'http://localhost/my...sity/faculties/TF/TD/certificates/CERT1/COURSE1_100' 888 931 932 We can't add the same certificatecourse twice: 933 934 >>> cert_url = dept_url + '/certificates/CERT1' 935 >>> browser.open(cert_url + '/manage') 936 >>> browser.getControl('Add course referrer').click() 937 >>> ctrl = browser.getControl(name='form.course') 938 >>> ctrl.getControl('COURSE1').selected = True 939 >>> browser.getControl(name='form.level').value = ['100'] 940 >>> browser.getControl('Add course referrer').click() 941 >>> 'The chosen course referrer is already' in browser.contents 942 True 943 889 944 When we started to add a new certificatecourse, we can also cancel the 890 945 process before submitting. This will bring us back to the certificate … … 906 961 >>> browser.getLink('Edit course referrer').click() 907 962 963 If we just click 'Save and return' nothing will change: 964 965 >>> browser.getControl("Save and return").click() 966 >>> browser.getLink('COURSE1_100').click() 967 >>> browser.url 968 'http://localhost/myun.../TF/TD/certificates/CERT1/COURSE1_100' 969 908 970 Let's set a new level (it was 100 before) and save the form. This will 909 971 bring us to the certificate index page afterwards: 910 972 973 >>> browser.open(cert_url + '/COURSE1_100/manage') 911 974 >>> browser.getControl(name='form.level').value = ['200'] 912 >>> ctrl = browser.getControl("Save and return") 913 >>> ctrl.click() 975 >>> browser.getControl("Save and return").click() 914 976 915 977 As we changed the level, also the URL will change: … … 944 1006 >>> 'COURSE1_200</a>' in browser.contents 945 1007 True 946 1008 >>> browser.getControl('Remove selected course referrers').click() 1009 >>> 'No course referrer selected' in browser.contents 1010 True 947 1011 >>> browser.getControl(name='val_id').getControl(value='COURSE1_200').selected = True 948 1012 >>> browser.getControl('Remove selected course referrers').click()
Note: See TracChangeset for help on using the changeset viewer.