Skip to content

Instantly share code, notes, and snippets.

View reubenmiller's full-sized avatar

Reuben Miller reubenmiller

  • Hamburg, Germany
View GitHub Profile
@reubenmiller
reubenmiller / WebDriverIO.js
Last active January 28, 2018 17:19
WebDriverIO.js with modified resizeWindow function
let webdriverio;
const requireg = require('requireg');
const Helper = require('../helper');
const stringIncludes = require('../assert/include').includes;
const { urlEquals, equals } = require('../assert/equal');
const empty = require('../assert/empty').empty;
const truth = require('../assert/truth').truth;
const {
xpathLocator, fileExists, clearString, decodeUrl, chunkArray,
} = require('../utils');
@reubenmiller
reubenmiller / SeleniumService.ps1
Created February 3, 2018 08:16
Create Selenium Server Service in Windows
Function Install-SeleniumService {
[cmdletBinding()]
Param(
[string] $Name = "SeleniumServer",
[string] $InstallPath = "C:\selenium"
)
$JavaPath = Get-Command "java.exe" | Select-Object -Last 1 -ExpandProperty Definition
if (!(Test-Path $InstallPath)) {
@reubenmiller
reubenmiller / pageObjectExample_test.js
Created February 11, 2018 18:53
[CodeceptJS] Using grab functions within page objects (async/await)
Feature('Page Object Examples');
Scenario('Call page object function', async (I, testPageObj) => {
I.amOnPage('/');
const res = await testPageObj.getSomething();
console.log('page object result', res);
});
@reubenmiller
reubenmiller / customHelper.js
Last active February 12, 2018 22:06
[CodeceptJS] Using asserts in a custom Helper
'use strict';
const assert = require('assert');
const axios = require('axios');
let Helper = codecept_helper;
class MyHelper extends Helper {
async runMyAssert(expect) {
assert.equal(true, false);
@reubenmiller
reubenmiller / codecept.conf.js
Created February 26, 2018 12:19
Example of custom helper to perform conditional click (without throwing an error)
const outputFolder = './output';
exports.config = {
output: outputFolder,
helpers: {
Puppeteer: {
url: 'http://google.com',
show: true,
chrome: {}
},
@reubenmiller
reubenmiller / actor.js
Created March 6, 2018 17:07
Supporting Multiple Helper with the same functions
const Step = require('./step');
const container = require('./container');
const methodsOfObject = require('./utils').methodsOfObject;
const recorder = require('./recorder');
const event = require('./event');
const output = require('./output');
/**
* Fetches all methods from all enabled helpers,
* and makes them available to use from I. object
@reubenmiller
reubenmiller / psc8y.completion.definitions.ps1
Created February 2, 2021 08:34
PSc8y argument completions example
<#
.SYNOPSIS
Provides argument completions for dynamic data by querying Cumulocity for the values
#>
$RoleCompleter = {
param ($commandName, $parameterName, $wordToComplete)
if ($wordToComplete -is [array]) {
$searchFor = $wordToComplete | Select-Object -Last 1
} else {
$searchFor = $wordToComplete
@reubenmiller
reubenmiller / mac-install.sh
Created December 16, 2022 11:26
mac install setup - homebrew without sudo
#!/bin/bash
# -------------------------------------------------------------------------------------------------------
# Pre-requisites
# This should be manually installed by the user (though it might be automatically installed by brew?)
# xcode-select --install
# -------------------------------------------------------------------------------------------------------
# Options
HOMEBREW_NO_SUDO=true
HOMEBREW_INSTALL_PATH=
@reubenmiller
reubenmiller / bootstrap-aws.sh
Created January 25, 2023 13:41
thin-edge.io bootstrap aws (custom example)
#!/bin/bash
##################################################################################################
# Install and bootstrap thin-edge.io to enable AWS communication
# A custom tedge and tedge-mapper version is used as the AWS functionality has not been
# merged into the main branch.
#
# Usage:
# sudo ./tedge-aws-bootstrap.sh
#
# Checkout the following links for more guidance on how to setup AWS and connect thin-edge.io to it
@reubenmiller
reubenmiller / tedge-cross-compile-with-zig.md
Last active May 20, 2024 09:56
How to cross compile tedge using zig

How to cross compile a rust project using zig? wtf.

I was able to compile and cross compile the gnu and musl variants to all of our target triples :)

  1. Install the cargo-zigbuild and dependencies (requires python3)

    pip3 install ziglang
    cargo install cargo-zigbuild