Giter VIP home page Giter VIP logo

spectron-example's Introduction

根据这篇文章使用Mocha+spectron测试Electron打包的桌面版程序(2)PO模型,结合spectron官方文档mochawesomemocha configuration file对electron桌面APP的UI自动化测试。

  1. 环境

[email protected]

[email protected]

[email protected]

[email protected]

电脑环境: win10 64位

  1. 浏览器版本和驱动一致,否则会报错
Error: Failed to create session.
session not created: This version of ChromeDriver only supports Chrome version 91
Current browser version is 80.0.3987.165 with binary path d:\study\spcetron\node_modules\spectron\lib\launcher.bat

解决方案1(采用此方案):

替换 \node_modules\electron-chromedriver\bin 下的 chromedriver.exe为对应版本(80.0.3987.165)的驱动

采用该方案原因:app里的浏览器版本是开发写死的改不动...

chromedriver下载

解决方案2:

下载对应的浏览器版本(80.0.3987.165)

  1. 运行

mocha runtest

原本的命令: mocha test --reporter mochawesome --reporter-options reportFilename=customReportFilename,overwrite=false (鬼记得住...)

后面发现mochawesome必须依赖mocha存在,mochawesome又没有配置文件,去看了下mocha文档发现有configuration file,然后又找到了sample,果然有reporter配置参数...

如果您有任何问题...请先google...

If you have any questions... Please Google first...

spectron-example's People

Contributors

cxzcxzxcxzcxz avatar tester-dolores avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.