Skip to content

Instantly share code, notes, and snippets.

View elgalu's full-sized avatar

Leo Gallucci elgalu

View GitHub Profile
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">]]></xsl:text>
<html>
<head>
<title>
Xunit Test Results - For: <xsl:value-of select="@name"/>
</title>
@elgalu
elgalu / osx_linux.sh
Last active August 29, 2015 13:59
Create OSX user and group with specific IDs to fix VMWare shared folders agains a Linux host
# Within Mac VM
sudo -s
# Create user with id 1000 and group with id 1000
dscl . -create /Groups/mygroup
dscl . -create /Groups/mygroup name mygroup
dscl . -create /Groups/mygroup passwd "clave"
dscl . -create /Groups/mygroup gid 1000
dscl . -create /Users/myuser
dscl . -create /Users/myuser UserShell /bin/bash
dscl . -create /Users/myuser RealName "myuser"
/**
* @name waitForUrlToChangeTo
* @description Wait until the URL changes to match a provided regex
* @param {RegExp} urlRegex wait until the URL changes to match this regex
* @returns {!webdriver.promise.Promise} Promise
*/
function waitForUrlToChangeTo(urlRegex) {
var currentUrl;
return browser.getCurrentUrl().then(function storeCurrentUrl(url) {
node node lib/cli.js spec/basicConf.js
Using the selenium server at http://satellite.dev:4555/wd/hub
[launcher] Running 1 instances of WebDriver....warning: more than one element found for locator by.binding("item.reusedBinding")- you may need to be more specific
...............................F................................................F.........
Failures:
1) protractor library should allow a mix of using protractor and using the driver directly
Message:
Expected 'http://portege.dev:8000/index.html' to match '#/form'.
@elgalu
elgalu / _etc_init.d_headless
Last active August 29, 2015 14:02
headless_with_vnc4server
#!/bin/bash
unset VNCSERVERARGS
VNCSERVERS=""
[ -f /etc/headless/vncservers.conf ] && . /etc/headless/vncservers.conf
prog=$"VNC server"
start() {
. /lib/lsb/init-functions
REQ_USER=$2
@elgalu
elgalu / onPrepare.conf.js
Created June 3, 2014 20:45
Easily ask for current browser capability
browser.getCapabilities().then(function(s) {
var browserName, browserVersion;
var shortName, shortVersion;
var ie, ff, ch, sa;
var platform;
platform = s.caps_.platform;
browserName = s.caps_.browserName;
browserVersion = s.caps_.version;
shortVersion = browserVersion.split('.')[0];
@elgalu
elgalu / onPrepare_dollars.js
Created September 8, 2014 22:22
Dollar shortcuts for less typing, i.e. $model, $xpath, $linkText
/**
* Dollar shortcuts for less typing, i.e. $model, $xpath, $linkText...
*
* @example
* var nameElm = $model('user.name');
* // Equivalent to
* var nameElm = element(by.model('user.name'));
*
* @example
* var chainedElm =
@elgalu
elgalu / config.js
Created November 12, 2014 13:46
StackOverflow: Activating chrome language flags when activating from protractor (selenium)
// An example configuration file.
exports.config = {
// Capabilities to be passed to the webdriver instance.
capabilities: {
browserName: 'chrome',
chromeOptions: {
prefs: {
intl: { accept_languages: "fr-FR" }
}
}
$ node index.js ;echo $?
/home/user/Dropbox/dev-z/play/bstack/node_modules/browserstack-webdriver/lib/webdriver/promise.js:1702
throw error;
^
UnknownError: <html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>