BrowserStack integration with TestCafe: How to fix "The specified screen resolution is not compatible with the chosen OS version"? - testing

I have configured the environment variables as follows:
This resolution is supposed to be compatible with every OS, still tried many others and also different OS.
I applied the same settings for the .env file on the project.

What are the configurations you have provided to initiate your tests?
Since you have specified the flag BROWSERSTACK_USE_AUTOMATE="1", the setting on https://www.browserstack.com/automate/capabilities would come into effect.

Related

Debugging an app with computed environment variables in IntelliJ IDEA

Consider an app which, in 12-factor style, receives its config in the form of a JSON document provided as an environment variable. The config contains secrets, so it is never stored on disk; instead, it is computed on the fly before starting the app, using something like sops or nunjucks.
I am trying to debug such an app in IntelliJ. Is there any way to run some arbitrary script before launch and provide its output to the app as an environment variable?
I will accept answers for any run config type, but an approach that works with "npm" or "Application" would be most helpful for me.
EnvFile IntelliJ IDEA plug-in added this option some time ago.
I did a quick test and don't see this option available, at least on Windows.
EDIT: found it was only merged in the forked version and not available in the official plug-in. You will have to merge it manually and build the plug-in from sources.
IntelliJ IDEA doesn't have a built-in feature for that, feel free to vote for the corresponding request.

Environment variable for preview deploys with Vercel?

Does Vercel have an inbuilt environment variable for preview deploys (as opposed to production)?
I know that you can set these manually for different deployments, but I assumed this was a common enough requirement that there would be something available by default. However I can't find this in the documentation.
process.env.VERCEL_ENV will be "preview" for preview deploys.
https://vercel.com/docs/concepts/projects/environment-variables#preview-environment-variables

Can we customize Chrome browser launch with different options using Chrome Java API? [duplicate]

I am using the Karate framework to do the API testing. As part of CI efforts, we send an email at the end of test execution listing the summary of test results. There is a need to include the screeshot of the test execution counts from 'overview-feature.html' file.
I did so through the TestRunner.java file - launched Chrome using Chrome.start() and then using it to take screenshot. It all works well locally on Windows.
However when executing on CI server which is a Unix box, the chrome executable is not present in the default location (usr/bin/google-chrome) and hence the connection for the localhost fails.
Is there a way we can change the default location of the chrome executable?
PS: Apologies if this was too trivial to be asked.
Yes Chrome on CI is hard to get right, refer: https://stackoverflow.com/a/62325328/143475 - note that CI boxes typically are "headless" a browser may not be even installed.
I think the best thing for you is to ZIP the HTML and send it. But I really think you need to work with some CI experts, because the report generation and e-mailing business is normally done by things like Jenkins. What you are doing is certainly not normal or best-practice.
If you really want, there is a Karate Docker container that can give you a proper Chrome instance (see docs) but that is overkill for what you need.
EDIT: The Chrome Java API allows for customization of the executable path and this is in the docs: https://github.com/intuit/karate/tree/master/karate-core#chrome-java-api
It should be something like this:
Chrome.start("/opt/blah/chrome");

TestCafe can't establish browser connection when running against Electron app

I am attempting to run a test on our Electron app using TestCafe. I have tried many things but after many hours am still getting the error below:
"ERROR Unable to establish one or more of the specified browser
connections. This can be caused by network issues or remote device
failure."
The cases I have read Googling around do not seem to apply to my case.
I have everything set up as described here: https://github.com/DevExpress/testcafe-browser-provider-electron#testing-an-executable-electron-application
The .testcafe-electron-rc file is correct in that my app does indeed launch but errors as above. I do not think it gets to my script which is very simple for debugging purposes. I have tried changing the mainWindowUrlPath to various locations since it seems like my app is run from C:/Program Files/MyApp/resources/" which contains an app.asar file even though our app is located in "C:/Program Files/MyApp/MyApp.exe"
I have tried setting up the .testcafe-electron-rc in many configurations including the one described in the documentation as well as many others. An example is below which I realize is non-standard:
{
"mainWindowUrl": "C:/Program Files/MyApp/resources/app.asar/index.html",
"electronPath": "C:/Program Files/MyApp/MyApp.exe"
}
Note, I have never seen the index.html anywhere in the app directory but assume that TestCafe must dive into the asar in some manner.
I have disabled the Windows firewall but still, the same issue exists.
I have run my tests with nodejs installed globally and testcafe and the Electron provider installed globally and locally (i.e. run these configurations separately) but the same issue occurs.
Does anyone have any other ideas? Any help appreciated.
This is on Windows 10.
m

Dynamic file path for IDE setting?

Can you set the drive letter to be dynamically added for an Windows application setting on a flash-USB?
Would it be an environment variable, and if so what would it be called? -> (i.e. %root%/Qt/4.8.1/bin)
Issue Example:
I have Qt SDK 1.2.1 installed on my flash drive for plug and play on any workstation without the environment. The issue is if the drive letter isn't assigned to be the same as when I installed it, things wont link or compile.
One approach (if your IDE supports this) could be to use an environment variable to refer to the drive name. Then when you know the letter, set the env. var to the appropriate value.
Note: depending on your OS you might need to restart your IDE to pick up the change in the env. variable