Tag: e2e testing

用于Nightwatch.js的MongoDB数据库清理程序

有没有办法在Nightwatch e2etesting之间擦除mongo数据库? 我来自Ruby,在那里你可以configurationRSpec使用一个名为数据库清理包,并在每次testing后擦拭你的数据库,我想知道是否有一个类似的设置存在于JavaScript的生态系统。 我做了一些研究,发现了一个名为node-database-cleaner的看起来很有前途的包,但是目前它正在抛出一个错误。 码: require('mongodb'); const DatabaseCleaner = require('database-cleaner'); const databaseCleaner = new DatabaseCleaner('mongodb'); …test assertions databaseCleaner.clean('mongodb://localhost:27017/my-db') 错误: TypeError: db.collections is not a function 我不一定会使用node-database-cleaner,无论使用什么库,我都会对任何解决scheme感兴趣。

量angular器插件 – 辅助function – AssertionError:path必须是一个string

我正在尝试使用可用于量angular器的插件。 例如(辅助function,控制台等)。 但是,当我尝试运行E2Etesting失败,出现以下错误信息。 **[launcher] Error: AssertionError: path must be a string at Module.require (module.js:362:3) at require (module.js:380:17) at new Plugins (/home/protractor-git/beta- e2e/node_modules/protractor/lib/plugins.js:39:29) at driverprovider_.setupEnv.then.then.then.then.frameworkPath (/home/protractor-git/beta-e2e/node_modules/protractor/lib/runner.js:257:15) at _fulfilled (/home/protractor-git/beta-e2e/node_modules/protractor/node_modules/q/q.js:797:54) at self.promiseDispatch.done (/home/protractor-git/beta-e2e/node_modules/protractor/node_modules/q/q.js:826:30)** Config.js中的插件configuration如下所示。 plugins: [ { chromeA11YDevTools: { treatWarningsAsFailures: true }, path: 'node_modules/protractor.plugins/accessiblity' }, { path: 'node_modules/protractor/plugins/console', failOnWarning: false , failOnError: true } ] package.json,具有“accessibility-developer-tools”:“^ 2.6.0”作为Dev […]

量angular器:text.indexOf(…).isDisplayed不是一个函数

我知道这已经被问了几次,即使我已经看过这些问题,我不知道如何解决这个问题。 我正在检查文本“EUR”是否包含在一个名为“货币”的div中。 以前这个工作对我来说很好,但是我已经开始使用lint了,而且我也遇到了很多这样的错误。 这是我得到的错误Failed: text.indexOf(…).isDisplayed is not a function 这是我的代码 checkBuyerCurrency (text, buyerCurrency) { let currencyPromise = new Promise(function (resolve, reject) { const commonUtils = new CommonUtils(); var EC = protractor.ExpectedConditions; browser.wait(EC.visibilityOf(element(by.className("currency")), 4000)); var checkCurrency = element(by.className("balances")); checkCurrency.getText().then(function (text) { expect (text.indexOf("EUR").isDisplayed()).toBe(true); console.log("EUR only buyer"); }); }); } 我是否需要将textvariables或将其转换为string? 由于我使用Expect语句的方式,我不完全确定如何做到这一点 谢谢你的帮助

我如何使用wdio.conf.js文件来指定哪些e2etesting运行的testing文件夹?

我有一个运行在各种不同模式的应用程序。 这些模式完全改变了用户界面,因此每种模式都需要一套完全不同的E2Etesting。 我为每个模式创build了不同的wdioconfiguration文件,并试图为每个模式指定规格,以便它只运行指定的规格。 不幸的是,这是行不通的。 所以现在有三个wdio.conf文件(所有这些文件都是从wdio.conf.js中inheritance的)以及下面的文件夹结构: +–test +–specs +–browser +–modeA +–testFile.js +–modeB +–testFile.js +–wdio.conf.js | +–wdio.conf.modeA.js | +–wdio.conf.modeB.js 我为每个模式创build了npm命令,如下所示: // (package.json) … "tools:e2e": "./node_modules/.bin/wdio wdio/wdio.conf.js", "tools:e2e:modeA": "./node_modules/.bin/wdio wdio/wdio.conf.modeA.js", "tools:e2e:modeB": "./node_modules/.bin/wdio wdio/wdio.conf.modeB.js", … 好的,所以在每个wdio.conf文件中,我指定了一些可能在每种不同模式下都改变的variables(这两个variables都是从wdio.confinheritance的),但是我想更改运行的文件,基本上只指定我只想运行当我运行npm run tools:e2e:modeA ,在modeA的文件夹中的文件,只运行modeB的文件,当我运行npm run tools:e2e:modeB 。 我试图通过在每个conf文件中定义规格来完成这个工作,如下所示: // wdio.conf.js specs: [ './wdio/test/specs/browser/**/*.js' ], – // wdio.conf.modeA.js specs: [ './wdio/test/specs/browser/modeA/*.js' ], exclude: [ './wdio/test/specs/browser/modeB/*.js' […]

在cucumberjs,量angular器快速失败

我添加了失败的快速到我的cucumberOpts如下: cucumberOpts: { require: [ conf.paths.e2e + '/utilities/hooks.js', ], format: 'pretty', 'fail-fast': true }, 我有我所有的testing在这样的path:C:/testing/ *。function 我像这样运行我的testing: protractor protractor.conf.js 这工作正常,因为它会在出现错误时立即停止testing。 但是我正在使用像Bamboo这样的CI服务器运行这些testing,我希望能够提供快速的反馈,同时继续运行其余的testing。 所以,如果我4 tests in total有4 tests in total , if the first test fails , I want to fail-fast on that first test if the first test fails ,那么I want to continue running the other […]