appium-rspec-bootstrap 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5ef55866d785e657c8426fbdbbcbcd239f62b8ea
4
+ data.tar.gz: eaedc3856775350c5a2a327e3f264f93c5904ee9
5
+ SHA512:
6
+ metadata.gz: 50ab6ca05e6589f206cc45ab5ed386e42899df8caa0acdd9d0ce58db1976ece85a2e183b473de072d9579e2943722c04999dee87dd7d4df7f6898aefb694cfc2
7
+ data.tar.gz: 3d15183d2dbf42daad67e2fd542c0c2ba201ca6d65d4d9f6d2f18f6c0a4fc799ccc8813c8550285f3c70c59ecd97b6ed7526aeba06d57f046ef87288118ee429
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in appium-rspec-bootstrap.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Alex Mishyn
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,12 @@
1
+ # Appium Rspec Bootstrap
2
+
3
+ This is a collection of scripts to automate testing process with appium and rspec.
4
+ It includes scripts to build app, mock api server and run alltogether
5
+
6
+
7
+ Getting started
8
+ ===============
9
+
10
+ gem install appium-rspec-bootstrap
11
+
12
+ appium-rspec-bootstrap projects-test ~/workspace/project-ios/Project.xcworkspace/
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'appium/rspec/bootstrap/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "appium-rspec-bootstrap"
8
+ spec.version = Appium::Rspec::Bootstrap::VERSION
9
+ spec.authors = ["Alex Mishyn"]
10
+ spec.email = ["mishyn@gmail.com"]
11
+ spec.description = %q{Appium + rspec bootstrap}
12
+ spec.summary = %q{Appium + rspec bootstrap}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+
20
+ spec.add_development_dependency "bundler", "~> 1.3"
21
+ spec.add_development_dependency "rake"
22
+ spec.add_runtime_dependency "thor"
23
+ end
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env ruby
2
+ require "rubygems" # ruby1.9 doesn't "require" it though
3
+ require "thor"
4
+
5
+ class Appium < Thor::Group
6
+ include Thor::Actions
7
+
8
+ desc "create skeleton in directory NAME for project PATH"
9
+ # Define arguments and options
10
+ argument :project_name, :desc => 'directory to be generated'
11
+ argument :path, :desc => 'path to ios project .xcworkspace'
12
+
13
+ def name
14
+ File.basename(path,'.*')
15
+ end
16
+
17
+ def self.source_root
18
+ File.dirname(__FILE__)
19
+ end
20
+
21
+ def create_folders
22
+ directory File.join('..', 'templates'), project_name
23
+ end
24
+
25
+ def give_rights
26
+ chmod "#{project_name}/build-app", 0755
27
+ end
28
+
29
+ def notice
30
+ puts "Next steps:"
31
+ puts "$: cd #{project_name}"
32
+ puts "$: bundle"
33
+ puts "$: ./build-app"
34
+ puts "$: bundle exec foreman start"
35
+ puts "$: bundle exec rspec spec/"
36
+ end
37
+
38
+ end
39
+
40
+ Appium.start
@@ -0,0 +1,9 @@
1
+ require "appium/rspec/bootstrap/version"
2
+
3
+ module Appium
4
+ module Rspec
5
+ module Bootstrap
6
+ # Your code goes here...
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ module Appium
2
+ module Rspec
3
+ module Bootstrap
4
+ VERSION = "0.0.1"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ source "https://www.rubygems.org"
2
+
3
+ gem "rspec"
4
+ gem "selenium-webdriver"
5
+ gem 'sinatra'
6
+ gem 'sinatra-contrib'
7
+ gem 'byebug'
8
+ gem 'foreman'
9
+ gem 'sinatra-reloader'
10
+ gem 'puma'
@@ -0,0 +1,2 @@
1
+ api: bundle exec rackup -s puma -p 5000
2
+ appium: appium
@@ -0,0 +1,7 @@
1
+ require 'sinatra'
2
+ require "sinatra/json"
3
+ require 'sinatra/reloader'
4
+
5
+ get '/api' do
6
+ json [{}]
7
+ end
@@ -0,0 +1,8 @@
1
+ xcodebuild -sdk iphonesimulator6.0 \
2
+ -workspace <%= path -%> \
3
+ -scheme <%= name -%> \
4
+ ONLY_ACTIVE_ARCH=NO \
5
+ TARGETED_DEVICE_FAMILY=1 \
6
+ DEPLOYMENT_LOCATION=YES \
7
+ DSTROOT=`pwd`/app
8
+
@@ -0,0 +1,3 @@
1
+ # encoding: UTF-8
2
+ require './api_server'
3
+ run Sinatra::Application
@@ -0,0 +1,34 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require 'rspec'
5
+ require 'selenium-webdriver'
6
+
7
+ def absolute_app_path
8
+ file = File.join(File.dirname(__FILE__), '../app/Applications/<%=name-%>.app')
9
+ raise "App doesn't exist #{file}" unless File.exist? file
10
+ file
11
+ end
12
+
13
+ capabilities = {
14
+ 'browserName' => 'iOS',
15
+ 'platform' => 'Mac',
16
+ 'version' => '6.0',
17
+ 'app' => absolute_app_path
18
+ }
19
+
20
+ server_url = "http://127.0.0.1:4723/wd/hub"
21
+
22
+
23
+ RSpec.configure do |config|
24
+ config.before(:all) do
25
+ @driver = Selenium::WebDriver.for(:remote,
26
+ :desired_capabilities => capabilities,
27
+ :url => server_url)
28
+ end
29
+
30
+ config.after(:all) do
31
+ @driver.quit
32
+ end
33
+ end
34
+
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+
3
+
4
+ describe "Flow" do
5
+ it "should be described" do
6
+ @driver.find_elements(:tag_name, '*')
7
+ end
8
+ end
metadata ADDED
@@ -0,0 +1,103 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: appium-rspec-bootstrap
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Alex Mishyn
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-09-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: thor
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Appium + rspec bootstrap
56
+ email:
57
+ - mishyn@gmail.com
58
+ executables:
59
+ - appium-rspec-bootstrap
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - .gitignore
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - appium-rspec-bootstrap.gemspec
69
+ - bin/appium-rspec-bootstrap
70
+ - lib/appium/rspec/bootstrap.rb
71
+ - lib/appium/rspec/bootstrap/version.rb
72
+ - templates/Gemfile
73
+ - templates/Procfile
74
+ - templates/api_server.rb
75
+ - templates/build-app.tt
76
+ - templates/config.ru
77
+ - templates/spec/spec_helper.rb.tt
78
+ - templates/spec/template_spec.rb
79
+ homepage: ''
80
+ licenses:
81
+ - MIT
82
+ metadata: {}
83
+ post_install_message:
84
+ rdoc_options: []
85
+ require_paths:
86
+ - lib
87
+ required_ruby_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - '>='
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ requirements: []
98
+ rubyforge_project:
99
+ rubygems_version: 2.0.3
100
+ signing_key:
101
+ specification_version: 4
102
+ summary: Appium + rspec bootstrap
103
+ test_files: []