[英]Cypress Testing on spreadJS with canvas
I'm trying to automate using cypress tests on spread JS that is built on canvas. 我正在尝试在基于画布的传播JS上自动使用赛普拉斯测试。 I learnt that the spreadJS instance should be initialised but have no luck as of now.
我了解到,spreadJS实例应该初始化,但到目前为止还没有运气。 Do we have to use the spreadJS key as well to initialise or can it be done without?
我们是否还必须使用spreadJS密钥进行初始化,还是可以不用它来完成?
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: 遵循的步骤:
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" 实际结果:我收到错误“ TypeError:无法读取未定义的属性'getActiveSheet'”
Expected Results: Should be able to retrieve data from the spreadJS that is built in on a website 预期结果:应该能够从网站上内置的spreadJS中检索数据
findControl is a static method, no need for "new" something like this var spread = GC.Spread.Sheets.findControl(document.getElementById('ss')); findControl是静态方法,不需要像这样的“新”变量var spread = GC.Spread.Sheets.findControl(document.getElementById('ss'));
hope this helps. 希望这可以帮助。
GrapeCity SpreadJS team. GrapeCity SpreadJS团队。
Most complete Excel-like spreadsheet for JavaScript 适用于JavaScript的最完整的类似Excel的电子表格
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.