ExcelO Download does not behave the same in automated tests versus manual usage

Posted by: sjs-user on 4 March 2024, 1:50 am EST

  • Posted 4 March 2024, 1:50 am EST

    Hello SpreadJS Suppor team,

    I hope this finds you well.

    We’ve recently experienced a bug where we were not correctly applying the license key to the ExcelIO package, which lead to the xlsx file being generated but only containing the error message: “You need a valid license key to run SpreadJS Excel IO. Temporary keys are available for evaluation. If you purchased a license, your key is in your purchase confirmation email. Email us.sales@grapecity.com if you need assistance.”

    I’ve since repaired the issue and are now looking at creating automated tests that confirm that the license key is correctly assigned and the file contains the content we’re expecting.

    But when running the automated tests (through Cypress, if that matters), the downloaded file contains the full content, even when pointed at a deployment in which the license is not applied properly and the error from above is reproducible when accessing the website manually. This happens using both SpreadJS 15 and 16.

    Does SpreadJS ignore licensing when it detects Cypress? How can I reproduce the above behaviour automatically? Any guidance would be helpful.

    Many thanks.

  • Posted 5 March 2024, 1:20 am EST

    Hi,

    When the SpreadJS application is run locally or when deployed on the “localhost”, then only the LicenseKey is not required. If the application is deployed on any other server than localhost, and if the License Key for the ExcelIO is not set, then it should generated the error message that you have mentioned.

    SpreadJS and ExcelIO license is not affected by the Cpress. Could you kindly share us a sample replicating the issue (that the downloaded file contains the content if the license key is not applied) so that we could investigate the issue at our end and could assist you accordingly?

    Also, kindly share the hostname on which you have deployed the application. With the SpreadJS V16, we have introduced the new SJSIO for import/export and it is recommended to you the new SJSIO instead of the ExcelIO. In the new SJSIO, you only have to set the License Key for the SpreadJS. In ExcelIO, you had to set the License Key for both the SpreadJS and ExcelIO.

    You could refer to the new SJSIO on the following demo: https://developer.mescius.com/spreadjs/demos/features/spreadjs-file-format/overview/purejs

    Regards,

    Ankit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels