- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我是 Protractor 新手。我将测试数据存储在 Excel 中的多行中。我想为 Excel 中的每一行多次运行相同的规范。可能吗?
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
baseUrl: 'https:somewebsite.com',
capabilities: {
'browserName': (process.env.TEST_BROWSER_NAME || workbook.Sheets[sheetNamelist[sheetNumber]]['N2'].v)
, 'version': (process.env.TEST_BROWSER_VERSION || 'ANY')
, 'shardTestFiles': false
, },
onPrepare: function () {
browser.ignoreSynchronization = true;
},
framework: 'custom'
, frameworkPath: require.resolve('protractor-cucumber-framework'),
specs: [
'../Features/Availity_Login.feature'
]
, exclude: '../Features/database.feature'
, cucumberOpts: {
monochrome: true
, strict: true
, plugin: ["pretty"]
, require: ['../StepDefinitions/*.js', '../Support/*.js']
, tags: '@AllureScenario,@Regression,@ProtractorScenario,~@DatabaseTest' // @DatabaseTest scenario can be included when the username & password of DB have been configured in Support/database.js
}
};
在上面的脚本中,我想多次运行规范,因为我的 Excel 中有多个测试数据。我可以使用模块“xlsjs”读取 Excel 值。循环遍历规范将仅在第一次运行规范。
最佳答案
使用多组数据测试相同的功能只不过是数据驱动方法。为此,我们有 jasmine-data-provider 包,它将帮助您使用 Protractor 进行数据驱动测试。
Code Snippet:
var using = require(‘jasmine-data-provider);
var loginData = require('../example/Test Data/Test.json');
describe('Data driven test spec', function () {
/*define sets of input data as array in method called arrayOfData*/
//OR retrieve all test data and stored into array and the follow below
//approach
function arrayOfData() {
return [
{
"username": "admin",
"passwordField": "admin"
},
{
"username": "admin1",
"passwordField": "admin2"
}
]
} /*below one will loop the test case based on data size and pass single
data set every time till complete the end of array*/
using(arrayofData, function (inputData) {
it('test case logic to be executed for each set of data', function ()
{
browser.get("http://127.0.0.1:8080/#/login");
element(by.model("username")).sendKeys(inputData.username);
element(by.model("password")).sendKeys(inputData.passwordField);
element(by.buttonText("Authenticate")).click();
});
});
});
注意:如果您的计算机上尚未安装 jasmine-data-provider 软件包,请在运行测试脚本之前通过运行以下命令来安装它。
npm install jasmine-data-provider
关于node.js - 如何根据 Excel 值多次运行 Protractor Spec,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38747466/
Hi得到了一个对我来说似乎有效的YAML,但当应用它时它不起作用,我不知道它有什么问题。错误:。Kubeval部署.yaml通过,没有错误
当我通过“rake spec”运行它时,我的一个规范失败了,但当我使用 RSpec 可执行文件“spec”时,它通过了。当我在 ActionMailer View 中使用 url 帮助器时,规范失败。
我对码头公司还是个新手。我使用的是最新版本的Python、Django和Docker。我已经在这个项目上工作了两周了,我已经创建了docker-compose.yml文件,并且已经构建了我的docke
我正在遵循 clojure.spec 的指南 ( http://clojure.org/guides/spec )。我对序列规范的 alt 和 or 之间的差异感到困惑。 对我来说,以下两个示例同样有
当我在我的 Rails 项目中运行 rake spec 时,它会执行所有规范,然后尝试运行测试(如 rake test): $ rake spec ruby -S rspec ./spec/... #
Nestjs:如果 --no-spec 用于禁用规范文件生成,如何生成“spec.ts”文件。我需要测试完整的模块,但我没有 spec.ts 文件。是否有任何机制可以为现有模块生成这些文件。 最佳答案
我是 erlang 编程的新手。我有很多疑问。其中之一是使用-spec。 “-spec”在 Erlang 语法中有什么作用?使用或不使用 -spec 创建函数有什么区别 没有 -spec 的功能 ad
我需要验证已从 json 字符串转换的 clojure 映射的形状。 json 字符串是我正在实现的协议(protocol)的消息。 为此,我正在尝试 clojure.spec.alpha。 我正在使
有没有办法在另一个函数规范中引用一个函数的返回类型规范? defmodule Car do @spec beep(none()) :: String.t def beep do "be
出于学习目的,我正在尝试将 Chef 解释器项目转换为 python 3.4,并尝试将涉及的库转换为最新版本,但是当涉及到 funcparserlib 时,我有点不知所措。 这是 Chef 脚本: f
我正在将一堆旧脚本转换为 Jenkins 管道作业。对于我们的许多脚本,我们使用 JFrog CLI 来处理与 Artifactory 的所有交互。有了 Jenkins 管道,我们现在可以选择通过 A
我使用 RSpec 设置了一个新的 Rails 4 应用程序。但是运行时rake rspec ,所有示例都运行两次: rake spec [deprecated] I18n.enforce_avail
我有 Kubernetes 部署 的 list 。当我尝试从 Azure Devops 部署它时,出现以下错误: error: error validating "/home/vsts/work/r1
为什么使用 Combine(...) 保留空格,而 Keyword(...) 删除这些空格? 我需要保留匹配标记后面的空格。 测试如下: from pyparsing import * def par
以下是使用 time rspec spec 进行的 3 次随机运行对比time bundle exec spec在一个相当简单的 Rails 3 应用程序上。不使用 bundler 始终更快,并且它使
我修改了 Github 上的一个 repo 以集成我的库的 swift 版本。 https://github.com/iDevelopper/PBRevealViewController 然而,当我在
我在 Rails 3.2 上,我正在使用 rspec (2.11.1)。当我使用“rake spec”运行我的测试套件时,我会失败。当我用“rspec”运行它时,一切都过去了。我已经看到其他人提到这个
我正在第二次学习 Rails 教程。当我输入这个 rails generate integration_test static_pages 我得到 spec/rails_helper.rb 和 spe
我正在尝试通过 https 向服务器验证我的客户端应用程序 - 我正在使用 axis 1.4 jar。我将正确的 JKS 文件传递给信任库。但是,我收到以下异常。 Caused by: ja
我一直在尝试使用HELM UPGRADE创建POD: helm upgrade --values=$(System.DefaultWorkingDirectory)/_NAME-deploy-CI/d
我是一名优秀的程序员,十分优秀!