Skip to content

Instantly share code, notes, and snippets.

View gunesmes's full-sized avatar
🎯
Focusing

Mesut Güneş gunesmes

🎯
Focusing
View GitHub Profile
@gunesmes
gunesmes / facebook_login.feature
Last active July 11, 2023 07:43
Capybara and Cucumber: Handling iframe, Pop-ups and Facebook Login
Feature: Facebook Login
As An anonymous user
I Want to login the webpage
So That I can buy anything
Background: Member should open home page
Given I go to home page
@javascript
Scenario: Member should be able to login with Facebook
@gunesmes
gunesmes / list_of_locust_options.py
Last active July 28, 2016 11:56
This gist is to run performance testing for the account page of www.myhabit.com.
parser.add_option(
'-H', '--host',
dest="host",
default=None,
help="Host to load test in the following format: http://10.21.32.33"
)
parser.add_option(
'--web-host',
dest="web_host",
@gunesmes
gunesmes / poltergeist
Created August 15, 2014 09:35
Capybara headless mode: PhantomJs, Poltergeist
require "Capybara"
require "rspec"
require 'capybara/poltergeist'
include Capybara::DSL
Capybara.default_driver = :poltergeist
Capybara.register_driver :poltergeist do |app|
options = {
:js_errors => true,
:timeout => 120,
@gunesmes
gunesmes / calabash_my_first.feature
Last active August 29, 2015 14:06
Calabash is a library for mobile test automation. There are not much functions to learn. It has basically, finding element, inserting text into textEdit fields, clicking and assertion functions. The important keywords are query, touch, element_exists, enter_text.
Feature: Login feature
Background: User should open the application
Given I go to login page
Scenario: As a user I can see login page
Then I should see login page
@t
Scenario: As a in-valid user I can see error message
@gunesmes
gunesmes / calabash_steps.rb
Last active August 29, 2015 14:07
Effective Use of Cucumber with Calabash
require 'calabash-android/calabash_steps'
----------------------------------------------------------
---------------------- GIVEN ---------------------------
----------------------------------------------------------
Given(/^I open the application$/) do
wait_for(180) {element_exists("button id:'submit'")}
end
@gunesmes
gunesmes / config.yaml
Created December 4, 2014 09:14
Wraith is an open source tool for comparing screenshots.
#Headless browser option
browser:
phantomjs: "phantomjs"
#slimerjs: "slimerjs"
#If you want to have multiple snapping files, set the file name here
snap_file: "javascript/snap.js"
# Type the name of the directory that shots will be stored in
directory: 'shots'
@gunesmes
gunesmes / ab_result.sh
Created December 12, 2014 15:25
Apache AB for server performance testing
~ ab -n 5000 -c 100 http://10.0.2.85:8080/id/540dae3162c7744fbb000004
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 10.0.2.85 (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
@gunesmes
gunesmes / huxley_record.json
Last active August 29, 2015 14:11
Huxley is a screenshots comparison tool developed by Facebook development teams. It is a open source tool and written by Python. It uses Selenium standalone server so you must download and run it before recording and executing your cases. Good thing for the Huxley is that you can record a case with the parameter --record so you can execute some …
{
"py/object":"huxley.run.Test",
"screen_size":{
"py/tuple":[
1024,
768
]
},
"steps":[
{
@gunesmes
gunesmes / calabash_instrumentation_failed
Last active August 29, 2015 14:12
calabash-android run gives INSTRUMENTATION_FAILED exception. This is a solution for this exception.
~/P/m/android-automation (master ⚡=) calabash-android run latest.apk features ADB_DEVICE_ARG=192.168.56.101:5555
Feature: Splash Screen
As A user
I Want to see splash screen
So That I can have an idea about the app in advance.
Background: User should open the application # features/M001_splash_screen.feature:6
android.util.AndroidException: INSTRUMENTATION_FAILED: com.arkony.maidan.test/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner
at com.android.commands.am.Am.runInstrument(Am.java:865)
at com.android.commands.am.Am.onRun(Am.java:282)
@gunesmes
gunesmes / appium_android.py
Created February 11, 2015 16:15
Appium is a tool for mobile test automation
import os
from appium import webdriver
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '4.2'
desired_caps['deviceName'] = 'Samsung Galaxy S5'
desired_caps['app'] = os.path.join('<project-path>/calabash_android_automation/sampleAndroidProjectToAutomate.apk')
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)