Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@beatfactor
beatfactor / chromedriver.js
Created August 25, 2015 19:55
chromedriver
var chromedriver = require('chromedriver');
var moduleFolder = '../../node_modules/chromedriver/lib/chromedriver/';
var path = require('path');
var binPath = path.resolve(path.join(moduleFolder, process.platform === 'win32' ? 'chromedriver.exe' : 'chromedriver'));
module.exports = {
defaultInstance : null,
start : function() {
this.defaultInstance = require('child_process').execFile(binPath, [
@beatfactor
beatfactor / globals.js
Created September 8, 2015 20:26
globals.js
module.exports = {
groupGlobals : null,
checkGroupGlobals : function(hookName) {
if (hookName && this.groupGlobals) {
return this.groupGlobals[hookName];
}
if (this.test_settings.group_name) {
try {
@beatfactor
beatfactor / elementEmpty.js
Created September 30, 2015 20:45
elementEmpty.js
exports.assertion = function(selector) {
this.selector = selector;
this.message = 'Testing if element <' + selector + '> has no descendents.';
this.expected = true;
this.pass = function(value) {
return value && (value.length === 0);
};
this.value = function(result) {
@beatfactor
beatfactor / nw_api_wish.md
Created August 31, 2017 08:36 — forked from senocular/nw_api_wish.md
Nightwatch API Wishlist
  • all callbacks use result object
  • custom commands, page object/section commands have same behavior/interface
  • client/api property consistency
  • better separation of user-defined apis and internal properties (page objects etc)
  • page/section objects have full api surface
  • Page objects, commands classes, having proper instanceof-checkable instances (no weird F() constructor)
  • Support command overrides rather than throwing an error
  • no legacy stuff
    • afterEach hook can receive the browser object only in its async form
  • async behavior consistency/clarity
@beatfactor
beatfactor / install_nginx_macos_source.md
Last active December 3, 2023 13:20
Install Nginx on Mac OS from source (without brew)

Install Nginx on Mac OS from source

no Homebrew required

1. Download Nginx

$ cd /usr/local/src
$ curl -OL http://nginx.org/download/nginx-1.12.2.tar.gz
$ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz
@beatfactor
beatfactor / 01 – Running serialport in Docker with node alpine.md
Last active March 20, 2023 15:21
Running serialport in Docker with node alpine

When attempting to build the awesome serialport NPM package in Docker using a node alpine image, in usually failes on building the node-gyp package.

There are various workarounds which can be found online, such as this one.

However, the key ingredient is building the serialport package from source, using this line:

npm install serialport --build-from-source=serialport
@beatfactor
beatfactor / README.md
Last active March 14, 2022 20:49
Installing azure-cli on MacOS M1

Building Azure CLI on Apple Silicon MacOS (M1)

First, install homebrew.

Build cffi

To build and install cffi follow these steps:

  1. Install libffi