Skip to content

Instantly share code, notes, and snippets.

View wswebcreation's full-sized avatar
🤣
SaaS (Selles as a Service)

Wim Selles wswebcreation

🤣
SaaS (Selles as a Service)
View GitHub Profile
@wswebcreation
wswebcreation / start.ios.simulator.js
Created November 29, 2017 06:56
Brain fart to start an iOS simulator from the command line including starting a test
const { execFileSync, spawnSync } = require('child_process');
const inquirer = require('inquirer');
console.log(`
============================
iOS Simulator CLI Helper
============================
`);
@wswebcreation
wswebcreation / conversation.json
Last active January 21, 2018 08:37
This JSON is part of the demo app of wswebcreation and is used in the Chat view. This is the default conversation
[
{
"placeRight": true,
"message": "I'm fine, how are you?"
},
{
"placeRight": false,
"message": "Hey wassup?"
}
]
@wswebcreation
wswebcreation / chat.history.json
Last active January 21, 2018 08:37
This JSON is part of the demo app of wswebcreation and is used in the Chat view. This is the chat history
[
{
"firstName": "Dick",
"lastName": "Tracy",
"conversation": [
{
"placeRight": true,
"message": "So it seems like this internet thing is here to stay, huh?"
},
{
@wswebcreation
wswebcreation / onliners.response.json
Last active December 9, 2017 18:50
This JSON is part of the demo app of wswebcreation and is used in the Chat view. These oneliners are used as responses in the chat
[
"May the force be with you.",
"Bond. James bond.",
"I’ll be back",
"Houston, we have a problem.",
"You talking to me?",
"Here’s Johnny!",
"Go ahead, make my day.",
"Say hello to my little friend!",
"Yippee-ki-yay, Motherf*cker!",
@wswebcreation
wswebcreation / after.scenario.js
Created May 18, 2018 12:09
Setup for attaching the difference to the Cucumber report file. This can be used with Protractor + CucumberJS + protractor-image-comparison
import { After, Status } from 'cucumber';
import { resolve } from 'path';
const fs = require('fs');
const diffFolder = resolve(process.cwd(), '.tmp/report/screenshots/image-comparison/diff/');
const screenshotFolder = resolve(process.cwd(), '.tmp/screenshots/');
/**
* The After hook that checks the scenario status and creates a
* screemshot if needed
@wswebcreation
wswebcreation / find.element.js
Last active June 3, 2018 15:03
Find an element that can't be find in the UI-tree with Appium + webdriver.io by using an other component
let SEND_BUTTON_COORDINATES;
const SELECTORS = {
INPUT: '~test-Message input',
ADD_BUTTON: '~test-Add',
SEND_BUTTON: '~test-Send',
};
export class ChatInput {
/**
* Get the chat input
@wswebcreation
wswebcreation / table.hashes.js
Last active July 4, 2023 06:54
The difference in `table.hashes()` and `table.rowsHash()` in CucumberJS
import { Given } from 'cucumber';
/**
* Transform a cucumberjs data table to an Array
*
* @example
* <pre>
* // insert from featurefile
* Given a table hashes step
* | Vegetable | Rating |
@wswebcreation
wswebcreation / webdriverio.appium.native.swipe.js
Last active February 15, 2023 12:00
This gist holds some methods I use to do swiping on iOS and Android
/**
* Here you'll find some swipe methods for a native iOS or Android app
* which can be used when you are using webdriver.io
*
* I work a lot based on percentages, so it is working on all screens and all devices
* and I hope you understand how to use it based on the docs.
*
* Feel free to use it for all kinds of purposes, a star is much appreciated ;-)
*
* Grtz,
@wswebcreation
wswebcreation / start.android.emulator.js
Last active March 7, 2024 13:41
Start your Android emulator from the command line with a simple questions form
/**
* With this helper you can start emulators from the command line with some easy questions.
* It will automatically list all AVD's that you've configuered on your machine.
*
* NOTE 1: MAKE SURE YOU'VE ADDED inquirer WITH `npm install inquirer --D` TO YOUR DEV DEPENDENCIES
* NOTE 2: MAKE SURE YOU'VE SETUP UP YOUR ENVIRONMENT CORRECTLY WITH ALL THE ENVIRONMENT VARIABLES NEEDED
* FOR MAKING ANDROID WORK ON YOUR MACHINE
* NOTE 3: MAKE USE YOU HAVE SET YOUR `HOME`, THAT SHOULD BE SOMETHING LIKE `/Users/wswebcreation`
* NOTE 4: MAKE SURE YOU'VE SET THE `ANDROID_EMULATOR_PATH` TO THE CORRECT PATH ON YOUR MACHINE
* WHERE ALL THE EMULATORS ARE LISTED, WITHOUT THE `HOME` PATH IN IT
@wswebcreation
wswebcreation / 1.issue.md
Created July 12, 2018 05:16
`An unknown server-side error occurred while processing the command` while sending text to an iOS simulator

Issue:

Typing text into an input text element on an iOS simulator with webdriver.io and Appium is causing an error like this

An unknown server-side error occurred while processing the command. Original error: An unknown server-side error occurred while processing the command.

The result is a failing test.

The command

The command is very simple, just this $('~test-Stel hier je vraag.').setValue('Ben je er?')