Open Source JavaScript Test Runner | Cypress.io

For end to end testing of websites, should be really simple to use and easier to setup than Selenium. Write javascript to execute tests.

Until now, end-to-end testing wasn’t easy. It was the part developers hated.
Not anymore. Cypress makes setting up, writing, running and debugging tests easy.

En example:

describe('My First Test', function() {
  it('finds the content "type"', function() {
    cy.visit('https://example.cypress.io')

    cy.contains('hello world')
  })
})

This will visit the Cypress example site, look for an element with the text “hello world” and fail the test if it doesn’t exist.

Source: Open Source JavaScript Test Runner | Cypress.io

cors-proxy-server – npm

I wanted to try out some Angular code against a demo odata service, but when requesting data from another domain in a web browser (the angular context) you might get:

Access to XMLHttpRequest at ‘http://services.odata.org/V4/OData/OData.svc/Products?$format=json’ from origin ‘http://localhost:4200’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: Redirect is not allowed for a preflight request.

To get around this problem you could use a node proxy like this one:

Source: cors-proxy-server – npm

Install and start it up. Now we can call the odata service by prepending the proxy url before the actual api endpoint like this:
http://localhost:9090/http://services.odata.org/V4/OData/OData.svc/Products

Notice the double http://

The entire CORS problem can be summarized like this:

The web browser will prevent javascript to get a response from the service at domain x if that server does not explicitly say its ok to respond the remote caller. In our case our source domain is ‘localhost’ and the services.odata.org haven’t added that as a valid domain to respond to according to the web browser.

More info regarding CORS here: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

Grayscale mode in Windows 10, distraction-free reading with f.lux

This new version of f.lux has a grayscale mode and new key to turn it on: Windows + End.

The big surprise is how distracting the icons on the top and bottom of your screen are. These icon colors are the kind of thing you see in candy stores and on fire alarms, but we have to ignore them just to get work done. Without those colors, your computer looks more like a magazine that can help you focus on reading or thinking—it feels different, like a sheet of paper.

Source: What’s new with f.lux

Visual Studio Extension – Live Sass Compiler

Really simple and useful when working with sass files in Visual Studio Code.
Install from link below.
Click “Watch sass” in lower right corner of Visual Studio Code.
Edit an scss file and save. -> compiles to css file in the same directory. Also works with live browser reload. See output window / extensions / Live Sass Compile for process info.

Source: Live Sass Compiler – Visual Studio Marketplace

Log4View – log4net log viewer

Log4View is a powerful and comfortable viewer for log4net, NLog, log4j and log4xx

Log4View Community Edition is free to use. 

Log4View comes in three different editions:

  • Log4View Professional Edition is the most complete edition of Log4View. It can handle up to 255 different log sources simultaneously, can read input from databases and visualizes log messages as text and chart.
  • Log4View Trial Edition has the same features as Log4View Proferssional Edition but expires 30 days after installation. After expiration, the Trial Edition continues working as Community Edition.
  • Log4View Community Edition is limited to one log source, has no access to databases and can’t visualize log messages as chart. Log4View Community Edition is free for personal, non commercial use.

Download: Log4View – LOG4VIEW – created by PROSA