Open pli888 opened 4 years ago
There seems to be a similar problem using the Twitter sign in functionality with the testerbot_unleashed919468 account:
@ok @twitter @done @first-non-js @wip
Scenario: I sign in with Twitter with no existing Gigadb account # features/affiliate-login.feature:40
Given I have a "Twitter" account # AffiliateLoginContext::iHaveAAccount()
But I don't have a Gigadb account for my "Twitter" account email # AffiliateLoginContext::iDonTHaveAGigadbAccountForMyAccountEmail()
When I am on "/site/login" # Behat\MinkExtension\Context\MinkContext::visit()
And I click on the "Twitter" button # AffiliateLoginContext::iClickOnTheButton()
And I sign in to "Twitter" # AffiliateLoginContext::iSignInTo()
And I authorise gigadb for "Twitter" # AffiliateLoginContext::iAuthoriseGigadbFor()
Link with id|title|alt|text "click here to continue" not found. (Behat\Mink\Exception\ElementNotFoundException)
│
│ https://twitter.com/account/login_challenge?platform=web&enc_user_id=AAAAEIAazsIUXyvlXdra2cT9rzA_UGonAZLZ3HJBKjDG3K8nHj_qghhTYCG_0v32kPbLjPhyNg&challenge_type=RetypePhoneNumber&challenge_id=m1gYttLz47i00FaMdWg3Ei0SRKJjKX4kAY%252BA&remember_me=false&redirect_after_login_verification=https%3A%2F%2Fapi.twitter.com%2Foauth%2Fauthenticate%3Foauth_token%3DKucE1AAAAAAA3i8sAAABcRAnvEY
│
└─ @AfterStep # GigadbWebsiteContext::debugStep()
Then I'm logged in into the Gigadb web site # AffiliateLoginContext::iMLoggedInIntoTheGigadbWebSite()
And a new Gigadb account is created with my "Twitter" details # AffiliateLoginContext::aNewGigadbAccountIsCreatedWithMyDetails()
--- Failed scenarios:
features/affiliate-login.feature:40
1 scenario (1 failed)
14 steps (11 passed, 1 failed, 2 skipped)
0m18.21s (17.98Mb)
Using another Twitter account allows this Behat test to pass. The problem might because the testerbot_unleashed919468 account needs to undergo some Twitter re-verification process.
There's also a problem with sign in using LinkedIn:
Running acceptance tests
+ [[ dev == \d\e\v ]]
+ bin/behat --tags '@ok&&~@facebook&&@wip' -v --stop-on-failure
@login @affiliate-login @issue-64 @ok-docker
Feature: sign in into the gigadb website with my social media credentials
AS an author,
I WANT TO sign in to the gigadb website with my social media credentials
SO THAT I can upload and manage the datasets for my papers
Background: # features/affiliate-login.feature:7
Given test users are loaded # AffiliateLoginContext::testUsersAreLoaded()
And Gigadb has a "Facebook" API keys # AffiliateLoginContext::gigadbHasAApiKeys()
And Gigadb has a "Google" API keys # AffiliateLoginContext::gigadbHasAApiKeys()
And Gigadb has a "Twitter" API keys # AffiliateLoginContext::gigadbHasAApiKeys()
And Gigadb has a "LinkedIn" API keys # AffiliateLoginContext::gigadbHasAApiKeys()
And Gigadb has a "Orcid" API keys # AffiliateLoginContext::gigadbHasAApiKeys()
┌─ @BeforeScenario @login # AffiliateLoginContext::initialize_session()
│
│ Terminating DB Backend... Removing Created Users... Restarting php container for deployment project...
│
│
@ok @linkedin @javascript @done @wip
Scenario: I sign in with LinkedIn with no existing Gigadb account # features/affiliate-login.feature:51
Given I have a "LinkedIn" account # AffiliateLoginContext::iHaveAAccount()
But I don't have a Gigadb account for my "LinkedIn" account email # AffiliateLoginContext::iDonTHaveAGigadbAccountForMyAccountEmail()
When I am on "/site/login" # Behat\MinkExtension\Context\MinkContext::visit()
And I click on the "LinkedIn" button # AffiliateLoginContext::iClickOnTheButton()
And I sign in to "LinkedIn" # AffiliateLoginContext::iSignInTo()
Form field with id|name|label|value|placeholder "session_key" not found. (Behat\Mink\Exception\ElementNotFoundException)
│
│ http://gigadb.dev/
│
└─ @AfterStep # GigadbWebsiteContext::debugStep()
And I authorise gigadb for "LinkedIn" # AffiliateLoginContext::iAuthoriseGigadbFor()
Then I'm logged in into the Gigadb web site # AffiliateLoginContext::iMLoggedInIntoTheGigadbWebSite()
And a new Gigadb account is created with my "LinkedIn" details # AffiliateLoginContext::aNewGigadbAccountIsCreatedWithMyDetails()
--- Failed scenarios:
features/affiliate-login.feature:51
1 scenario (1 failed)
14 steps (10 passed, 1 failed, 3 skipped)
0m15.48s (17.20Mb)
I wonder if this problem is caused by a move from version 1 of the LinkedIn API to version 2.
I wonder if this problem is caused by a move from version 1 of the LinkedIn API to version 2.
The broken LinkedIn acceptance test seems to be caused by the fact that this affiliate sign in functionality was using v1 of the LinkedIn API which has been deprecated since May 2019 and can have issues if still used.
The solution is to move to LinkedIn v2 API. The PHP package opauth/linkedin will need to be upgraded from 0.2.0 to 0.3.0 with the latter version being able to handle LinkedIn v2 API.
Hi @pli888
The automated testing at integration and acceptance level of affiliate signin with social media services in general but particularly with Google is very hard to do and breaks easily because social media services actively deter and sabotage automation of their sign in process as counter-measure to hacking and account-hijacking.
Facebook and LinkedIn allow setting up test accounts, but we can't do that with Google and Twitter.
Also the latter two need manual authentication first (and from time to time if the service thinks there's fraud like when developer from different countries running the tests) from the same computer intended to run the automation, which you cannot do if you are on CI (that's why affiliate-login tests are not run on CI) or if you don't have access ot the email account used (seems like what happened to you with Twitter).
Additional problem is that Google (and LinkedIn IIRC) adapt their interface to the language of the geo location of the person connecting. So tests need to find form element whatever language of the interface when developers are scattered around the world.
Last problem is the fact that the oauth library (opauth) used in Gigadb website is old and barely maintained.
Going forward, this is I think how we should approach this:
Alternative to the first point is to let each developer use their own social media account, but that doesn't work for running these tests on CI.
This all sounds very time-consuming. Given the very small numbers of users expected to use these affiliate log-in options, is there a simpler quicker fix that will allow you to work on the many other tasks that have a bigger impact? Perhaps just comment out the troublesome options and allow only linkedin and facebook if they work?
Given the very small numbers of users expected to use these affiliate log-in options, is there a simpler quicker fix that will allow you to work on the many other tasks that have a bigger impact? Perhaps just comment out the troublesome options and allow only linkedin and facebook if they work?
@only1chunts I believe @rija is describing some work to be done in the future. I have already created a pull request #447 that provides a fix for the LinkedIn affiliate sign in functionality and its acceptance test for the time being, .
Any acceptance test checking the functionality of the ORCID affiliate sign on will fail because the ORCID sign in button on the /site/login
page has been commented out by Jesse:
@ok @orcid @javascript @done @wip
Scenario: I sign in with ORCID with no existing Gigadb account # features/affiliate-login.feature:62
Given I have a "Orcid" account # AffiliateLoginContext::iHaveAAccount()
But I don't have a Gigadb account for my "Orcid" account email # AffiliateLoginContext::iDonTHaveAGigadbAccountForMyAccountEmail()
When I am on "/site/login" # Behat\MinkExtension\Context\MinkContext::visit()
And I click on the "ORCID" button # AffiliateLoginContext::iClickOnTheButton()
Link with id|title|alt|text "ORCID" not found. (Behat\Mink\Exception\ElementNotFoundException)
│
│ http://gigadb.dev/site/login
│
└─ @AfterStep # GigadbWebsiteContext::debugStep()
And I sign in to "Orcid" # AffiliateLoginContext::iSignInTo()
And I authorise gigadb for "Orcid" # AffiliateLoginContext::iAuthoriseGigadbFor()
Then I'm logged in into the Gigadb web site # AffiliateLoginContext::iMLoggedInIntoTheGigadbWebSite()
And a new Gigadb account is created with my "Orcid" details # AffiliateLoginContext::aNewGigadbAccountIsCreatedWithMyDetails()
--- Failed scenarios:
features/affiliate-login.feature:62
1 scenario (1 failed)
The reason why ORCID login has been disabled is because extra coding is required to retrieve the user's email address from the ORCID API to be stored in the GigaDB - see #64. N.B. our paid membership of ORCID allows us to retrieve email addresses now.
Since all ORCID acceptance tests are failing because the ORCID sign in button has been commented out, they will not be executed.
The Google affiliate sign in Behat test is broken when using the
testerbotunleashed919468
sign in credentials. Here is the error output:If the credentials from another Google account is used then the test passes:
@rija Looks like the
testerbotunleashed919468
account needs to undergo some verification process with Google?