Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Kills processes located at specific ports
# killport 8000
# killport 8001 8001
for port in "$@"
do
# Echoes pid of process at port
pid=$(lsof -t -i:$port)
@hyperh
hyperh / deploy-static-site-heroku.md
Created November 13, 2019 20:54 — forked from wh1tney/deploy-static-site-heroku.md
How to deploy a static website to Heroku

Gist

This is a quick tutorial explaining how to get a static website hosted on Heroku.

Why do this?

Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions

{
"name": "appiumPythonAwsTutorial",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "source venv/bin/activate && LOCATION='local' py.test && deactivate",
"appium": "appium",
"appium-doctor": "appium-doctor"
},
import pytest
import os
from appium import webdriver
AWS = 'aws'
LOCAL = 'local'
def get_desired_capabilities(location=AWS):
if location == LOCAL:
def test_button(driver):
WAIT_SEC = 10
driver.implicitly_wait(WAIT_SEC)
btn = driver.find_element_by_accessibility_id('button')
btn.click()
btn.click()
counter = driver.find_element_by_accessibility_id('counter')
assert counter.text == '2'
def test_basic(driver):
WAIT_SEC = 10
driver.implicitly_wait(WAIT_SEC)
elem = driver.find_element_by_accessibility_id('testview')
assert elem is not None
import pytest
import os
from appium import webdriver
@pytest.fixture(scope="function")
def driver():
driver = webdriver.Remote(
command_executor='http://127.0.0.1:4723/wd/hub',
desired_capabilities={
export default class appiumTutorial extends Component {
state = {
counter: 0,
text: '',
}
onPress = () => this.setState({ counter: this.state.counter + 1 })
onChangeText = text => this.setState({ text })
render() {
export default class appiumTutorial extends Component {
state = {
counter: 0
}
onPress = () => this.setState({ counter: this.state.counter + 1 })
render() {
return (
<View style={styles.container} accessibilityLabel="testview">
test('appium text input', async () => {
const TEXT = 'hello this is appium';
await driver.elementByAccessibilityId('textinput')
.type(TEXT);
const resultText = await driver.elementByAccessibilityId('text').text();
expect(resultText).toBe(TEXT)
});