Uploaded image for project: 'Folio Automation Testing'
  1. Folio Automation Testing
  2. FAT-1691

Interactors from stripes-testing cannot be imported by cypress tests in other packages

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • TBD
    • Resolution: Unresolved
    • None
    • AQA
    • TBD

    Description

      Steps to reproduce:

      • npm init a new empty package
      • install cypress and @folio/stripes-testing
      • import { Button } from '@folio/stripes-testing/interactors'; in a cypress test and run it

      You'll find that it chokes on optional chaining (eg. ?.) in one of the other interactors:

      Error: Webpack Compilation Error
      ../node_modules/@folio/stripes-testing/interactors/quickMarcEditor.js 18:67
      Module parse failed: Unexpected token (18:67)

      If you copy the interactors directory into your repo and use it from there, it'll work. So what I expect is happening is that Cypress defaults to doing some transpilation on local imports but expects imports from other packages to already be transpiled.

      The really weird part of it for me is this: what is parsing the script that's even complaining about optional chaining? Both the version of node I'm running Cypress from and the version of Chrome it's running the test in support that feature ...so how is this even a problem!?

      TestRail: Results

        Attachments

          Activity

            People

              Dmitry Dmitry Vagin
              jason Jason Skomorowski
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                TestRail: Runs

                  TestRail: Cases