Use parameters from Jenkins and pass to JS conf file - jasmine

I would like to pass a parameter from Jenkins into my baseURL: value in my protractor conf file. Is this possible? If so, how do I do that?

Do it from the command-line when starting protractor:
protractor protractor.conf.js --baseUrl="http://127.0.0.1:900"

Related

Removing Cypress default proxy settings

I'm having trouble to load the page of my application under test when running Cypress test. After long investigation I figured out that Cypress is using a corporate proxy which is retrieved from my environment variables according to documentation https://docs.cypress.io/guides/references/proxy-configuration.html#View-proxy-settings-in-Cypress
This proxy is no longer active so I remove it from my environment variables but Cypress is still using it even after restarting both cypress and VsCode.
I also tried the following solutions:
clean up Cypress cache folder
uninstall Cypress and install it again
Installing Cypress on a teammate's machine who never had the proxy environment variables configured worked fine.
My question is: Why Cypress is still retrieving the HTTP_PROXY env var which no longer exists ? How to remove this from Cypress settings ?
Thanks a lot for your help.
environment variables are available in cypress through :
1) Approach 1
adding environment variable through terminal or command line as : CYPRESS_
eg : CYPRESS_TEST create variable TEST
you can see all the variables by typing set in cmd and env in shell , search for cypress in that
2)Approach 2:
to environment file or config file:
check if these files has proxy environment variables:
**3) using plugin file **
check the index.js in plugin folder for
config.env
see if you have proxy variable set in any of these location ( Or from tests ) and try to remove it

could not find location of Jmeter script in Taurus tool runner

I followed the guide https://marketplace.visualstudio.com/items?itemName=AlexandreGattiker.jmeter-tasks to trigger Jmeter script in Azure pipeline.
In Taurus Configuration YAML of Taurus tool runner, I defined a YAML as following
TaurusConfigurationYaml
Release pipeline
The problem is that it could not find location at path: Blazedemo.jmx in running Taurus
I tried to change value of script to **\Blazedemo.jmx it does not work
The question is that where it find Blazedemo.jmx. I push Blazedemo.jmx into my azure repo already in root
Please give me advice.
Thanks a lot.
Thanks Dmitri T. I fixed my issue. In Download Artifacts, it shown D:\a\r1\a_dev-branch - CI\drop\bin\Release\BlazeDemo.jmx. So I just change the path of jmx file in Taurus tool runner as following
execution:
- scenario:
script: $(System.DefaultWorkingDirectory)_dev-branch - CI\drop\bin\Release\BlazeDemo.jmx
concurrency: 30
hold-for: 300s
ramp-up: 30s
If you have Blazedemo.jmx file at the same location where your Taurus YAML config file lives you can use just script: Blazedemo.jmx, there is no need to go for Ant-style filesets
Also you can omit the step of JMeter installation, Taurus can download and install JMeter on its own
More information:
Install and run JMeter and Taurus testing tools.
Navigating your First Steps Using Taurus

How do I send baseUrl as a parameter with Cypress.io

I am researching switching from Protractor to Cypress.io.
I have some tests up and running, however, I want to be able to send the baseUrl as a parameter as I can with Protractor.
I have tried:
$ npm run cypress:open --config "baseUrl=myUrl" --still uses the baseUrl from my config file.
$ npm run cypress:open --env "baseUrl=myUrl" --still uses the baseUrl from my config file.
and a host of other things, none of which work quite right.
I want to be able to pass a parameter to my command which gives me the flexibility to choose which environment I am running my tests in. I can do this with Protractor, with a command like this:
$ ng e2e --suite testSuite --baseUrl myUrl
What is the equivalent for Cypress.io?
You have to set the env variable CYPRESS_baseUrl
CYPRESS_baseUrl=[your baseUrl] npm run cypress:open should do it for you
I think the correct way to do this is:
$ npm run cypress:open -- --config "baseUrl=myUrl"
Otherwise, the config parameter is passed to npm instead of cypress. Notice the extra --
Good luck!
Brendan's answer is correct.
I would like to add that
$ npm run cypress:open --config "baseUrl=myUrl"
may not be working since you try to propagate some configuration into a command inside your package.json.
If instead you'd do for example:
$ ./node_modules/.bin/cypress run --config baseUrl=myUrl
it should work just fine.
This is good to know since it will let you use additional CLI options as well (which you do not know ahead of time).
PS: --env wouldn't work for baseUrl since baseUrl is a built-in configuration value and not a regular env variable.
What I did was simply:
export CYPRESS_BASE_URL=SOME_OTHER_URL
yarn cypress run
This will override the baseUrl configuration. See: https://docs.cypress.io/guides/guides/environment-variables.html#Overriding-Configuration

How to run Jmeter tests from bamboo?

How to run the Jmeter tests from bamboo?
I tried in Jenkins which has the 'Execute windows batch command' option and I just pasted these lines and worked fine
jmeter -n -t C:\apache-jmeter-2.13\apache-jmeter-2.13\bin\test.jmx
I need to work the same with bamboo as well. So I tried with the script task, selected Inline and in the script body I pasted the above lines
It failed with this error
/opt/bamboo/current/temp/TEST-NEW-NEW-33-ScriptBuildTask-6294682377804302931.sh: line 2: C:Jmeterapache-jmeter-2.13bin: command not found
/opt/bamboo/current/temp/TEST-NEW-NEW-33-ScriptBuildTask-6294682377804302931.sh: line 3: jmeter: command not found
I tried with the Command task also in bamboo but no luck.
I'm struggling how to run Jmeter tests from bamboo? Anyone please advise. I see that we can do it with maven I believe, but I don't know much about it, but if anyone has step by step instructions that I can follow that helps as well.
Thanks in advance
Define the jmeter executable as a remote capabiliety.
Then add a new command to your task and select jmeter as executable. Add your arguments and you are done.
It looks like that you need to either need to escape backslashes like:
C:\\apache-jmeter-2.13\\apache-jmeter-2.13\\bin\\test.jmx
or change them to forward slashes as:
C:/apache-jmeter-2.13/apache-jmeter-2.13/bin/test.jmx
Other options on how to kick off a JMeter test from Bamboo build step are:
bamboo-jmeter-plugin
JMeter Ant Task
JMeter Maven Plugin
existing JMeter tests can be executed from Java code, moreover, it is possible to create a JMeter test purely in Java.
See 5 Ways To Launch a JMeter Test without Using the JMeter GUI guide for detailed information on aforementioned options.
I assume your Bamboo is in a linux environment.
From Bamboo on Linux, create a new task and select script:
cd /<your path>/apache-jmeter-2.13/bin
./jmeter -n -t <your path>/test.jmx
If Windows, set environment variable JMETER_HOME to C:\apache-jmeter-2.13\apache-jmeter-2.13\ and then on Bamboo's command line:
cd C:\apache-jmeter-2.13\apache-jmeter-2.13\bin\
jmeter -n -t test.jmx

Start shell script from jmeter in directory of jmx

I have got a jmeter test that needs to run a shell script before it can start. The shell script lays in the directory of the jmx file. I use an OS Process Sampler to invoke the script, but the working directory is set to the bin/ folder of apache jmeter, and thus causing an error.
Is there a property for the current directory where my jmx testplan is?
apache jmeter 2.8
on ubuntu 12.04
The way to to it :
Add a User Defined Variables called shellDir with value ${__P(shellDir,default folder)}
Use it in your path as ${shellDir}/
Define this property at startup using -JshellDir=
See:
http://jmeter.apache.org/usermanual/get-started.html

Resources