Skip to content

Instantly share code, notes, and snippets.

@nichotined
nichotined / check_ssl
Created April 18, 2018 09:40
To get detailed ssl
curl --insecure -v https://www.google.com 2>&1 | awk 'BEGIN { cert=0 } /^\* SSL connection/ { cert=1 } /^\*/ { if (cert) print }'
pytest -v mytest.py::TestClassName --html=report_localhost.html
@nichotined
nichotined / pytest.md
Created May 8, 2018 10:00 — forked from kwmiebach/pytest.md
pytest cheat sheet

Usage

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

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

Help:

[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
[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
[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
{
"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",

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"]

Install Python

The easiest way to install Python is to use brew.

$ brew install python3

Print your installed Python's version.

Programming Class

[[TOC]]

Week 3

Conditional If, Elif, Else

There may be times when you want to have a result