简体   繁体   中英

Cypress Testing on spreadJS with canvas

I'm trying to automate using cypress tests on spread JS that is built on canvas. I learnt that the spreadJS instance should be initialised but have no luck as of now. Do we have to use the spreadJS key as well to initialise or can it be done without?

Furthermore, I did come across some selenium and protractor codes but they weren't very helpful to what i'm trying to achieve. I wonder if it's just me. Appreciate if you could share any code snippet related to my query above.

Steps followed:

  1. Go to the page that brings up the spreadsheet (grapeCity)
  2. Attempt to do a search on the spreadsheet (Search should be on all the cells)
  3. Return results based on the search

Following is a sample code snippet used in attempt to verifying the instance but unfortunately no luck.

let spread = new GC.Spread.Sheets.findControl(<host>);
let sheet = spread.getActiveSheet().getRange(5, 10);
console.log(sheet)

Actual Result: I get the error "TypeError: Cannot read property 'getActiveSheet' of undefined"

Expected Results: Should be able to retrieve data from the spreadJS that is built in on a website

findControl is a static method, no need for "new" something like this var spread = GC.Spread.Sheets.findControl(document.getElementById('ss'));

hope this helps.
GrapeCity SpreadJS team.

Most complete Excel-like spreadsheet for JavaScript

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM