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 / 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 / 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 / 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 / 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 / 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 / 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 / test_data.rb
Created June 21, 2014 10:15
With this module, you can create test e-mail address and you can check if you get a related email. You can use this for Google account.
require 'net/imap'
class TestData
def initialize()
@emailBase = "username"
@emailSup = "gmail.com"
@password = "password"
@emails = ""
end
@gunesmes
gunesmes / amazon_set_window_size_and_check_css.rb
Last active August 29, 2015 14:02
set the width and heigth of the browser and then check if the width of navigation bar has full length by executing jQuery.
require 'capybara/dsl'
include Capybara::DSL
Capybara.default_driver = :selenium
visit "http://www.amazon.com/"
# the screen size will be fixed as the following resolution
# then navigation bar is expected to fill full size of header.
# if there is a scroll bar, its width shoul be subtracted as 15px.
@gunesmes
gunesmes / new_member.feature
Last active August 29, 2015 14:02
Deterministic Way of Test Automation
Feature: New member
As A user
I Want to become member
So That I buy something
Background: User open sign-up page
Given I go to home page
When I click "sign-up button"
@javascript
@gunesmes
gunesmes / testCases.java
Last active August 29, 2015 14:00
From Java, you can call Python function which creates a new e-mail for testing.
import org.python.antlr.ast.Str;
import org.python.core.PyObject;
import org.python.util.PythonInterpreter;
public class ProjectName{
public String createEmail() {
PythonInterpreter python = new PythonInterpreter();
// full path of the python file
python.execfile("D:\\workspace\\pojectname\\src\\com\\base\\test_data.py");