Posts

Showing posts with the label JavaScript

Modern JS Cheatsheet - React and more

Image
mbeaudru/modern-js-cheatsheet modern-js-cheatsheet - Cheatsheet for the JavaScript knowledge you will frequently encounter in modern projects.

Tools and technologies - Test Automation awesomeness - JavaScript

Image
Here is a quick overview of the top 6 programming languages used and the various flavors of testing: Let's continue with JavaScript: 4. JavaScript Happy JS testing!

Really cool JavaScript library - GoJS

Image
If you are planning to implement custom interactive diagrams and complex visualizations across modern web browsers and platforms - GoJS is the solution! GoJS is pure JavaScript, so users get interactivity without requiring round-trips to servers and without plugins.  GoJS normally runs completely in the browser, rendering to an HTML5 Canvas element or SVG without any server-side requirements.  GoJS does not depend on any JavaScript libraries or frameworks, so it should work with any HTML or JavaScript framework or with no framework at all The API consists of only a few dozen important classes which encapsulate many useful features that interact with each other. Learn how to play around with GoJS here  https://gojs.net/latest/learn/index.html Amazing library of samples here:  https://gojs.net/latest/samples/flowchart.html Happy JavaScripting!

Configure IntelliJ for a full stack JavaScript Automation

Image
There are some crucial IntelliJ plugins to install: Base64 for IDEA and Storm BashSupport Bootstrap Bootstrap 3 ddescriber for Jasmine JS Toolbox NUnitJS Markdown Support As a peace offering to the mighty IntelliJ, use Java as project SDK: I prefer to configure four separate modules, to help separate back-end vs. front-end JavaScript dependencies : Add the  bower_components  library to the  client  module, and the  node_modules  library to the server  module: And be sure to enable JavaScript libraries in the editor. Per best practices, we  do not commit the local IntelliJ IDEA configuration folder ( /.idea/ ) to the repository , instead adding it to the  .gitignore  file like so: # IntelliJ IDEA local workspace . idea However, for some developers' convenience   (and others' dismay)  we  do  commit the four IntelliJ module  .iml  files to the repository: client . iml...

Enable WebGL on Chrome

Image
First, enable hardware acceleration: Go to  chrome://settings Click the  + Show advanced settings  button In the  System  section, ensure the  Use hardware acceleration when available  checkbox is checked (you'll need to relaunch Chrome for any changes to take effect) Then enable WebGL: Go to  chrome://flags Enable Override software rendering list   ,  WebGL Draft Extensions and  WebGL 2.0 Prototype   Ensure that  Disable WebGL  is not activated (you'll need to relaunch Chrome for any changes to take effect) Then inspect the status of WebGL: Go to  chrome://gpu Inspect the  WebGL  item in the  Graphics Feature Status  list. The status will be one of the following: Hardware accelerated  — WebGL is enabled and hardware-accelerated (running on the graphics card). Software only, hardware acceleration unavailable  — WebGL is enabled, but running in software. See...

Install Node.JS and npm behind a firewall / company proxy - Galen Framework

Image
Problem:  Unable to install npm behind the proxy Solution:   Similar to what we did when we installed git  http://go-gaga-over-testing.blogspot.com.au/2015/04/setup-github-within-companys-firewall.html  behind a company's firewall we shall edit the config settings for Node The best way to install npm is to install node using  the node.js installer .  npm is installed as part of node. The problem occurs when you clone the Node repository from  Github npm uses a configuration file and it can be added to via the command line npm config set ... To get packages behind a proxy npm config set strict-ssl false npm config set registry "http://registry.npmjs.org/" npm config set proxy http://"username:password"@proxy:8080 npm config set https-proxy http://proxy-server-address:8080  Update:  Try changing to npm config set registry "http s ://registry.npmjs.org/" Update: You can skip the username password and just ha...

Test Automation for the REST API

Image
With the REST architecture taking over the old MVC patterns, most API started using just one way to communicate with HTTP. Suddenly the business logic and any kind of data processing was done at the server and the client side was only responsible for representation of data and basic manipulations. Testing of the REST API layer can be done using the REST-assured library that was developed by jay-way company. RESTful APIs generally are of two types: one returning XML responses and one returning JSON response. The assured - lib supports POST, GET, PUT, DELETE, OPTIONS, PATCH and HEAD requests and can be used to validate and verify the response of these requests. Rest-Assured and its dependencies ( https://code.google.com/p/rest-assured/wiki/Downloads ) POM dependencies for the Rest Assured and its dependencies:  You can add a flavor of BDD by using tools like cucumber or specflow: When /^ I send a GET request for "([^\"]*)" $ / do | path | get path e...

Repost: Angular + Protractor + Sauce Connect, Launched From Gulp, All Behind A Corporate Firewall!

Image
You didn't think it could be done, did you? Well, let me prove you wrong!  First, some terms: AngularJS : An MVC framework for JavaScript, allowing you to write web apps without relying on JQuery. Protractor : A test harness for Angular apps. Sauce Labs : A company providing cloud services to help you run E2E testing on your web app in any environment combination. Node.js : Package manager for JavaScript.  You’ll need this for installing all the dependencies to get this tool set working. Gulp : A build manager and mundane-task automator.  Competitor with the older, well-entrenched  Grunt , but gaining popularity by the hour.  Uses JavaScript syntax, but could theoretically be used as a Makefile or shell script replacement. Here is how: http://sauceio.com/index.php/2015/03/repost-angular-protractor-sauce-connect-launched-from-gulp-all-behind-a-corporate-firewall/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+SauceLabs+%28Sauc...

Test Automation Framework Structure

Image
Here is a generic structure of a test automation tool like Selenium/Protractor/Capybara

Learn Protractor / Quick Protractor demo

Image
If you are well versed with selenium then before going through the demo have a look at these slides: http://ramonvictor.github.io/protractor/slides/#/ Now straight to the demo: Prerequisites: Download and install Nodej Go to the  NodeJS home page Click install to download the .msi installer package Run it and follow the instrucitons, you now have NPM (node package manager) and Node.js installed Open the Node.js command prompt and type in the following command to install protractor globally. npm install –g protractor If you get the error enoent read this: http://go-gaga-over-testing.blogspot.com.au/2014/09/node-grunt-error-enoent-stat-roaming-npm.html?_sm_au_=iHV1HtWvt61rRqWs You are now ready for a Proof of Concept: Demo test application and protractor tests. Setup      git clone https://github.com/juliemr/protractor-demo.git  cd protractor-demo  npm install To run Get a selenium server running at localhost:4444.  j...