This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run it: ruby udemy.rb | |
require 'capybara/dsl'; | |
require 'capybara/poltergeist' | |
include Capybara::DSL; | |
Capybara.register_driver :poltergeist do |app| | |
options = { | |
:js_errors => false , | |
:js => true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'capybara/dsl'; | |
require 'capybara/poltergeist' | |
include Capybara::DSL; | |
Capybara.register_driver :chrome do |app| | |
Capybara::Selenium::Driver.new(app, :browser => :chrome) | |
end | |
Capybara.register_driver :poltergeist do |app| | |
options = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When(/^user submits the registration form with valid user information$/) do | |
enter_text IDs.items["Name"], "John" | |
enter_text IDs.items["Surname"], "Doe" | |
enter_text IDs.items["Email"], "[email protected]" | |
enter_text IDs.items["Password"], "Password1213" | |
touch IDs.items["Male"] | |
select_from_list IDs.items["Birt"], "1990" | |
touch IDs.items["Terms and Condition"] | |
touch IDs.items["Register"] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------- GIVEN -------- | |
Given(/^I go to a brand page$/) do | |
find_by(IDs.container["Brand List"]).click() | |
end | |
# ------- WHEN -------- | |
When(/^user clicks link of "([^"]*)"$/) do |item| | |
find_by(IDs.header[item]).click() | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/P/m/h/services python run.py | |
test_get_session (__main__.SoapServices) ... ok | |
test_get_token (__main__.SoapServices) ... ok | |
test_CompleteReturnRequest (__main__.SoapServices) ... ok | |
test_ReturnTransactionRequest (__main__.SoapServices) ... ok | |
test_UserInfoRequest (__main__.SoapServices) ... ok | |
test_RefundRequest (__main__.SoapServices) ... ok | |
test_StartTransactionRequest (__main__.SoapServices) ... ok | |
test_ReturnTransactionRequest (__main__.SoapServices) ... ok |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.common.action_chains import ActionChains | |
# this Base class is serving basic attributes for every single page inherited from Page class | |
class Page(object): | |
def __init__(self, driver, base_url='http://www.app.com/'): | |
self.base_url = base_url | |
self.driver = driver |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"py/object":"huxley.run.Test", | |
"screen_size":{ | |
"py/tuple":[ | |
1024, | |
768 | |
] | |
}, | |
"steps":[ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ 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 |