Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

Create e2e test for login #106

Closed
g-sam opened this issue May 1, 2018 · 13 comments
Closed

Create e2e test for login #106

g-sam opened this issue May 1, 2018 · 13 comments
Assignees
Labels
Testing Anything related to testing.

Comments

@g-sam
Copy link
Contributor

g-sam commented May 1, 2018

When an author enters our Orcid login details (sandbox username - elife@mailinator.com - and password), they should be redirected to the dashboard

@g-sam g-sam created this issue from a note in xPub Project (To Do) May 1, 2018
@g-sam g-sam added the Testing Anything related to testing. label May 1, 2018
@jsms90 jsms90 moved this from To Do to In Progress in xPub Project May 8, 2018
@jsms90
Copy link
Contributor

jsms90 commented May 8, 2018

Redirection isn't working in Testcafe - @tamlyn has emailed Orcid to add http://192.168.1.38 to the list of allowed domain names.

Blocked until Orcid has done this.

WIP branch: https://gitlab.coko.foundation/xpub/xpub-elife/tree/e2e-login-test

@jsms90 jsms90 moved this from In Progress to Blocked in xPub Project May 8, 2018
@giorgiosironi
Copy link
Contributor

Just to share information, we use a dummy implementation for end2end tests of the OAuth flow and subsequent calls: https://github.com/elifesciences/orcid-dummy

@rakeshnambiar
Copy link

rakeshnambiar commented May 12, 2018

Hi all, @giorgiosironi , @jsms90 , @g-sam

This is Rakesh from EuropePMC / EMBL-EBI.

I admit TestCafe is a very good tool. However could you please take a look at SerenityJS-BDD framework which built on top of Protractor Automation tool? Please take a look at the xPub demo link and Test script’s git repo details as BDD provides the below listed potential benefits.

  • Non-Technical & Technical people have the visibility on the automated scenarios
  • Test Data is not part of the scripts as it’s mentioned in the feature/gherkin file and need not touch
    the script to updates the Test Data
  • Supports most of the programming/scripting languages including JavaScript & TypeScript
  • Illustrated, narrative Test reports

xPub SerenityJS demo:
https://drive.google.com/open?id=1R5mhYsDGy02Mv0G7rIAQUriOB9qm-wtj

EuropePMC SerenityJS demo:
https://drive.google.com/open?id=1vkxr6zxlD9KpzMWog-PwAn0dSppRStsL

Git repo to the demo Test script
https://github.com/rakeshnambiar/serenityjs.git

BDD blog (In case you would like to know more about BDD)
https://europepmc.github.io/techblog/testing/2018/01/29/behavior-driven-development-in-bioinformatics.html

Thanks

Rakesh

@giorgiosironi
Copy link
Contributor

Hi,
just wanted to make you aware that this repository is dedicated to the eLife's flavor of xpub, so if you are looking to standardize an approach for xpub in general, here may not be the right place.

@rakeshnambiar
Copy link

Hi @giorgiosironi , I accidentally spotted this place. Could you please mention here the right URL, please?

@giorgiosironi
Copy link
Contributor

The other devs mentioned here know better than me where to discuss xpub-wide issues, I'd let them answer this.

@rakeshnambiar
Copy link

Great. Let's wait then :)

@diversemix
Copy link
Contributor

Morning Rakesh!

I would suggest you move this discussion into the generic xpub channel here on mattermost... https://mattermost.coko.foundation/coko/channels/xpub

Specifically target the question to Jure and Tam, as I think this would need a wider chat/discussion. Thanks for your interest!

@rakeshnambiar
Copy link

thanks, @diversemix , I already have done it on last Friday before commenting here :)

@jsms90 jsms90 moved this from Blocked to In Review in xPub Project May 14, 2018
@jsms90
Copy link
Contributor

jsms90 commented May 14, 2018

@jsms90 jsms90 moved this from In Review to In Progress in xPub Project May 15, 2018
@jsms90
Copy link
Contributor

jsms90 commented May 15, 2018

Experiencing an error with this test during the build pipeline:

Failed to complete a request to

   "https://sandbox.orcid.org/oauth/authorize?response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A4000%2Fauth%2Forcid%2Fcallback&scope=%2Fread-limited&client_id=APP-3NPNW44JU9EGUBJ5"
      within the timeout period. The problem may be related to local
      machine's network or firewall settings, server outage, or network
      problems that make the server inaccessible.

Sometimes reproducible locally, sometimes the test passes. We're unsure why this is happening.

We've tried:

Neither of these seem to alleviate the problem.

Next thing to try - using eLife's orcid API dummy & see whether the problem still repeats. If not, our issue may be caused by the Orcid sandbox.

@jsms90
Copy link
Contributor

jsms90 commented May 16, 2018

Hooked this up to orcid-dummy and deleted the lines in the e2e where it simulates typing in the username and password (as the dummy repo doesn't actually display a login screen).

We have run the tests 30 times against the dummy repo & they're passing, which seems to suggest that the issue lies with orcid (?)

We do get selector errors though, which seems to indicate a need to increase the selector timeout

@jsms90 jsms90 moved this from In Progress to In Review in xPub Project May 16, 2018
@jsms90
Copy link
Contributor

jsms90 commented May 16, 2018

Issues sorted. No longer WIP: https://gitlab.coko.foundation/xpub/xpub-elife/merge_requests/54

@jsms90 jsms90 closed this as completed May 21, 2018
xPub Project automation moved this from In Review to Done May 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Testing Anything related to testing.
Projects
xPub Project
  
Done
Development

No branches or pull requests

5 participants