首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何安装谱并在其上开始编写脚本?

如何安装谱并在其上开始编写脚本?
EN

Stack Overflow用户
提问于 2018-09-06 12:17:05
回答 1查看 705关注 0票数 0

获得了最近的需求,在这里,我需要做测试自动化的后端节点js应用程序使用谱。我想知道要达到同样的目的需要什么编程技能?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-09-10 03:52:34

https://electronjs.org/spectron上查找谱文档

安装

代码语言:javascript
复制
npm install --save-dev spectron

示例测试文件如下所示

代码语言:javascript
复制
const Application = require('spectron').Application
const assert = require('assert')
const electronPath = require('electron')
const path = require('path')

describe('Application launch', function () {
  this.timeout(10000)

  beforeEach(function () {
    this.app = new Application({

      path: electronPath,


      args: [path.join(__dirname, '..')]
    })
    return this.app.start()
  })

  afterEach(function () {
    if (this.app && this.app.isRunning()) {
      return this.app.stop()
    }
  })

  it('shows an initial window', function () {
    return this.app.client.getWindowCount().then(function (count) {
      assert.equal(count, 1)

    })
  })
})

谱可以与任何测试框架一起工作。我更喜欢用摩卡。

克隆此项目以获取更多信息https://github.com/electron/spectron

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52203930

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档