-
Notifications
You must be signed in to change notification settings - Fork 35
Example using config file for WebDriver settings #46
Comments
Regarding how to specify web-driver options, see here and here @alderete-sfdc plans on moving some of these details from issues to an FAQ section. May be first try ensuring that java is installed and on the path? Basically The command uses webdriverio which has jre as a pre-requisite. |
I had quite a few problems getting the force:lightning:test:run process to work in a docker container under gitlab ci. Just adding some notes to help others. Under the hood the sfdx client uses the npm package selenium-standalone. (Version 5.7.1 for sfdx 6.0.16.) The --configfile file on the sfdx command line is passed to the selenium-standalone module as the options. So see this module for what you can define in the config file. additionally the following sections of the config file are used :
You need to make sure java is avaliable in the path, as well as google-chrome in the docker container. The selenium-standalone npm package automatically downloads selenium and the chromedriver files, you don't need those. I had a lot of problem trying to debug issues where things seemed to work but nothing happened. For example /usr/local/bin/java:
I got force:lightning:test:run working with headless chrome using the following config file:-
Some notes:
There seems to be a relevant discussion here jessfraz/dockerfiles#65 . Although i can't quite follow the discussion it seems there are some permissions that are required on the docker and/or the kernel images. |
After using the setup you described @innovate42 (which is extremely helpful!) - I still seem to get the least helpful error message:
I'm pretty sure I will have to figure out 2 things
It would be a lot more helpful if the CLI tool itself helped users debug a bit better |
Hi @maniax89 I've found that the endsWith error seems to mean that the command that sfdx-clie was trying to run has failed. The best bet would be to try and see the output - and the only way i've found to do that is to create a wrapper around java as mentioned above. I've added the Dockerfile that we are using for the test builds here https://github.com/innovate42/dockerfiles/tree/master/sfdx-testenv |
endsWith error is a being thrown by sfdx cli while trying to log the actually error see here. Cli team knows about it and its being tracked under bug W-4442231. When people have encountered it in context of lightning:test:run. It normally has been resolved by setting DISPLAY/Xvfb. |
I was able to successfully get things running with #46 (comment) after installing It would be good to have this issue archived/turned into documentation so that others may benefit (as it was extremely helpful) |
@alderete-sfdc FYI for doc |
Finally got everything working; hope this helps others that come behind me. While trying to get aura component testing working with Gitlab CI/CD using a Ubuntu 14.04 Docker image, I had to do the following three key things to get it working:
Test Command: lts-config.json
gitlab-ci.yml
|
for anyone coming back to this comment by @ghost - make sure to use a string (not a decimal) for the {
"drivers": {
"chrome": {
- "version": 2.33,
+ "version": "2.33",
"arch": "x64",
"baseURL": "https://chromedriver.storage.googleapis.com"
}
},
"requestOpts": {
"timeout": 100000
},
"webdriverio": {
"desiredCapabilities": {
"browserName": "chrome",
"chromeOptions": {
"args": [
"--headless",
"--disable-gpu",
"--no-sandbox"
]
}
}
}
} |
There doesn't seem to be any way to figure out how to configure the WebDriver settings.
When I run look at the documentation for
sfdx force:lightning:test:run
(https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_lightning.htm#cli_reference_test_run) - there is a--configfile
option that says the following:Where is this documentation? I am attempting to run this on a CI tool (like Jenkins) for automated testing and seeing the following error message:
ERROR: not found: java.
I assume it is because I need to install a WebDriver, but there doesn't seem to be any documentation around this. Could you please point me in the right direction?
The text was updated successfully, but these errors were encountered: