cucumber

How to validate Non-JSON response body using Karate

↘锁芯ラ 提交于 2019-12-24 06:31:10
问题 I am trying to validate an error response body of non-json format. I have tried using the schema as well as a keyword using contains to match. It is not working for me. Actual Response response returned from API when multiple matches are observed in a post call: {"error":{"text":SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NewEmp' for key 'employee_name_unique'}} My Karate Feature: Given url 'http://dummy.restapiexample.com/api/v1/create' def errResp = "error" And

Appium server is shut down because no new commands came in

二次信任 提交于 2019-12-24 06:12:50
问题 I am using Appium for Android native app automation on windows machine. All my scenarios are doing good, but sometimes the App gets crashed and Appium stops saying "Didn't get a new command in 60 secs, shutting down". Note - if explicitly i press any key from keyboard it will get next command to execute while cucumber execution. I can see Appium is sending request to find the element, but no response has been received. I don't know why this is happening, but the same thing passes without any

Cucumber Stopping Execution after Time in Steps

青春壹個敷衍的年華 提交于 2019-12-24 04:56:10
问题 One of my tests waits until an event happens in the Then step. If the test works fine there is no issue but if the test is failing (i.e. no event is triggered) then it just hangs. How can I set a timeout in Cucumber ? I know JUnit has a timeout parameter you can use in the @Test annotation, is there something similar for Cucumber ? 回答1: Cucumber has followed the JUnit pattern and offers a timeout parameter in its steps annotations. This takes a long value specifying the number of milliseconds

Getting “required (…)+ loop did not match anything at input 'Scenario:'” error when using Background section in cucumber

醉酒当歌 提交于 2019-12-24 03:07:48
问题 I am writing a Karate DSL test to test a web service end point. I have defined my url base in karate-config.js file already. But when I try to use this in the Background section, I am getting the below error. Please help. Provided my feature file below. Error: "required (...)+ loop did not match anything at input 'Scenario:'" Feature: Test Data Management service endpoints that perform different operations with EPR Background: url dataManagementUrlBase Scenario: Validate that the contractor's

Protractor test on phantomjs with the use of selenium standalone jar,

為{幸葍}努か 提交于 2019-12-24 02:18:46
问题 I am trying to run protractor tests on phantomjs with the use of selenium-standalone-server.jar but it is giving me such error.I am running this in ubuntu 14.04. Here is my protractor-config.js file exports.config = { framework: 'cucumber', seleniumServerJar: 'node_modules/selenium-standalone/.selenium/2.43.1/server.jar', specs: [ 'specs/cucumber/*.feature' ], baseUrl: '', cucumberOpts: { format: 'pretty' }, capabilities: { browserName: 'phantomjs', 'phantomjs.binary.path': 'node_modules

Can't execute feature in cucumber jvm

梦想与她 提交于 2019-12-24 01:45:29
问题 I am very new to using cucumber (started today). It seems simple enough but I am having issues running a basic feature. Feature: Proof of concept that my framework works Scenario: My first test Given this is my first step When this is my second step Then this is my final step I know there is no code for it to test, but I wanted it to return the fact that the scenarios are undefined. I did some research and realised I had a .jar file which was unnecessary, I have since removed that. I still

Nightwatch.js always returns exit code 1

随声附和 提交于 2019-12-24 01:44:08
问题 I try to integrate my Nightwatch.js tests in a Jenkins Job. I want the Jenkins build to fail if the tests will fail and I want the build to pass if all tests will pass. But I recognized that Nightwatch always returns the exit code 1 , doesn't matter if the tests will pass or fail. But I expect that the exit code 0 will be return if all tests will pass. Does anyone have a solution for that issue? I use nightwatch@0.9.19 in combination with nightwatch-cucumber@9.0.0 . This is my Nightwatch call

Selenium and Cucumber proxy setting (cucumber.xml or CucumberRunner)

我的梦境 提交于 2019-12-24 01:18:01
问题 Trying to set proxy (to OWASP ZAP Proxy port) in Cucumber via property, but to no available. cucumber.xml <beans profile="firefoxRemote"> <bean name="capability" init-method="firefox" class="org.openqa.selenium.remote.DesiredCapabilities"> <property name="browserName" value="firefox"/> <property name="version" value="42.0"/> <property name="PROXY" value="127.0.0.1:8090"/> </bean> I can also set it in CucumberRunner, but don't know how. @RunWith(Cucumber.class) @CucumberOptions( features = {

How to use TestNG Listeners with Cucumber

瘦欲@ 提交于 2019-12-24 00:49:17
问题 I am triyng to write testng listeners for my testing project cucumber, testng, selenium and java. I have created Listeners extends TestListenerAdapter and implemented all the methods and included in testng.xml `<listeners> <listener class-name="TestNGListeners.Listeners"></listener> `<test name="Smoke"> `<packages> <package name="cucumber.runner.*"> </package> `</test> This xml calling a testrunner class RunCukesTest `@CucumberOptions(features ="classpath:features", `glue ="stepDefinitions",

Rubymine is not able to find a step definition, located inside a gem

怎甘沉沦 提交于 2019-12-23 22:30:23
问题 Rubymine returns an alert of "Undefined step reference" for the two steps of this scenario. This cucumber test is like this: @smoke Scenario: Update profile Smoke test. Given I navigate to this test webpage And In Test, I click the element of "test_link" This 2 steps are located inside a gem, following this structure: gemname/lib/features/step_definitions/web_shared_steps.rb And (/^I navigate to this (.*?)$/) do |web| web = '$' + web.downcase.gsub(' ', '_') @browser.goto eval(web) end Then (