How to customize chrome browser in cypress? - javascript

I just learned web automation test using cypress. But when open cypress uses "yarn" and E2E testing configuration, there is no chrome browser option. My question is, how to add chrome browser in my cypress? Even though the chrome browser is already installed on my laptop. Hopefully someone can help. Thank you

There's a suggestion from Cypress [here] that may help:
I believe that clearing the AppData may solve the problem. To do this:
open up the cypress app
Go to File -> View App Data
Delete everything in here
Close cypress and open it up again
And it should recreate all the browser profiles + extension
If that does not work, the problem is probably with the chrome install itself, try uninstalling / reinstalling it.
You can also pick up Chrome Dev, install it and Cypress will show that as a separate option.

Related

how to debug ionic3 typescript code in chrome dev tool

I found it is very difficult to debug ionic code in chrome debugger.
Actually, it is only angular2 project, but with ionic component. When I open chrome dev tool and select "go to file", I can not find the .ts file that I want to debug at all.
This is strange to me. I can easily debug any angular2 project, why not in ionic?
I want to use ionic3/angular4 to develop a mobile web.
Is ionic also using webpact, if so, I think I just need to enable sourcemap and then debug it in chrome dev tool.
Have you ever successfully debugged ionic .ts file in chrom?
Very simple
Open package.json add below code .
"config": {
"ionic_bundler": "webpack",
"ionic_source_map_type": "#inline-source-map"
}
do chrome://inspect you can see the source file
If you are using Visual Studio Code you can install the Cordova Tools extension, which will let you debug on the device, it is a very powerful tool for VSCode which is also the best Editor/IDE that I have found to develop Ionic 3 and Angular 4 apps.
The procedure is straight forward:
Delete existing launch.json file from .vscode directory and go to Debugger and click on the little gear icon.
Select Cordova as the debugger.
The extension will create 12 configs for you actually, we need the first one which is 'Run Android on device'
Now, this is what I do (Mac OS X Sierra), depending on how and what components you have installed in your system this may change. I open Android Studio and then connect my usb cable which is attached to my android test device.
Once I see my device listed in the Android Monitor Panel and the debug processes running in the Logcat tab, I switch to my VSCode Window and issue in the terminal: ionic cordova android run, then wait for the app to launch on the phone.
Once the app is showing in the device, click the debug button in VSCode and the debugger should attach.
Now your the debugger should hit your breakpoints and let you debug your typescript code with the app running on your test device.
I guess you could also debug directly from the Chrome Developer Tools, but it may require you to configure some more additional options regarding location of your source map files within tsconfig.json. I rather recommend you vscode as it has tons of useful features, it's free and also has extensions for Ionic 3 snippets, autocompletion and CLI commands from the UI.

Custom script in electorn builder?

I'm working on an Electron application and am using electron-builder to generate a windows installer and dmg for mac.
Everything works great, I was able to set up auto update and use other features of electron-builder.
Now I need to include other files that are not part of my electron project and execute them in order to install them during the installation process (on windows).
From the electron builder docs (https://github.com/electron-userland/electron-builder/wiki/Options#NsisOptions) I found out that a custom script can be used (NSIS, which I'll have to learn). I've tried including a test script but nothing seems to happen, has anyone here tried this?
The docs don't seem detailed enough in that regard so it's been very confusing.
Thanks a lot in advance!
So after looking at different places I found out that setting win.target to nsis and perMachine to true will generate the NSIS installer.
It does work, but then sadly there are no auto updates.

angular2 texfield value sync up in all browser

I take a little surprise today working with angular 2, i'm developing a single page form to capture some data, and i discover that the value enter in my texfield using google chrome is sync up with my other browser mozilla firefox.
Anybody have some idea why happen this. this not look like angular function.
i'm running in developer mode
here my package.json file
reading more about lite-server with npm i suspect that it could be the reason but i'm not sure.
thanks in advance!!!
this is because of lite-server browsersync
to remove this you can use http-server(npm install -g http-server)

Cannot debug Karma tests in Webstorm

I have been looking for a few days around the Internet in order to find an answer but, so far, haven't found anything.
So here's my problem: I cannot debug Karma tests or my app.
I am developing on a CentOS 6.7 a web app with WebStorm 10.0.4
I am using TypeScript and Angular, and use Karma for unit tests and Protractor for e2e tests. I managed to set the Protractor debuging, which means I can set some breakpoints over my tests code and it will pause on it.
I am using Firefox 38.0.0 (can't use an other version). Chrome is not installed.
I've set a Karma run configuration and a Remote Firefox configuration.
Karma problems
When I run my Karma tests, it's all good. But when I want to debug them, I've got the following message:
No supported browser found
JavaScript debugging is currently supported in Chrome or Firefox.
App debugging problems
It's even worse : when I launch the remote firefox debugging, everything is fine until I put a breakpoint in WebStorm: then the app just freeze and I can't do anything.
What am I missing ? Is there more configuration to do ?
Your help would be very appreciated.
If you are still looking for the solution here is my solution:
I think debugging in WebStorm is only possible with Chrome. At least I couldn't find any word about firefox anymore.
After installing Chrome and JetBrains extension open settings of the WebStorm. Select Tools => Web Browsers and enable Chrome.
Since I did step 2, debugging was possible.
Hope it helps you too.

Running Jasmine testing on Ubuntu. Page not found

I installed Jasmine-gem on my project without rails usage as my app is php based on Ubuntu. I go to localhost:8888 as said and get page not found in any browsers. Am I missing a basic HTML page like the standalone install or something?.
I know this isn't a full gems issue because compass and other gems function fine.
Can't figure out what I am doing wrong, it is able to find the specs in the command line.
I could just load jasmine standalone but if is possible to get this running, I would really appreciate it!
Thank You.
Forgot to mention I am running Windows. Since Jasmine will run on its own server, I installed it directly on Windows and it works fine. Thanks again for your help. Sometimes you wonder which way you want to go on a shared file system.

Categories