Skip to content

Instantly share code, notes, and snippets.

View httpurlconnection_to_curl.kt
fun toCurlRequest(request: Request): String? {
val builder = StringBuilder("curl -v ")
// Method
builder.append("-X ").append(request.method).append(" \\\n ")
// Headers
for ((key, value1) in request.headers) {
builder.append("-H \"").append(key).append(":")
for (value in value1) builder.append("").append(value)
builder.append("\" \\\n ")
}
View api_testing.py
from API import Get, Post
import requests
class Login(Post):
def __init__(self, phone_number: str):
super().__init__()
self.url = "https://somedomain.com/login"
self.headers = {
"Content-Type": "application/json"
View week-3.md

Programming Class

[[TOC]]

Week 3

Conditional If, Elif, Else

There may be times when you want to have a result

View basic-programming.md

Install Python

The easiest way to install Python is to use brew.

$ brew install python3

Print your installed Python's version.

View compound-data-types.md

Programming Class

Compound Data Type

List

List is a sorted array to store multiple data. It can also store multiple types of data.

fruits = ["banana", "apple", "orange", "kiwi"]
View person.json
{
"age": 27,
"eyeColor": "green",
"name": "Burks Santos",
"gender": "male",
"company": "COMBOGENE",
"email": "burkssantos@combogene.com",
"address": "159 Linden Street, Detroit, Georgia, 8388",
"latitude": "-68.759098",
"longitude": "-142.239765",
View appium log.txt
[HTTP] --> POST /wd/hub/session/05bab753-8429-4298-9ed9-7f933f26fdcb/element
[HTTP] {"using":"xpath","value":"//*[@resource-id=\"com.gojek.app.staging:id/product_name_view\" and @text=\"MORE\"]","sessionId":"05bab753-8429-4298-9ed9-7f933f26fdcb"}
[debug] [MJSONWP (05bab753)] Calling AppiumDriver.findElement() with args: ["xpath","//*[@resource-id=\"com.gojek.app.staging:id/product_name_view\" and @text=\"MORE\"]","05bab753-8429-4298-9ed9-7f933f26fdcb"]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [WD Proxy] Matched '/element' to command name 'findElement'
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8209/wd/hub/session/459c1392-3432-4fa8-836a-e9f873657d69/element] with body: {"strategy":"xpath","selector":"//*[@resource-id=\"com.gojek.app.staging:id/product_name_view\" and @text=\"MORE\"]","context":"","multiple":false}
[WD Proxy] Got an unexpe
View appium log.txt
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","platformVersion":"9.0","udid":"emulator-5554","deviceName":"Emulator","appActivity":"com.gojek.golife.presentation.feature.LifeSplashActivity","autoGrantPermissions":"True","automationName":"Espresso","newCommandTimeout":"50000","app":"/Users/nicholaslagaunne/Workspace/Golife/rockman/app/golife.apk","noReset":"True"},null,{"firstMatch":[{"platformName":"Android","appium:platformVersion":"9.0","appium:udid":"emulator-5554","appium:deviceName":"Emulator","appium:appActivity":"com.gojek.golife.presentation.feature.LifeSplashActivity","appium:autoGrantPermissions":"True","appium:automationName":"Espresso","appium:newCommandTimeout":"50000","appium:app":"/Users/nicholaslagaunne/Workspace/Golife/rockman/app/golife.apk","appium:noReset":"True"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1543000464278 (02:14:24 GMT+0700 (WIB))
[BaseDriver] Number capability passed in as string. Functionality may be compromised
View appium log.txt
[Appium] Welcome to Appium v1.9.2-beta.2
[Appium] Non-default server args:
[Appium] port: 4798
[Appium] Appium REST http interface listener started on 0.0.0.0:4798
[HTTP] --> POST /wd/hub/session
[HTTP] {"capabilities":{"firstMatch":[{}],"alwaysMatch":{"platformName":"Android","appium:platformVersion":"9.0","appium:udid":"emulator-5554","appium:deviceName":"Emulator","appium:appActivity":"com.gojek.golife.presentation.feature.LifeSplashActivity","appium:autoGrantPermissions":"True","appium:automationName":"Espresso","appium:newCommandTimeout":"45000","appium:app":"/Users/nicholaslagaunne/Workspace/Golife/rockman/app/golife.apk","appium:noReset":"True"}},"desiredCapabilities":{"platformName":"Android","platformVersion":"9.0","udid":"emulator-5554","deviceName":"Emulator","appActivity":"com.gojek.golife.presentation.feature.LifeSplashActivity","autoGrantPermissions":"True","automationName":"Espresso","newCommandTime
@nichotined
nichotined / pytest.md
Created May 8, 2018 — forked from kwmiebach/pytest.md
pytest cheat sheet
View pytest.md

Usage

(Remember to create a symlink pytest for py.test)

pytest [options] [file_or_dir] [file_or_dir] ...

Help: