1 | package gscf |
---|
2 | |
---|
3 | import org.dbnp.gdt.* |
---|
4 | |
---|
5 | class ImportWizardWebTests extends grails.util.WebTest { |
---|
6 | |
---|
7 | // Unlike unit tests, functional tests are sometimes sequence dependent. |
---|
8 | // Methods starting with 'test' will be run automatically in alphabetical order. |
---|
9 | // If you require a specific sequence, prefix the method name (following 'test') with a sequence |
---|
10 | // e.g. test001XclassNameXListNewDelete |
---|
11 | |
---|
12 | void testImportWizard() { |
---|
13 | // reset Identity to be able to predict identifiers |
---|
14 | Identity.resetIdentifier() |
---|
15 | |
---|
16 | // make sure Canoo waits for AJAX calls |
---|
17 | config(easyajax: true) |
---|
18 | |
---|
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 | clickLink "Studies" |
---|
26 | clickLink "Import study data" |
---|
27 | |
---|
28 | setSelectField(name: "entity", text: "Study") |
---|
29 | clickButton "next »" |
---|
30 | |
---|
31 | // Set column properties (TemplateFields) |
---|
32 | setSelectField(name: "columnproperty.index.0", text: "startDate") |
---|
33 | setSelectField(name: "columnproperty.index.1", text: "code (IDENTIFIER)") |
---|
34 | setSelectField(name: "columnproperty.index.15", text: "title") |
---|
35 | setSelectField(name: "columnproperty.index.16", text: "description") |
---|
36 | clickButton "next »" |
---|
37 | |
---|
38 | // Validate and store |
---|
39 | clickButton "next »" |
---|
40 | |
---|
41 | |
---|
42 | } |
---|
43 | |
---|
44 | } |
---|