Is there a way to change protractor's default debugger port 5858? Currently I'm using the following command to launch protractor:
$> protractor debug protractor.conf.js
There's an optional parameter you can pass to pause to use a different port, e.g. browser.pause(5859) :
https://angular.github.io/protractor/#/api?view=Protractor.prototype.pause
The port is hardcoded in several locations of the protractor code:
https://github.com/angular/protractor/search?q=5858&ref=cmdform
So i guess, you could fill an issue explaining your requirement, or you could fork, modify protractor and make a pull request.
Related
I run Cypress from the terminal using an npm script. I would like to run a series of checks before any tests in any spec are executed (e.g. to ensure env variables are set as expected).
If any check fails, I'd like to log some debug info and Cypress to mark each spec as failed.
Is something like this possible without having to have a custom script that executes before Cypress is started?
I've played around with the support file, but logging to the terminal and failing all test specs seems problematic.
Yes you can use Before Run API
on('before:run', (details) => {
/* ... */
})
Is it possible to use experimentalSourceRewriting in a cypress test file and not to use it in the cypress.json file?
This configuration option experimentalSourceRewriting cannot be set directly in a test.
See https://docs.cypress.io/guides/references/configuration.html#Test-Configuration
We have a maven plugin that runs selenium with scala. The arguments passed are formatted as such:
<argLine>-Dbrowser=chrome -Dwebdriver.chrome.driver=${project.basedir}/browser/drivers/chrome/2.25/mac64/chromedriver</argLine>
I've tried adding
-DmaxInstances=5
, as well as using
-browser="browserName=chrome,maxInstances=5,chromeDriver=theDriver"
however they have returned errors.
Does anyone know the correct command line argument using the -D... format?
An example execution would be:
java -Dwebdriver.chrome.driver=theDriver -jar selenium-standalone-server-3.0.1.jar ${SE_OPTS}
where ${SE_OPTS} are the options that selenium takes. the options depend on which role you are running.
Options for Standalone
Options for Hub
Options for Nodes
(see the #Parameter's)
Since version 3.0, we are using JCommander, so ensure that your -D... options are specified before -jar
I am running jasmine tests on Karma server.
On my tests I have to load a image and a json file test.
They depend on path. Which is the default path for Karma? I mean if i have a image in a directory inside my .js test files how can I reach that file?
I have tested src="myDir/myImage.jpg" but no sucess...
If you use a nodejs web-server to run your app, you can add this to karma.conf.js :
proxies: {
'/path/to/img/': 'http://localhost:8000/path/to/img/'
},
If you don't use or want to use another server you can define a local proxy but as Karma doesn't provide access to port in use, dynamically, if karma starts on another port than 9876 (default), you will still get a 404 error...
proxies = {
'/images': 'http://localhost:9876/base/images'
};
Based on this answer
Related GitHub issue for more info ;)
I would also suggest using requireJS because Karma does not deal well with fixtures...
proxies = {
'/images': 'http://localhost:9876/base/images'
};
To avoid 404 error if karma starts in in a different port, even after setting proxies, do the following:
Kill all the process using the port starting from 9876 (killing node.exe will do the trick)
Run you karma with 9876 port free now
Subsequent runs will be mapped automatically by karma to whatever port it launches
I have nearly identical versions of webapps on different sites.
What I'd like to do is specify the site at command line...
cucumber --server server1 --tags #tests
....
#servers = {'server1' => 'https://www.tests.com', 'server2' => 'https://www.foobar.com'}
....
Background:
Given I am on {#server1}
Scenario: Happy plan
When I go here
And I see this
Then I get that
What is the best way to running the same script on multiple similar websites? Can it be run from the command line?
Your best option is to use an environment variable for your server name:
cucumber SERVER=server1 --tags #tests
You can create a generic step:
Given I am on the configured test server
Then, in your step definition, you can look that up as you would in any normal Ruby code and set it as Capybara's base URL:
Given /^I am on the configured test server$/ do
server_name = ENV['SERVER']
url = #servers[server_name] or raise "Unknown test server: #{server_name}"
Capybara.app_host = url
end
Note that when using a remote server, you'll need to use a Capybara driver that supports it, such as Selenium: the default RackTest driver does not. You may also want to set run_server to false. See https://github.com/jnicklas/capybara#calling-remote-servers
Create some config and read it before executing scripts.
Put code for parsing config to features/support/env.rb, for example.