Skip to content

Instantly share code, notes, and snippets.

Avatar

Itamar Gronich ItamarGronich

  • Israel
View GitHub Profile
@ItamarGronich
ItamarGronich / behat.yml
Created Jul 24, 2016
Use chrome as browser in behat
View behat.yml
default:
suites:
default:
contexts:
- Drupal\DrupalExtension\Context\MinkContext
- FeatureContext
extensions:
Behat\MinkExtension:
browser_name: 'chrome'
goutte: ~
View db_query in drupal 6
// Same example in Drupal 6
$uid = 1;
$result = db_query("SELECT n.nid, n.title, n.created
FROM {node} n WHERE n.uid = %d", $uid);
while ($record = db_fetch_object($result)) {
// Perform operations on $record->title, etc. here.
}
// NOTE: db_fetch_object and db_fetch_array have been removed from D7!
?>
@ItamarGronich
ItamarGronich / log.sh
Created Mar 8, 2017
Webdriver.IO log output
View log.sh
$itamar /v/w/u/client *924-browser-stack-tests λ env BROWSERSTACK_USERNAME="<uname>" BROWSERSTACK_ACCESS_KEY="<key>" npm run test-browserstack-local -- --spec="test/specs/login.js" -l verbose
> generated-elm@0.1.0 test-browserstack-local /var/www/unio/client
> wdio test/configs/wdio-browserstack-local.conf.js "--spec=test/specs/login.js" "-l" "verbose"
Connecting local
Connected. Now testing...
A service failed in the 'onPrepare' hook
Error: Selenium exited before it could start
at ChildProcess.errorIfNeverStarted (/var/www/unio/client/node_modules/selenium-standalone/lib/start.js:144:15)
View browserstack-log.sh
2017-3-8 13:59:1:472 REQUEST [2017-3-8 13:59:1:472] POST /session {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"browserName":"iPad","platform":"MAC","device":"iPad Air 2","deviceOrientation":"landscape","project":"Unio by harness","browserstack.debug":true,"browserstack.local":true,"name":"Submitted by - itamar","maxInstances":7,"requestOrigins":{"url":"http://webdriver.io","version":"4.6.2","name":"webdriverio"},"acceptSslCert":false,"language":"webdriverio/webdriverio/4.6.2"}}
2017-3-8 13:59:1:472 START_SESSION
2017-3-8 13:59:1:477 REQUEST [2017-3-8 13:59:1:477] GET /session/16433c67b828803d64e6104fe88ad2605bb8e5b7
2017-3-8 13:59:1:477 RESPONSE {"status":0,"value":{"webStorageEnabled":false,"locationContextEnabled":true,"browserName":"safari","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"warnings":{},"desired":{"javascriptEnabled":true,"locationContextEnabled"
@ItamarGronich
ItamarGronich / custom-commands.js
Last active Mar 8, 2017
Webdriver test localhost with browserstack
View custom-commands.js
module.exports = (browser, capabilities, specs) => {
if (!browser && browser !== null && typeof browser === 'object') {
throw new TypeError("browserElement must be the WebdriverIo browser object.")
}
const
onDesktop = capabilities.browserName !== 'iPad',
onMobile = !onDesktop;
@ItamarGronich
ItamarGronich / .hyper.js
Created Aug 10, 2017
Hyper terminal setup that causes rendering problems.
View .hyper.js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks