Skip to content

Instantly share code, notes, and snippets.

//Define fluent wait
FluentWait wait = new FluentWait(driver)
.withTimeout(15, TimeUnit.SECONDS)
.pollingEvery(1,TimeUnit.SECONDS)
.ignoring(NoSuchElementException.class);
wait.until(new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver d) {
@jineshqa
jineshqa / appium.log
Created August 23, 2017 19:51
appium log without tap
appium -a 127.0.0.1 -p 4723 --chromedriver-port 9515 --chromedriver-executable /Users/Jinesh/Documents/Jinesh/xxxx/workspace/Appium/Java/lib/chromedriver --no-reset
[Appium] Welcome to Appium v1.6.5
[Appium] Non-default server args:
[Appium] address: 127.0.0.1
[Appium] chromeDriverPort: 9515
[Appium] chromedriverExecutable: /Users/Jinesh/Documents/Jinesh/xxxx/workspace/Appium/Java/lib/chromedriver
[Appium] noReset: true
[Appium] Deprecated server args:
[Appium] --no-reset => --default-capabilities '{"noReset":true}'
[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:
@jineshqa
jineshqa / downgrade.md
Created November 14, 2017 05:29 — forked from danjesus/downgrade.md
Downgrade Jenkins Version

How to downgrade a jenkins version by command line

  • First locate your jenkins.war file, most of time it is located in /usr/share/jenkins
  • Rename jenkins.war to jenkins.war.old mv jenkins.war jenkins.war.old
  • Get a version from jenkins example: http://updates.jenkins-ci.org/stable-2.32/latest/jenkins.war sudo wget http://updates.jenkins-ci.org/stable-2.32/latest/jenkins.war
  • Now start or restart jenkins service sudo service jenkins restart
@jineshqa
jineshqa / ubuntu package hold.md
Last active November 14, 2017 05:36
Put a package on hold in ubuntu

dpkg

Put a package on hold:

echo "<package-name> hold" | sudo dpkg --set-selections

Remove the hold:

echo "<package-name> install" | sudo dpkg --set-selections
@jineshqa
jineshqa / grep.md
Last active November 17, 2017 23:53
grep command
$ cat a.txt

hello

This line starts with T and finishes with e

foo

@jineshqa
jineshqa / udid.md
Last active March 7, 2019 01:59
How to get udid for a particular device from shell using jq

With JQ installed - output of this command is string with quotes

xcrun simctl list --json | jq '.devices["iOS 12.0"] [] | select(.name=="iPhone X") | .udid'

With JQ if you don't want quotes

@jineshqa
jineshqa / XCUIApplication+Scrolling.swift
Created November 14, 2018 19:33 — forked from ryanmeisters/XCUIApplication+Scrolling.swift
Scrolling helpers automated ui tests using XCUIApplication
extension XCUIApplication {
private struct Constants {
// Half way accross the screen and 10% from top
static let topOffset = CGVector(dx: 0.5, dy: 0.1)
// Half way accross the screen and 90% from top
static let bottomOffset = CGVector(dx: 0.5, dy: 0.9)
}
var screenTopCoordinate: XCUICoordinate {
@jineshqa
jineshqa / scroll.swift
Last active April 6, 2019 22:40
code to scroll to an element
// Copied from https://stackoverflow.com/a/49944637
import XCTest
enum TestSwipeDirections {
case up
case down
case left
case right
}
@jineshqa
jineshqa / Makefile
Created January 11, 2019 18:21 — forked from pietbrauer/Makefile
Shutdown and reset all iOS Simulators
erase_sim:
./reset_sim.sh 2>/dev/null; true
@jineshqa
jineshqa / screen_commands.sh
Created March 5, 2019 00:39
Screen command usages
# to list the sessions and their status
screen -ls
# to start a session with a given name. The name should be unique
screen -S session_name
# to start a session without going into it
screen -dmS session_name /path/to/script/file.sh