~mardy/ubuntu-system-settings-online-accounts/2fa-1541274

« back to all changes in this revision

Viewing changes to tests/online-accounts-ui/qml/tst_SignOnUiDialog.qml

  • Committer: Alberto Mardegan
  • Date: 2016-02-04 09:25:05 UTC
  • Revision ID: alberto.mardegan@canonical.com-20160204092505-ukvqytwokz8le1tg
Add tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
        id: request
13
13
        property string title
14
14
        property string message
 
15
        property string errorMessage
15
16
        property string loginText
16
17
 
17
18
        property bool queryUserName: false
22
23
        property string passwordText
23
24
        property string password
24
25
 
 
26
        property bool queryTwoFactorAuth: false
 
27
        property string twoFactorAuthText
 
28
        property string twoFactorAuth
 
29
 
25
30
        property string forgotPasswordText
26
31
        property url forgotPasswordUrl
27
32
 
104
109
                        forgotPasswordUrl: "http://localhost/remember",
105
110
                        forgotPasswordText: "Reset your password"
106
111
                    }
 
112
                },
 
113
                {
 
114
                    tag: "2fa",
 
115
                    request: {
 
116
                        queryPassword: true,
 
117
                        passwordText: "What's your password?",
 
118
                        password: "prefilled pw",
 
119
                        queryUserName: true,
 
120
                        userNameText: "What's your name?",
 
121
                        userName: "Tommy",
 
122
                        queryTwoFactorAuth: true,
 
123
                        twoFactorAuthText: "OTP code"
 
124
                    }
107
125
                }
108
126
            ]
109
127
        }
147
165
            compare(forgotPasswordLabel.visible,
148
166
                    request.forgotPasswordUrl.toString() != "")
149
167
 
 
168
            var twoFactorAuthLabel = findChild(page, "twoFactorAuthLabel")
 
169
            verify(twoFactorAuthLabel != null)
 
170
            compare(twoFactorAuthLabel.visible, request.queryTwoFactorAuth)
 
171
 
 
172
            var twoFactorAuthField = findChild(page, "twoFactorAuthField")
 
173
            verify(twoFactorAuthField != null)
 
174
            compare(twoFactorAuthField.visible, request.queryTwoFactorAuth)
 
175
 
150
176
            page.destroy()
151
177
        }
152
178