-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sucessfully running Behat scenarios for OAuth sign-in #2
Sucessfully running Behat scenarios for OAuth sign-in #2
Conversation
… successfully with pre-configured resource owner
selenium2: | ||
browser: firefox | ||
wd_host: your_saucelabs_username:your_saucelabs_apikey@ondemand.saucelabs.com/wd/hub | ||
capabilities: { "platform": "Windows 8", "browser": "firefox", "version": "21"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? I was about to try saucelabs again. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is just not necessary for the OAuth testing when using Goutte, but of course using Selenium2/SauceLabs instead is feasible as well.
@headrevision This might be a dumb question, but I'm not sure I get your comment, do we need to have a fake amazon account for tests here? |
Yes, that is right. You need an Amazon account to setup the resource owner (Login with Amazon). The same with Twitter or any other resource owner. |
Hey, removal of testing the real pages is good idea, but instead of removing testing fully, I would vote to use html fixtures instead of real network calls.
What do you think? |
@stloyd You cannot mock/simulate the OAuth 2.0 login process via static pages. Even if you succeeded, you would simply mock your SUT. |
@headrevision I know I can't simulate whole process, I and don't want =) I'm just suggesting the faking it for testing purposes with assumptions we have working & failing connect results. Here is quick description of steps I have in mind: Given I'm logged in as "dummy"
And I'm at connect page
When I click "Connect with Amazon"
Then I see some "Amazon Connect" form
When I connect the account
Then My account is marked as connected
Given I'm logged in as "dummy"
And I'm at connect page
When I click "Connect with Amazon"
Then I see some "Amazon Connect" form
When I decline the connection of account
Then My account is not marked as connected The part below is working on fake data as well as directly on security tokens etc.: Then I see some "Amazon Connect" form
When I decline the connection of account
Then My account is not marked as connected |
@stloyd This way you fake all your |
… array" when there is no parameter with keys "criteria" and "sorting"
Fixed bug that caused an error: "array_merge(): Argument #2 is not an ar...
Fix code after feedback, add ability to disable guest orders
As mentioned in Sylius#354 (comment), the Behat scenarios for testing the OAuth sign-in are to complex/insecure so far. Thus I simply removed the critical ones. I kept only one scenario to test at least the reachability of the resource owner's login page from Sylius. You only need to specify an actual client ID + secret for Login with Amazon (configured with
http://localhost/login/check-amazon
as an allowed return URL) when installing via composer.The use of Amazon serves as a PoC here. We should substitute it with another resource owner and include pre-configured credentials (client ID + secret) in
parameters.yml.dist
. Twitter configured with the Sylius Twitter account? Any other suggestions?