Skip to content
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

Writing tests to test the orcid API and the user interface. #216

Open
withanage opened this issue Aug 5, 2022 · 0 comments
Open

Writing tests to test the orcid API and the user interface. #216

withanage opened this issue Aug 5, 2022 · 0 comments
Assignees

Comments

@withanage
Copy link
Member

withanage commented Aug 5, 2022

Issue

  • Manual testing of Orcid functions is resource intensive (E-mail send, E-mail verification through malinator, publishing article, checking pushed orcid record)

Describe the solution you'd like

  • Automation of the above tasks

Notes

How to resolve cross-domain errors in cypress

  • Cypress version 9.6+

  • cypress.config.js

    • experimentalSessionAndOrigin : true, "chromeWebSecurity": false
  • Tested with Chome v103, Electron v102

  • Example test scrpit

describe('Multi-Domain Demo', function () {

    const getIframeBodyById = (id) => {
        return cy.get('iframe[id="' + id + '"]')
            .its('0.contentDocument.body').should('not.be.empty')
            .then(cy.wrap)
    }

    it('Verify Orcid User by Email', function () {
        const publicMailBox = 'https://mailinator.com/v4/public/inboxes.jsp?to=coauthor';
        cy.visit(publicMailBox)
        // open  the latest email
        cy.get('.os-content > .table-striped > tbody > .ng-scope > .ng-binding:nth-child(3)')
            .first()
            .should('be.visible')
            .click()
        // get email  from the iframe
        getIframeBodyById('html_msg_body')
            .contains('Register or Connect your ORCID iD').should('have.attr', 'href')
            .then((href) => {
                // cross domain request
                cy.origin('https://sandbox.orcid.org', {args: {href}}, ({href}) => {
                    cy.visit('/signin')
                    cy.wait(10)
                    cy.get('[id=username]').type("coauthor@mailinator.com")
                    cy.get('[id=password]').type("c")
                    cy.get('[id=signin-button]').click()
                    cy.wait(10)
                    cy.visit(href)
               })
            })
    })
})
orcid_cypress.mp4
@withanage withanage added this to the 1.1.3.4 milestone Aug 12, 2022
@withanage withanage self-assigned this Aug 12, 2022
@withanage withanage modified the milestones: 1.1.3.4, 1.1.3.5 Aug 22, 2022
withanage added a commit to withanage/ojs that referenced this issue Sep 5, 2022
withanage added a commit to withanage/ojs that referenced this issue Sep 5, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 16, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 16, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 17, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 17, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 17, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 17, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 17, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 17, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 17, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 17, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 17, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 17, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 17, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 24, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 24, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 25, 2022
withanage added a commit to withanage/ojs that referenced this issue Oct 25, 2022
@withanage withanage removed this from the 1.1.3.5 milestone Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant