cs-webautomator 0.1.8 → 0.1.8.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb5d1994eb574e9e051cb1c47ed7fc5b83455eed
4
- data.tar.gz: 8e1a62151426aeb6c0dadcc01c72fb8e3d4c3dea
3
+ metadata.gz: 44a40cad80f607bc3725dddc78e34da29e844687
4
+ data.tar.gz: 8c3101018a1e17217773e94583033e000dbfaf3d
5
5
  SHA512:
6
- metadata.gz: e637a936c58534a567c3cfd7542e6e0511e2110055b0edadf15357ef5735512b56e0498ab6fdfa4ab85c4a08f86d92374e34a08d6b3bfe8ce8c0bb28697f91a3
7
- data.tar.gz: 93c6770784d91bbd8702c0b54951c1b21a55048e39e4362ada51609bf4c050107b7bcdc54c8369d24902bac9d740dac30ec34a01575d1154db91ce0345d6332c
6
+ metadata.gz: 89a22ad324c0fe4d29f49857cafab19ad5675827372d7a0d04f6acf59b6437e80cc09368195895afd6ec095a246b44224baa4c100789bae2c178b53a5ae40a95
7
+ data.tar.gz: f962332b46d596a556662cb8ac9d34c634dc46105c6d7d2fd4c1fafd21a6417bc1fa6c47354a95e1dbe52a70052e03f92b4ebae63582b5e0c800a53076f3b1d8
data/README.md CHANGED
@@ -1,99 +1,3 @@
1
1
  # CS::WEBAUTOMATOR
2
2
 
3
- A simple gem to generate web automation project with:
4
-
5
- > Cucumber [(link)](https://cucumber.io/)
6
-
7
- > Capybara [(link)](https://github.com/jnicklas/capybara)
8
-
9
- > SitePrism [(link)](https://github.com/natritmeyer/site_prism)
10
-
11
- > Selenium Webdriver [(link)](http://www.seleniumhq.org/)
12
-
13
- The structure is based on three layers: features, steps and pages.
14
-
15
- 1. Features: Contains all the features of the project;
16
- 2. Steps: Contains all the steps implementations;
17
- 3. Pages: Contains all the pages in the website. A page must contain the declaration of all the elements of the page and the declaration of its actions.
18
-
19
- ## Instalation
20
-
21
- Install it as:
22
-
23
- $ gem install cs-webautomator
24
-
25
- ## Usage
26
-
27
- In the terminal, type for help:
28
-
29
- ```
30
- cs-webautomator
31
- cs-webautomator generate
32
- ```
33
-
34
- To see the gem version type:
35
-
36
- ```
37
- cs-webautomator version
38
- ```
39
-
40
- To generate a project type:
41
-
42
- ```
43
- cs-webautomator new ProjectName
44
- ```
45
-
46
- This command will create a folder named ProjectName in the current directory and will create all the needed files. This gem support localizations. To create a localized project, in Portuguese, type:
47
-
48
- ```
49
- cs-webautomator new ProjectName --lang=pt
50
- ```
51
- > The default language is English ('en'). The elements of Gherkin such as Given, When, Then, And, Scenario will be translated to all Gherkin supported languages, but this gem has just a few translation files (see that in folder: `lib/cs/webautomator/locales`).
52
-
53
- > **CS-WEBAUTOMATOR doesn't support your mother language?** No problem. Fork it, create your yml translation file, uses the en.yml file as a template. Translate it and make a pull request. There are only 15 lines to be translated, this will take no time.
54
-
55
- > **Want to know how to name your translation yml file?** See the Gherkin supported languages [here](https://github.com/cucumber/gherkin/blob/master/lib/gherkin/i18n.json) for reference.
56
-
57
- Once the project is created, open its folder (`cd ProjectName`) and run `bundle install`
58
-
59
- There are three generators that are responsible to create the templates for Features, Step definitions and Pages.
60
-
61
- **The generators commands ONLY WORK in the ROOT FOLDER of the project.**
62
-
63
- #### Features
64
-
65
- ```
66
- cs-webautomator generate feature FeatureName
67
- ```
68
- The feature generator will create a feature and its files. So this command will create the FeatureName.feature file inside the folder `features/specifications`, the file FeatureName_steps.rb inside the folder `features/step_definitions`, the files FeatureName_page.rb inside the folder `features/pages`.
69
-
70
- #### Steps
71
-
72
- ```
73
- cs-webautomator generate step StepName
74
- ```
75
- The step generator will create a step file named StepName_steps.rb in the folder `features/step_definitions`
76
-
77
-
78
- #### Pages
79
-
80
- ```
81
- cs-webautomator generate page PageName
82
- ```
83
-
84
- The screen generator will create both Platform dependent screens in the folder `features/pages`
85
-
86
- ## TODO
87
-
88
- 1. Run tests in Remote Server
89
- 2. Run tests in Internet Explorer
90
- 3. Create base methods (click, set, etc) to use with elements
91
-
92
-
93
- ## Contributing
94
-
95
- 1. Fork it ( https://github.com/samycici/cs-webautomator/fork )
96
- 2. Create your feature branch (`git checkout -b my-new-feature`)
97
- 3. Commit your changes (`git commit -am 'Add some feature'`)
98
- 4. Push to the branch (`git push origin my-new-feature`)
99
- 5. Create a new Pull Request
3
+ Moved to [Magneton](https://github.com/concretesolutions/magneton).
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.version = CS::WEBAUTOMATOR::VERSION
9
9
  spec.authors = ['Samanta Cicilia']
10
10
  spec.email = ['samycici@gmail.com']
11
- spec.summary = 'Generates an Web Test Automation project with Cucumber, SitePrism, Capybara and Selenium.'
11
+ spec.summary = 'Formerly known as magneton.'
12
12
  spec.description = %q{A simple gem to generate all files needed in a project that will support Cucumber, SitePrism, Capybara and Selenium.}
13
13
  spec.homepage = 'https://github.com/samycici/cs-webautomator'
14
14
  spec.license = 'MIT'
@@ -23,4 +23,9 @@ Gem::Specification.new do |spec|
23
23
  spec.add_runtime_dependency 'thor', '>= 0.19.1'
24
24
  spec.add_runtime_dependency 'i18n', '>= 0.6.11'
25
25
  spec.add_runtime_dependency 'gherkin', '2.12.2'
26
+ spec.post_install_message = <<-MESSAGE
27
+ ! The cs-webautomator gem has been deprecated and has been replaced by magneton.
28
+ ! See: https://rubygems.org/gems/magneton
29
+ ! And: https://github.com/concretesolutions/magneton
30
+ MESSAGE
26
31
  end
@@ -1,5 +1,5 @@
1
1
  module CS
2
2
  module WEBAUTOMATOR
3
- VERSION = '0.1.8'
3
+ VERSION = '0.1.8.1'
4
4
  end
5
5
  end
@@ -1,3 +1,4 @@
1
1
  reports/*
2
2
  .DS_Store
3
3
  screenshots/
4
+ features_report.html
@@ -0,0 +1,19 @@
1
+ # encoding: utf-8
2
+ # !/usr/bin/env ruby
3
+ require 'fileutils'
4
+ class Helper
5
+ def mouse_over(element_selector)
6
+ element = Capybara.page.driver.browser.find_element(:css, element_selector)
7
+ Capybara.page.driver.browser.mouse.move_to element
8
+ end
9
+
10
+ def take_screenshot(name_file, folder='screenshots/test_screens')
11
+ file = "#{folder}/#{name_file}.png"
12
+ FileUtils.mkdir_p(folder) unless File.exists?(folder)
13
+ if BROWSER.eql?('poltergeist')
14
+ Capybara.page.save_screenshot(file)
15
+ else
16
+ Capybara.page.driver.browser.save_screenshot(file)
17
+ end
18
+ end
19
+ end
@@ -1,3 +1,5 @@
1
+ require_relative 'helper.rb'
2
+
1
3
  Before do |feature|
2
4
  ## variable which loads the data file according to the environment
3
5
  CONFIG = YAML.load_file(File.dirname(__FILE__) + "/config/#{ENVIRONMENT_TYPE}.yaml")
@@ -8,24 +10,18 @@ Before do |feature|
8
10
  end
9
11
 
10
12
  ## set default max wait and maximize browser
11
- Capybara.default_max_wait_time = 20
12
- Capybara.current_session.driver.browser.manage.window.maximize
13
+ Capybara.default_max_wait_time = 60
14
+ unless BROWSER.eql?('poltergeist')
15
+ Capybara.current_session.driver.browser.manage.window.maximize
16
+ end
13
17
  end
14
18
 
15
19
  After do |scenario|
16
-
20
+ @helper = Helper.new
17
21
  ## take screenshot if scenario fail
18
22
  if scenario.failed?
19
- folder = 'screenshots'
20
- file = "#{folder}/#{scenario.name}.png"
21
- Dir.mkdir(folder) unless File.exist?(folder)
22
- if BROWSER.eql?('poltergeist')
23
- Capybara.page.save_screenshot(file)
24
- else
25
- Capybara.page.driver.browser.save_screenshot(file)
26
- end
23
+ @helper.take_screenshot(scenario.name, 'screenshots/test_failed')
27
24
  end
28
-
29
25
  ## if the browser is different from poltergeist, kills instance
30
26
  unless BROWSER.eql?('poltergeist')
31
27
  Capybara.current_session.driver.quit
@@ -1,6 +1,6 @@
1
1
  class <%= config[:name] %>Page < SitePrism::Page
2
2
 
3
3
  # <%= I18n.translate 'comments.elements' %>
4
- # element :button, pending 'Insert button identificator'
4
+ # element :button, pending 'Insert button identificator'
5
5
 
6
6
  end
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cs-webautomator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samanta Cicilia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-27 00:00:00.000000000 Z
11
+ date: 2016-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -110,16 +110,22 @@ files:
110
110
  - lib/skeleton/features/support/config/dev.yaml
111
111
  - lib/skeleton/features/support/config/hmg.yaml
112
112
  - lib/skeleton/features/support/env.rb
113
+ - lib/skeleton/features/support/helper.rb
113
114
  - lib/skeleton/features/support/hooks.rb
114
115
  - lib/skeleton/features/support/matchers/custom.rb
115
116
  - lib/templates/feature.tt
116
117
  - lib/templates/page.tt
117
118
  - lib/templates/steps.tt
119
+ - readme_img/step_1.png
120
+ - readme_img/step_2.png
118
121
  homepage: https://github.com/samycici/cs-webautomator
119
122
  licenses:
120
123
  - MIT
121
124
  metadata: {}
122
- post_install_message:
125
+ post_install_message: |2
126
+ ! The cs-webautomator gem has been deprecated and has been replaced by magneton.
127
+ ! See: https://rubygems.org/gems/magneton
128
+ ! And: https://github.com/concretesolutions/magneton
123
129
  rdoc_options: []
124
130
  require_paths:
125
131
  - lib
@@ -138,6 +144,5 @@ rubyforge_project:
138
144
  rubygems_version: 2.5.1
139
145
  signing_key:
140
146
  specification_version: 4
141
- summary: Generates an Web Test Automation project with Cucumber, SitePrism, Capybara
142
- and Selenium.
147
+ summary: Formerly known as magneton.
143
148
  test_files: []