@@ -65,6 +65,11 @@ def step(context):
6565 startClient ()
6666
6767
68+ @When ('the user starts the client' )
69+ def step (context ):
70+ startClient ()
71+
72+
6873@When ('the user opens the add-account dialog' )
6974def step (context ):
7075 Toolbar .openNewAccountSetup ()
@@ -74,6 +79,8 @@ def step(context):
7479def step (context ):
7580 account_details = getClientDetails (context )
7681 AccountConnectionWizard .addAccount (account_details )
82+ # wait for files to sync
83+ waitForInitialSyncToComplete (getResourcePath ('/' , account_details ["user" ]))
7784
7885
7986@Given ('the user has entered the following account information:' )
@@ -117,6 +124,16 @@ def step(context, username):
117124 waitForInitialSyncToComplete (getResourcePath ('/' , username ))
118125
119126
127+ @When ('user "|any|" logs in to the client-UI with oauth2' )
128+ def step (context , username ):
129+ AccountSetting .login ()
130+ password = getPasswordForUser (username )
131+ EnterPassword .reLogin (username , password , True )
132+
133+ # wait for files to sync
134+ waitForInitialSyncToComplete (getResourcePath ('/' , username ))
135+
136+
120137@When ('user "|any|" opens login dialog' )
121138def step (context , username ):
122139 AccountSetting .login ()
@@ -131,11 +148,8 @@ def step(context, username, password):
131148def step (context , username ):
132149 displayname = getDisplaynameForUser (username )
133150 server = get_config ('localBackendUrl' )
134- test .compare (
135- AccountSetting .waitUntilAccountIsConnected (displayname , server ),
136- True ,
137- "User '%s' is connected" % username ,
138- )
151+ AccountSetting .waitUntilAccountIsConnected (displayname , server )
152+ AccountSetting .wait_until_sync_folder_is_configured ()
139153
140154
141155@When ('the user removes the connection for user "|any|" and host |any|' )
@@ -230,14 +244,13 @@ def step(context):
230244 test .compare (True , AccountSetting .isLogDialogVisible (), "Log dialog is opened" )
231245
232246
233- @When ('the user adds the following account with oauth2 enabled :' )
247+ @When ('the user adds the following oauth2 account :' )
234248def step (context ):
235249 account_details = getClientDetails (context )
236- AccountConnectionWizard .addServer (account_details ['server' ])
237- AccountConnectionWizard .oauthLogin (
238- account_details ['user' ], account_details ['password' ]
239- )
240- AccountConnectionWizard .nextStep ()
250+ account_details .update ({'oauth' : True })
251+ AccountConnectionWizard .addAccount (account_details )
252+ # wait for files to sync
253+ waitForInitialSyncToComplete (getResourcePath ('/' , account_details ["user" ]))
241254
242255
243256@When ('the user cancels the sync connection wizard' )
@@ -253,3 +266,8 @@ def step(context):
253266@When ('user "|any|" logs out from the login required dialog' )
254267def step (context , username ):
255268 AccountSetting .logoutFromLoginRequiredDialog ()
269+
270+
271+ @When ("the user quits the client" )
272+ def step (context ):
273+ Toolbar .quit_owncloud ()
0 commit comments