1 | package gscf |
---|
2 | |
---|
3 | /** |
---|
4 | * Test editting the study that was created in CreateStudyWebTests.groovy |
---|
5 | * @Author Jeroen Wesbeek |
---|
6 | * @Since 20110113 |
---|
7 | * |
---|
8 | * Revision information: |
---|
9 | * $Rev: 1590 $ |
---|
10 | * $Author: work@osx.eu $ |
---|
11 | * $Date: 2011-03-04 15:28:45 +0000 (vr, 04 mrt 2011) $ |
---|
12 | */ |
---|
13 | class EditStudyWebTests extends grails.util.WebTest { |
---|
14 | void testEditStudy001() { |
---|
15 | // make sure Canoo waits for AJAX calls |
---|
16 | config(easyajax: true) |
---|
17 | |
---|
18 | // login |
---|
19 | invoke "http://localhost:8080/gscf/?nostats=true" |
---|
20 | clickLink(description: "Click link: Log In | Register", htmlId: "open") |
---|
21 | setInputField(name: "j_username", value: "user") |
---|
22 | setInputField(description: "Set password field j_password: useR123!", name: "j_password", value: "useR123!") |
---|
23 | clickButton "Login" |
---|
24 | |
---|
25 | // navigate to the edit study wizard |
---|
26 | clickLink "Studies" |
---|
27 | clickLink "Edit a study" |
---|
28 | |
---|
29 | // select the study which was created in CreateStudyWebTests.groovy |
---|
30 | // and load it |
---|
31 | setSelectField(name: "study", text: "Test create study") |
---|
32 | clickButton "next »" |
---|
33 | |
---|
34 | // change some study fields |
---|
35 | setInputField(name: "title", value: "Test edit study") |
---|
36 | setInputField(name: "description", value: "Test study from EditStudyWebTests.testEditStudy001()") |
---|
37 | setInputField(name: "code", value: "TESTEDIT 001") |
---|
38 | |
---|
39 | // and now try to quicksave it |
---|
40 | clickButton "quick save" |
---|
41 | |
---|
42 | // and we should be done, without exceptions |
---|
43 | // verifyText(text:'Done') |
---|
44 | // does not seem to work, also see --> http://grails.1312388.n4.nabble.com/webtest-verifyText-doesn-t-see-AJAX-update-with-easyAjax-td2225674.html |
---|
45 | |
---|
46 | // and view the study |
---|
47 | clickLink "view the study" |
---|
48 | } |
---|
49 | } |
---|