Support oauth consent workflow for Google accounts
In order to simplify tests written for OAuth related use cases, as a test automation developer I want some general helpers to support giving consent for a specific Google account.
Here's how this might look like:
Scenario “Add Drive storage account”
Given a valid user and password
When I add a new storage account in Drive
Then I should be able to login
And I grant access
Then I see a new folder for the account
This would translate to javascript like:
Scenario('add storage account', function (I, google) {
I.login('app=io.ox/files');
I.click('Add storage account');
I.click('Google Drive');
// execute in scope of google
google.login(google.users[0]);
google.giveConsent();
// or reject using google.dontGiveConsent();
I.see('My Google Account', '.folder-tree');
}
Something similar would then work for Calendar and Address Book apps.