selenium-cucumber-js | Browser automation framework written in pure | Functional Testing library
kandi X-RAY | selenium-cucumber-js Summary
kandi X-RAY | selenium-cucumber-js Summary
Browser automation framework written in pure JavaScript using official selenium-webdriver and cucumber-js
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Initialize the driver
- Import shared objects
- Creates the world object
- Opens a DOM element with the given content
- Finds elements that match the text content
- Initialize eyes with config .
- Teardown the browser
- Tries to convert an integer to a default value .
- Close the window
- Gets the content before the given content selector
selenium-cucumber-js Key Features
selenium-cucumber-js Examples and Code Snippets
Community Discussions
Trending Discussions on selenium-cucumber-js
QUESTION
In the context of building a project with a dependency on selenium-cucumber-js, I'm trying to install geckodriver in the following setup:
- OS: WSL Ubuntu 16.04
- Node: 8.15.0 (installed from nvm)
- NPM: 5.10.0 (installed from nvm)
When I execute npm install geckodriver
, I get the following error message:
ANSWER
Answered 2019-Feb-17 at 08:01Edit: seems like a version-wide issue. The same issue was also reported by other people on the github tracker. https://github.com/vladikoff/node-geckodriver/issues/59
npm install geckodriver@1.14
works just fine.
QUESTION
Framework using: selenium-cucumber-js.
I am trying to run the below selenium-cucumber-js test. I would like to run the loginApp()
function as BeforeScenario
written in hooks.js file. But while running the test, its throwing below error at the moment. Could someone please advise on how to resolve the problem.
ANSWER
Answered 2018-Nov-21 at 22:28First of all, note that selenium-cucumber-js
is using a rather old version of cucumber-js
(1.3.3 vs 5.0.2 at the moment of writing this). Keep that in mind when you're consulting cucumber-js
docs or looking for examples. Below, I'll be posting links to the cucumber-js@1.3.3
docs.
As for what's not working in your set up:
scenario
object that is passed into your hooks doesn't have page objects attached to it. It only contains some meta info about the scenario and methods to get it. Here's a list of them: cucumber-js docs- If you want to reference the page objects from your hooks, you can use the global
page
as described here: Page objects - selenium-cucumber-js - Your
loginApp()
function probably still won't work because you're accessing webdriver asthis.driver
and helpers asthis.driver.helpers
. They're also globally defined byselenium-cucumber-js
: Helpers
So, your hooks.js
should look like this:
QUESTION
How do I call a simple addition function and assert the result of two values using selenium-cucumber-js framework with a test written below. While running the below it says TypeError: TypeError: Cannot read property 'addvalues' of undefined at createWorld.When (C:\Tests\cucumber\step-definitions\addvalues-steps.js:5:25)
...ANSWER
Answered 2018-Nov-14 at 03:23Note: the below example is for an old version of cucumber-js: 1.3.3.
With cucumber.js, when you're referencing this
from inside step definitions, you're actually referencing the World context. So, for this.page.addvalues.addValues(x,y);
to work properly, you'll first need to create page
that has a reference to your addvalues.js
. Something along these lines:
world.js:
QUESTION
I have a package.json
file with the following script defined:
"scripts": {
"test": "./node_modules/selenium-cucumber-js/index.js"
}
When I run npm test
on linux or mac this script runs as expected. On Windows however I get an error:
/node_modules/selenium-cucumber-js/index.js
'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Test failed. See above for more details.
However if I run the command ./node_modules/selenium-cucumber-js/index.js
directly from a cmd prompt it works correctly. The same issue also occurs if I try to run any other script through npm that starts with a ".". I haven't been able to find any other thread talking about this as an issue.
I am running npm versions 5.6.0
on Windows 10 Home.
Does anyone know how I can get this working?
...ANSWER
Answered 2018-Jun-23 at 05:34Everything defined under scripts
gets executed in the default system terminal and on Windows ./node_modules/selenium-cucumber-js/index.js
is definitely not a valid command (or rather a path). It just happens that the same file has a +x
argument and a shebang pointing to a Node.js
(or another JS interpreter) binary so that it gets executed on Linux without intervention.
I'm quite certain you'll get the same error if you were to execute the same command in the default Windows terminal (cmd.exe
) but you may get away with it in some ports/emulations of *nix terminals (i.e. Cygwin, MSYS, bash.exe etc.) which may give you a false sense of everything working correctly outside of the npm
chain.
If you want to make sure your script gets executed by Node.js
while using relative paths and keeping cross-platform compatibility, call it explicitly as:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install selenium-cucumber-js
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page