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
[debug] [W3C (0bedd823)] Responding to client with driver.createSession() result: {"capabilities":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"platformName":"iOS","deviceName":"iPhone X","platformVersion":"12.2","orientation":"PORTRAIT","automationName":"XCUITest","app":"/Users/wimselles/Sauce/Git/appium-boilerplate/apps/iOS-Simulator-NativeDemoApp-0.3.0.app.zip","newCommandTimeout":240,"udid":"EAE23CD4-7B34-42D6-BBFB-F74B1543944D"}}
[HTTP] <-- POST /wd/hub/session 200 98636 ms - 569
[HTTP]
[HTTP] --> POST /wd/hub/session/0bedd823-3af4-4e59-a0c0-f9cfc370c6d6/element
[HTTP] {"using":"accessibility id","value":"Home, tab, 1 of 5"}
[debug] [W3C (0bedd823)] Calling AppiumDriver.findElement() with args: ["accessibility id","Home, tab, 1 of 5","0bedd823-3af4-4e59-a0c0-f9cfc370c6d6"]
[debug] [XCUITest] Executing command 'findElement'
[debug] [BaseDriver] Valid locat
[HTTP] --> POST /wd/hub/session
[HTTP] {"capabilities":{"alwaysMatch":{"platformName":"iOS","appium:deviceName":"iPhone X","appium:platformVersion":"12.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:app":"/Users/wimselles/Git/wdio-native-demo-app/ios/build/wdioDemoApp/Build/Products/Debug-iphonesimulator/wdioDemoApp.app","appium:newCommandTimeout":240},"firstMatch":[{}]},"desiredCapabilities":{"platformName":"iOS","appium:deviceName":"iPhone X","appium:platformVersion":"12.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:app":"/Users/wimselles/Git/wdio-native-demo-app/ios/build/wdioDemoApp/Build/Products/Debug-iphonesimulator/wdioDemoApp.app","appium:newCommandTimeout":240}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"iOS","appium:deviceName":"iPhone X","appium:platformVersion":"12.2","appium:orientation":"PORTRAIT","appium:automationName":"XCUITest","appium:app":"/Users/wimselles/Git/wdio-native-demo-app/ios/build
@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 / draw.sauce.bolt.js
Last active March 27, 2020 20:28
The Test to draw the Sauce Labs Bolt with Appium, WebdriverIO and the W3C actions
// You can download the app from here
// http://appium.s3.amazonaws.com/ApiDemos-debug-2015-03-19.apk
//
// If you want to use the app, make sure you add this into your capabilities
// appActivity: '.graphics.FingerPaint',
// This will make sure that the FingerPaint screen is opened at once!
//
// Thanks to Jonathan Lipps for this Article
// https://appiumpro.com/editions/29
@wswebcreation
wswebcreation / appium.1.18.3.log
Last active November 15, 2020 14:10
Appium Android Hybrid App not getting active webview
[Appium] Welcome to Appium v1.18.3
[Appium] Non-default server args:
[Appium] basePath: /
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /session
[HTTP] {"capabilities":{"alwaysMatch":{"automationName":"UiAutomator2","deviceName":"Pixel_3_10.0","platformName":"Android","platformVersion":"10.0","orientation":"PORTRAIT","app":"/Users/wimselles/Sauce/Git/SauceLabsHybridApp/apps/Android.SauceLabs.Hybrid.app.1.0.0.apk","appWaitActivity":"com.saucelabshybridapp.MainActivity","noReset":true,"autoGrantPermissions":true,"newCommandTimeout":240,"language":"en","locale":"en"},"firstMatch":[{}]},"desiredCapabilities":{"automationName":"UiAutomator2","deviceName":"Pixel_3_10.0","platformName":"Android","platformVersion":"10.0","orientation":"PORTRAIT","app":"/Users/wimselles/Sauce/Git/SauceLabsHybridApp/apps/Android.SauceLabs.Hybrid.app.1.0.0.apk","appWaitActivity":"com.saucelabshybridapp.MainActivity","noReset":true,"autoGrantPermissions":true,"newCommandTimeout":240,"language":"en
@wswebcreation
wswebcreation / getNativeText.js
Created July 18, 2018 07:36
Get text from native iOS/Android elements with webdriver.io and Appium
/**
* This a method to get text from a native iOS/Android app component.
* It can be used when you are using webdriver.io
*
* In the app I need to automate I found out that:
* - iOS will have the complete text (of all the childeren) in the parent component.
* - on Android a component can have mutiple childrens, that's why you get an array of text back
*
* Feel free to use it for all kinds of purposes, a star is much appreciated ;-)
*
@wswebcreation
wswebcreation / selectors.js
Last active August 10, 2022 21:51
Preferred Native Appium Selectors for WebdriverIO
// The `~` tells WebdriverIO that it needs to look for an accessibiltyID
// Android: `content description`
// iOS: `accessibility id`
$('~accessibiltyID').click();
// -ios predicate string
const loginButton = 'type == \'XCUIElementTypeOther\' && name CONTAINS \'test-LOGIN\'';
$(`-ios predicate string:${ loginButton }`).click();
// -ios class chain, to make complex selectors
@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 / 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 / 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