Skip to content

Instantly share code, notes, and snippets.

View nottyo's full-sized avatar

Traitanit Huangsri nottyo

View GitHub Profile
@nottyo
nottyo / chrome-headless.robot
Created May 12, 2017 09:31
Selenium2Library with Chrome Headless Mode
*** Settings ***
Library Selenium2Library
*** Variables ***
${url} https://medium.com/@nottyo/
@{chrome_arguments} --disable-infobars --headless --disable-gpu
${page_text} Test Automation Engineer. Let’s make awesome tests
${timeout} 10s
*** Test Cases ***
{
"port": 4546,
"protocol": "http",
"stubs": [
{
"responses": [
{
"is": {
"body": {
"text": "you should see this message 2 times."
import android.support.test.espresso.idling.CountingIdlingResource;
public class EspressoIdlingResource {
private static final String RESOURCE = "GLOBAL";
private static final CountingIdlingResource countingIdlingResource = new CountingIdlingResource(RESOURCE);
public static CountingIdlingResource getCountingIdlingResource() {
return countingIdlingResource;
}
}
@nottyo
nottyo / LoadingActivity.java
Last active June 2, 2017 03:04
LoadingActivity.java
private AsyncHttpClient asyncHttpClient;
public class LoadingActivity extends Activity {
private CountingIdlingResource idlingResource = EspressoIdlingResource.getCountingIdlingResource();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activiy_loading_screen);
asyncHttpClient = new AsyncHttpClient();
// increment the counter before calling any API.
idlingResource.increment();
@nottyo
nottyo / EspressoTestBase.java
Created June 2, 2017 03:02
EspressoTestBase.java
public class TestBase {
@Rule
public ActivityTestRule<LoadingActivity> mActivityTestRule = new ActivityTestRule<>(LoadingActivity.class);
protected Activity activity;
@Before
public void setUp(){
mActivity = mActivityTestRule.getActivity();
Espresso.registerIdlingResources(mActivityTestRule.getActivity().getCountingIdlingResource());
@nottyo
nottyo / appium.log
Created August 28, 2017 08:48
twoFingerTap mobile gesture on iOS
[HTTP] --> POST /wd/hub/session/09fb1035-4cfa-4cd4-a686-2d4b96805576/execute {"script":"mobile: twoFingerTap","args":[{"duration":2,"x":200,"y":300}]}
[debug] [MJSONWP] Calling AppiumDriver.execute() with args: ["mobile: twoFingerTap",[{"duration":2,"x":200,"y":300}],"09fb1035-4cfa-4cd4-a686-2d4b96805576"]
[debug] [XCUITest] Executing command 'execute'
[debug] [BaseDriver] Waiting up to 60000 ms for condition
[debug] [JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/8675C3A5-7B88-4363-8008-E0B1C4FE9CD8/element] with body: {"using":"class name","value":"XCUIElementTypeApplication"}
[debug] [JSONWP Proxy] Got response with status 200: {"value":{"ELEMENT":"0D87FD46-CB8C-4FE1-8C3A-EA0247911E8E"},"sessionId":"8675C3A5-7B88-4363-8008-E0B1C4FE9CD8","status":0}
[debug] [JSONWP Proxy] Proxying [POST /wda/element/0D87FD46-CB8C-4FE1-8C3A-EA0247911E8E/twoFingerTap] to [POST http://localhost:8100/session/8675C3A5-7B88-4363-8008-E0B1C4FE9CD8/wda/element/0D87FD46-CB8C-4FE1-8C3A-EA0247911E8E/twoF
@nottyo
nottyo / Procfile
Created July 7, 2018 06:21
Procfile
web: gunicorn app:app --log-file=-p
@nottyo
nottyo / runtime.txt
Created July 7, 2018 06:23
runtime.txt
python-3.6.5
@nottyo
nottyo / requirements.txt
Created July 7, 2018 06:26
requirements.txt
line-bot-sdk==1.7.1
flask==1.0.2
pylint==1.9.2
gunicorn==19.8.1
requests==2.19.1
codecov==2.0.15
@nottyo
nottyo / .travis.yml
Last active July 7, 2018 06:40
.travis.yml
language: python
python:
- 3.6
install:
- pip install -r requirements.txt
script:
- python -m unittest discover
branches:
only:
- master