Skip to content

Instantly share code, notes, and snippets.

@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 / 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,
const ENDPOINTS = {
ACTIONS: '/session/:sessionId/actions',
}
const ActionType = {
KEY_DOWN: 'keyDown',
KEY_UP: 'keyUp',
PAUSE: 'pause',
POINTER_DOWN: 'pointerDown',
POINTER_UP: 'pointerUp',
POINTER_MOVE: 'pointerMove',
@maggiesavovska
maggiesavovska / wdio-jquery-browser-patch-keys.js
Created June 22, 2017 17:21
Webdriverio compatible in browser patch for keys
// courtesy of Thamu Gurung @thamu_gurung_twitter
browser.execute(() => {
return $(elementSelector).trigger({ type: 'mousedown', which: 39 });
});
/* The Key codes
rightArrow - 39
leftArrow - 37
down - 40
enter - 13
import React, { Component } from 'react';
import { graphql } from 'react-apollo';
import { gql } from 'graphql-tools';
const QUERY = gql`
query MatchesByDate($date: Int) {
matches(date: $date) {
id
minute
period
@maggiesavovska
maggiesavovska / appiummac.md
Created May 31, 2017 20:29
Setting Up Appium on Mac
  1. Set up for Appium:
@christian-bromann
christian-bromann / Readme.md
Last active August 8, 2017 22:04
Run Chrome headless

Run Chrome headless

The good old PhantomJS times are over. The project is not maintained anymore and it is recommended to switch over to Chrome headless. Just run a local Selenium standalone server:

$ java -jar Sites/selenium-server-standalone-3.4.0.jar
@maggiesavovska
maggiesavovska / actionsApi.txt
Last active March 26, 2018 18:42
Summary of sendKeys() and moveTo() Issues
Bunch of stuff broken? Don't fear..the Actions API is on it's way and it will probably be a good thing! Chin up!
OVERVIEW:
The purpose of this document is to explain the new actions API and what it has to do with certain commands
such as moveto and keys being depricated in webdriverio (due to them being deprecated in certain browser drivers).
MAIN ISSUE:
1. The issue is that these new drivers suppress these commands on purpose because they are deprecated,
but the drivers have not yet implemented the new WC3 standard called "actions API".
"The user-facing API for emulating complex user gestures. Use this class rather than using the Keyboard or Mouse directly."
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 22, 2024 02:29
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

var libxmljs = require("libxmljs");
var xml = [
'<?xml version="1.0" encoding="utf-8"?>',
'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">',
' <soap:Body>',
' <Response xmlns="http://tempuri.org/">',
' <Result>',
' <client xmlns="">',
' <msg>SEARCH OK.</msg>',
' <code>0</code>',