Can synchronised browser testing be achieved when the user script (Tampermonkey) is developed locally? - tampermonkey

I am developing a user script (Tampermonkey) locally. When the local JS changes, I want to automatically refresh the target URL of the user script instead of a local HTML file.
How can this be achieved? I checked every command and configuration information, but did not find a solution, so I came to ask for help.
The method of developing UserScript locally is seen here. The answerer mentioned that browser-sync can be used, but I did not find a way to achieve it.

livereload can solve this problem very well, because livereload is implemented through browser extensions and local programs. When the file changes, the target URL can be refreshed immediately.
http://livereload.com/
https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei/related

Related

Local overrides for react app in production not working on reloads

I am trying to debug a react app in production and I recently came to know about Local overrides in chrome developer tool. So I naturally gravitated to use to it. I find the file in sources I make changes to it and save it to my local overrides directory. It gets saved and I enable local overrides. But on page reload the browser is not loading the file from local overrides folder I created but the original file from server. I tried out almost every option I could find by googling but nothing has worked. Could someone please help.

How to find which file is serving ads in my application?

Ok, somehow I am serving ads in my NodeJS / AngularJS application, but I haven't include this myself.
There's some package or included link sending ads to the client, but the ads are not visible, and the adserve url changes with every request. (The url that can be seen in the screenshot below)
How do I find out which place in my application serves these ads?
PS: I am sure this doesn't come from my local dev pc, my other collegues have this issue as well.
A quick trick may be to search for the url in every files of your repository. If you use a cdn to load your librairies, try to look inside also (you can do that directly in chrome dev tool with ctrl/cmd f in the sources tab).
Hope it will help !
The "adserver" in my project turns out to be a tracking / analytics beacon included by the Realtime.co framework.
Thankfully, the author responded to my email very quickly, and they also provide a beacon-free version of their framework. So problem solved :)

How do I make selenium see the network requests made by a web browser?

I have a dotnet Selenium web driver app.
When I'm testing the page one of the things I need to confirm is that a flash object on the page has pulled correct content from a content store on my site. (i.e. the flash object should be loading content from /stuff/info.txt and including that content within the animation.)
As a human looking at this I can use the chrome network tab and see that /stuff/info.txt has been accessed.
How can I make Selenium execute a similar watch and see the network requests made by a web browser?
I did not wrote this, neither tested it however someone did it here: http://www.softwareishard.com/blog/firebug/automate-page-load-performance-testing-with-firebug-and-selenium/
Basically all the requests are exported via netexport and firebug plugins inside a HAR (Http ARchive file)
Please give us your feedback if you give it a try!
Cheers !
I assume you want to automate the process which the developer tools of browsers does. Something like firebug but for verification using Code.
I don't believe Selenium has such features. For now, you will not be able to achieve this.

Custom fonts not getting uploaded in Openshift server

I have developed an application which uses custom CSS3 fonts. But somehow custom fonts are not getting uploaded in the server. My application URL is http://techcurt-kshitiz.rhcloud.com and when I try to access custom font like http://techcurt-kshitiz.rhcloud.com/resources/css/LindenHill-webfont.eot, The requested resource is not available appears. Custom fonts are working fine in my local machine in every browser.
I have recreated my application but still the problem persists. I have been using Openshift since an year but never faced such issue. What can be the possible reason for it? Even .less file is not getting uploaded. I am using tomcat 6 server in Openshift. I am not able to find out any solution in Google.
Do you see the files on disk when you SSH to the gear?
Are the files checked into Git? It's possible that they are being ignored by git, and hence not uploaded. You can check that the file is in git with "git show master:" - if ignored it won't show up.
Otherwise, it could be something in your build - perhaps the files are getting deleted?
Finally my issue is solved by servlet-mapping .ttf and .eot files in my web.xml files. But I am not able to understand how come my application was running in local machine but not in server? How come thats possible?

Deploying AngularJS Seed application in WebStorm

I recently started to learn about AngularJS and came across WebStorm and the AngularJS plugin by John Lindquist. Started by creating a new project using the angular-seed project and imported to WebStorm using File -> Open Directory. My directory structure looks like this
Now when I try to Debug it I get a 404 error. If I move the file app/index.html to the root folder and adjust all URL's to begin with app then it works fine. Is there a way to keep the default folder structure without moving the index.html to the root folder and also make it work with WebStorm?
I am using WebStorm 6.0.2.
I use WebStorm 7, so there might be some discrepancy in comparison with version 6 that you're using, but the over-all functionality is the same.
Quick solution:
Open the file in the editor and right click in the code to access the context menu. Choose the "Debug" option, which should start a debug session pointing to the current page.
Configuration solution:
WebStorm supports configurations for setting up different debugging scenarios. From the "Run" menu, choose the "Configurations" option. Add a JavaScript debug configuration, and add the URL you want in the designated field within the dialog presented.
Then, when you initialize a debugging session (a general one, not one for a specific page), you're presented a small dialog that allows you to choose a debug configuration.
Maybe there are more options or ways to accomplish the same thing as well, but I've never really given it more thought. I hope this is a working solution for you, but if not there's alway the documentation. If you need further clarification with regard to my answer, just give me a comment.

Resources