标签: cucumber

page.rb:220: 警告:在行中间遇到 \r,在 Mac 上仅被视为空格

我正在尝试在红宝石黄瓜、硒网络驱动程序、框架中运行测试。测试是在 Windows 机器上编写的,我使用的是 Mac。我收到以下错误。我在这个 Git 中心链接 - https://github.com/rdoc/rdoc/pull/280 上 发现这可以修复。我知道我需要安装“kpeg gem”,但它没有解决问题。

能否请你帮忙?我想知道修复它的步骤,以防您更好地理解所提供链接上的文档。我将不胜感激。

a3835233:astra yc98ag2$ cucumber --profile  pom_mcom_qa_new_ui --tags  @bat
/Users/yc98ag2/Documents/Git/astra/lib/new_ui/pages/mew2/catsplash_page.rb:220: warning: encountered \r in middle of line, treated as a mere space
/Users/yc98ag2/Documents/Git/astra/lib/new_ui/pages/mew2/dbconpage.rb:55: warning: encountered \r in middle of line, treated as a mere space
/Users/yc98ag2/Documents/Git/astra/lib/new_ui/pages/mew2/hpmb_add_mediagrp_id.rb:83: warning: encountered \r in middle of line, treated as a mere space
/Users/yc98ag2/Documents/Git/astra/lib/new_ui/pages/mew2/mew_promos_bcom.rb:161: warning: encountered \r in middle of line, treated as a mere space
/Users/yc98ag2/Documents/Git/astra/lib/pages/mew2/catsplash_page.rb:220: warning: encountered \r in middle of line, treated …
Run Code Online (Sandbox Code Playgroud)

ruby gem selenium cucumber

0
推荐指数
1
解决办法
3464
查看次数

BDD 的所有优点是什么?

BDD(行为驱动开发)框架和cucumber的优点是什么?

我想知道 BDD 的所有优点是什么。

bdd automation cucumber cucumber-jvm

0
推荐指数
1
解决办法
4359
查看次数

详细信息:Appium 的 IosDriver 不支持 xcode 版本 8.3.2

我在运行移动自动化测试时遇到困难。我收到以下错误

A new session could not be created. Details: Appium's IosDriver does not support xcode version 8.3.2. Apple has deprecated UIAutomation. Use the "XCUITest" automationName capability instead. (Selenium::WebDriver::Error::SessionNotCreatedError)

我目前使用 Xcode 8.3.2 版和 Appium 1.0.0 版。

有没有人有什么建议?

ruby mobile cucumber ios appium-ios

0
推荐指数
1
解决办法
3317
查看次数

如何将参数传递给黄瓜 + Maven 项目,以便它们可以在测试中使用?

当我运行它时,我需要能够将用户名和密码传递给我的测试套件。我不确定这样做的最佳方法是什么。

我的项目使用 Cucumber 在 Java 上运行,使用 Maven。

如果它只是一个 java 项目,我可能会有一个 main 方法,我可以在其中获取执行项目时传递的参数。但是因为这里有黄瓜,有它的特性文件,然后是一些用于测试实现的 java 类,我不知道该怎么做。

cucumber maven

0
推荐指数
1
解决办法
1430
查看次数

如何在Cucumber 4.0中通过类型注册表添加数据表

对于黄瓜 3.0 我正在使用

typeRegistry.defineDataTableType(DataTableType.entry(CustomData.class));

public class CustomData {
    private int id;
    private int val;
    private Region region;
    private Boolean isExisting;
    private String type;

  //getter and setter methods
 }
Run Code Online (Sandbox Code Playgroud)

如何在 Cucumber 4.0.0 中将其转换为 configureTypeRegistry 的一部分

我在特征文件中的步骤为

 When I set the custom data
  | region | id | val | isExisting | type  |
  | NA     | 2  | 10  | true       | custom|
Run Code Online (Sandbox Code Playgroud)

cucumber cucumber-java

0
推荐指数
1
解决办法
396
查看次数

Scenario.embed 错误:无法解析“场景”中的方法“嵌入”

我有一个黄瓜项目。如果我想截取屏幕截图,我想使用以下命令将其嵌入。 scenario.embed(((TakesScreenshot)driver).getScreenshotAs(OutputType.BYTES), "image/png");但是我收到错误embed-Cannot resolve method 'embed' in 'Scenario'

我的 hooks 文件的一部分

 @After
    public void teardownAndScreenshotOnFailure(Scenario scenario){
        try {
            if(driver != null && scenario.isFailed())
            {
                scenario.embed(((TakesScreenshot)driver).getScreenshotAs(OutputType.BYTES), "image/png");
            }
            if(driver != null)
            {
                driver.manage().deleteAllCookies();
                driver.quit();
                driver = null;
            }
            ....
Run Code Online (Sandbox Code Playgroud)

我导入了以下内容:

import io.cucumber.java.After;
import io.cucumber.java.Before;
import io.cucumber.java.Scenario;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
Run Code Online (Sandbox Code Playgroud)

我在 POM.xml 中使用最新版本的黄瓜:6.9.1

我不知道为什么会出现这个问题,我尝试降级我的黄瓜,谷歌搜索错误,但 shhomehow 嵌入不起作用。嵌入错误

java cucumber

0
推荐指数
1
解决办法
7329
查看次数

Angular 中 Cypress 10 和 Cucumber 的 Webpack 编译错误

我在这个网站上看到过其他类似的问题,但没有一个对我来说有令人满意的解决方案。我没有任何 webpack.config.js 文件,因为我们从 Angular 获取默认配置。请参阅下面相应的图片,以便更好地了解我的问题。

在此输入图像描述

我的项目中的其他配置:

包.json

  "cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true,
"json": {
  "enabled": true
},
"stepDefinitions": "**/cypress/e2e/**/*.js",
"step_definitions": "**/cypress/e2e/**/*.js"
},
Run Code Online (Sandbox Code Playgroud)

赛普拉斯.config.ts

import { defineConfig } from 'cypress'
export default defineConfig({
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
  return require('./cypress/plugins/index.js')(on, config)
},
specPattern: '**/e2e/**/*.feature',
"supportFile": false,
chromeWebSecurity: false
},
})
Run Code Online (Sandbox Code Playgroud)

更新 1: 您好@Wirtuald,感谢您回复我。我开始在一个相当复杂的角度项目中遇到这个问题。因此,我从头开始创建了一个基本项目,但仍然遇到同样的问题。接下来,我向大家介绍一下这个新项目的全部信息:

cucumber webpack angular cypress cypress-cucumber-preprocessor

0
推荐指数
1
解决办法
1万
查看次数

使用测试库 findby* 查询和 @badeball/cypress-cucumber-preprocessor

我有一个反应应用程序,我正在尝试使用 Cypress 进行测试,badeball/cypress-cucumber-preprocessortesting-library出现错误

cy.findByRole is not a function
Run Code Online (Sandbox Code Playgroud)

这是我当前的设置:

  • 反应脚本:5.0.1
  • 打字稿:4.8.3
  • 柏树:10.8.0
  • @badeball/cypress-黄瓜-预处理器:12.2.0
  • @testing-library/cypress:8.0.3
  • 节点:16.15.0

我创建了一个示例应用程序来演示这里的问题

的 e2e 部分cypress.config.ts有两种配置,可以通过注释掉一种并保留另一种来进行测试。第一个(当前配置的)将尝试将测试作为功能文件运行,但会失败。第二个配置使用正常的 cypress 测试,并将显示“testing-library”功能在那里正常工作。

setupNodeEvents()中的函数并不cypress.config.ts完全遵循 badeball/cypress-cucumber-preprocessor 文档中找到的 webpack/ts 示例,因为该示例与 esModuleInterop 设置为 true 时效果不佳,该值在我的应用程序的其他部分中使用,因此此配置这是我为实现这一目标所做的尝试。但我确实测试了该示例配置,但仍然无法使测试库功能正常工作。

我已经设置了脚本,因此您可以使用npm test在 e2e 模式下启动 cypress。

任何帮助表示赞赏。

cucumber cypress cypress-cucumber-preprocessor cypress-testing-library

0
推荐指数
1
解决办法
274
查看次数

IOS自动化测试工具

我是移动测试的新手,我想通过市场上的任何自动化工具测试ios应用程序,你能否建议我哪种工具最好?以及如何以适当方式使用该工具的有用链接

java windows xcode cucumber calabash

-1
推荐指数
1
解决办法
3031
查看次数

未初始化的常量FactoryGirl(NameError)

当我在功能/支持下更改env.rb文件时

require 'cucumber/rails'
require "#{Rails.root}/spec/factories"
Run Code Online (Sandbox Code Playgroud)

并在gemfile源' https://rubygems.org '

gem 'rails', '3.2.13'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

group :test do
  gem 'cucumber-rails'
  gem 'capybara'
  gem 'database_cleaner'
  gem 'factory_girl_rails', :require …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails cucumber

-2
推荐指数
1
解决办法
6882
查看次数

-4
推荐指数
1
解决办法
3520
查看次数

如何在 Cucumber ruby​​ 中实现数据表,我需要一个示例来同时使用特征文件中的数据表和示例

我想知道如何在黄瓜红宝石中实现数据表?需要一个示例来同时使用特征文件中的数据表和示例。

请提供带有这些及其实现文件的示例功能。

ruby cucumber gherkin

-4
推荐指数
1
解决办法
2967
查看次数