Ifd_Automation 2.0 → 2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07035f6dc992f2ed0a6d8a62dbddb59e0238235a
4
- data.tar.gz: 680ee673fcb2f33552acec0e63b545b542a75b19
3
+ metadata.gz: e31cda61049474aae17335b38916cbc5f245e941
4
+ data.tar.gz: 062b063ecf48210aacfedb623a796ec0a9ec2572
5
5
  SHA512:
6
- metadata.gz: 91ac9d93f1060929b25b249e5b08da59b914b344f6b0aa3776e55661a6f4d03dea1fbe0e7fbe6b49d4914455a358ca58eac3aeaa9ebd9aa79944a225a0a26a19
7
- data.tar.gz: e2871d1d54f1888b16ac6e61b9ead46b98bc468c5b058de037e2bd3e252845f535cbef8b4afde369e93fa039ef16fd7add82a50b0148ae230e6509ee3b511ae6
6
+ metadata.gz: bffd7ba7490cf5f08d880a4342dfd3280ca8c4ac30c9040df897ccab78053ca03e01c6367dde3ff9c01530dc81b0aa6fc8e9012ad31e1d939008e5b2a37b12d7
7
+ data.tar.gz: 89a33ad94fdbd67dc870f9df3602cd9ce397804c8a26f2bef425d2f665bb9d7c63b1229e9e7e6231d170fb113cae3b73f0bc8b770b7b1a26e1edbb4252963587
@@ -1,3 +1,3 @@
1
1
  module IfdAutomation
2
- VERSION = "2.0"
2
+ VERSION = "2.1"
3
3
  end
@@ -1,4 +1,4 @@
1
1
  testpage: https://mymupgrade.infodation.com/?lang=en
2
2
  host: 10.5.1.239
3
3
  db_username: root
4
- db_password:
4
+ db_password: root@123
@@ -0,0 +1,5 @@
1
+ Feature: Example feature for GUI testing
2
+
3
+ Scenario: testing case for web interaction
4
+ Given I login to the page "params='testpage'" with username "anhpq.info@gmail.com" and password "a123"
5
+ * I check property "login.label_message_error" with "text" has value "Account does not exist"
@@ -1,5 +1,10 @@
1
- Given "I have $n cucumbers in my belly" do |url|
1
+ Given "I login to the page {string} with username {string} and password {string}" do |string, string2, string3|
2
2
  steps %Q{
3
- I am on the #{url} page
4
- }
3
+ Given I am on the "#{string}" page
4
+ When I click on "header.button_cookie"
5
+ * I click on "header.button_login"
6
+ * I set text on "login.textbox_username" with "#{string2}"
7
+ * I set text on "login.textbox_password" with "#{string3}"
8
+ * I click on "login.button_login"
9
+ }
5
10
  end
@@ -1,2 +1,6 @@
1
- button: {xpath_selector: './/*[@id="search-form-property"]/div[3]/div[2]/div/button'}
2
- test: {ph_xpath_selector: './/*[@id="search-form-property"]/div[3]/div[2]/div/div/ul/li[.="<ph_value>"]'}
1
+ header.button_login: {xpath_selector: '//*[@class="btn ifd-btn-black"]'}
2
+ header.button_cookie: {xpath_selector: '//*[@id="btn-give-cookie-consent"]'}
3
+ login.textbox_username: {xpath_selector: './/*[@class="input-group"]/input[@id="login_user"]'}
4
+ login.textbox_password: {xpath_selector: '//*[@id="login_pass"]'}
5
+ login.label_message_error: {xpath_selector: '//*[@class="ifd-message-error"]'}
6
+ login.button_login: {xpath_selector: '//*[@id="wp-submit"]'}
@@ -3,7 +3,6 @@ $current_dir = File.expand_path(File.dirname(__FILE__))
3
3
  $base_dir = File.expand_path(File.dirname(__FILE__) + '/../..')
4
4
  $test_data_dir = $base_dir + '/features/TestData/'
5
5
  $screenshot = $base_dir + '/features/Screenshot/'
6
- PROJECT_CONFIG = YAML.load_file("#{$current_dir}/project_config.yml")
7
6
  $PARAMS = YAML.load_file("#{$test_data_dir}/globalData.yml")
8
7
  $OBJECT = YAML.load_file("#{$base_dir}/features/step_definitions/repositories/project_object.yml")
9
8
  STDOUT.sync = true
@@ -15,18 +14,14 @@ require 'yaml'
15
14
  require 'selenium-webdriver'
16
15
  require 'Ifd_Automation'
17
16
 
18
- $_CFWEB['Default Browser'] = PROJECT_CONFIG['default_browser'].downcase
19
- $_CFWEB['Wait Time'] = PROJECT_CONFIG['wait_time']
20
- $_CFWEB['Page Address'] = PROJECT_CONFIG['test_page_address']
21
- SELENIUM_SERVER = PROJECT_CONFIG['selenium_grid']
22
-
23
- $_CFWEB['Print Log'] = true
24
- $_CFWEB['Maximize Browser'] = true
25
-
26
- $SEND_EMAIL_USERNAME = PROJECT_CONFIG['send_email_username']
27
- $SEND_EMAIL_PASSWORD = PROJECT_CONFIG['send_email_password']
28
- $RECEIVE_EMAIL_USERNAME = PROJECT_CONFIG['receive_email_username']
29
- $RECEIVE_EMAIL_PASSWORD = PROJECT_CONFIG['receive_email_password']
17
+ $_CFWEB['Default Browser'] = ENV["browser"].downcase
18
+ $_CFWEB['Wait Time'] = ENV["wait_time"] || 30
19
+ $_CFWEB['Print Log'] = ENV["print_log"]
20
+ $_CFWEB['Maximize Browser'] = ENV["maximize_browser"] || true
21
+ $SEND_EMAIL_USERNAME = ENV["send_email_username"]
22
+ $SEND_EMAIL_PASSWORD = ENV["send_email_password"]
23
+ $RECEIVE_EMAIL_USERNAME = ENV["receive_email_username"]
24
+ $RECEIVE_EMAIL_PASSWORD = ENV["receive_email_password"]
30
25
 
31
26
  Mail.defaults do
32
27
  delivery_method :smtp, {
@@ -47,7 +42,7 @@ Mail.defaults do
47
42
  }
48
43
  end
49
44
  Capybara.configure do |config|
50
- config.app_host = $_CFWEB['Page Address']
45
+ # config.app_host = $_CFWEB['Page Address']
51
46
  config.default_max_wait_time = $_CFWEB['Wait Time']
52
47
  # config.run_server = false
53
48
  config.default_driver = :selenium
@@ -60,18 +55,24 @@ def register_selenium_remote_driver(browser)
60
55
  case browser
61
56
  when "firefox"
62
57
  caps = Selenium::WebDriver::Remote::Capabilities.firefox
58
+ caps['recordVideo'] = ENV["recordVideo"]
59
+ caps['name'] = ENV["name"]
60
+ caps['build'] = ENV["build"]
63
61
  Capybara.register_driver :selenium do |app|
64
62
  Capybara::Selenium::Driver.new(app,
65
63
  browser: :remote,
66
- url: "http://#{SELENIUM_SERVER}:4444/wd/hub",
64
+ url: "http://#{ENV["SELENIUM_SERVER"]}:4444/wd/hub",
67
65
  desired_capabilities: caps)
68
66
  end
69
67
  when "chrome"
70
68
  caps = Selenium::WebDriver::Remote::Capabilities.chrome
69
+ caps['recordVideo'] = ENV["recordVideo"]
70
+ caps['name'] = ENV["name"]
71
+ caps['build'] = ENV["build"]
71
72
  Capybara.register_driver :selenium do |app|
72
73
  Capybara::Selenium::Driver.new(app,
73
74
  browser: :remote,
74
- url: "http://#{SELENIUM_SERVER}:4444/wd/hub",
75
+ url: "http://#{ENV["SELENIUM_SERVER"]}:4444/wd/hub",
75
76
  desired_capabilities: caps)
76
77
  end
77
78
  end
@@ -105,3 +106,16 @@ case ENV["SELENIUM"]
105
106
  else
106
107
  register_selenium_local_driver($_CFWEB['Default Browser'])
107
108
  end
109
+ # Available execution environment variables
110
+ # - ENV["SELENIUM"] = remote
111
+ # - ENV["browser"] = "chrome"/"firefox"
112
+ # - ENV["wait_time"] = 30
113
+ # - ENV["print_log"] = true/false
114
+ # - ENV["maximize_browser"] = true/false
115
+ # - ENV["send_email_username"]
116
+ # - ENV["send_email_password"]
117
+ # - ENV["receive_email_username"]
118
+ # - ENV["receive_email_password"]
119
+ # - ENV["recordVideo"]
120
+ # - ENV["name"]
121
+ # - ENV["build"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Ifd_Automation
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.0'
4
+ version: '2.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anh Pham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-26 00:00:00.000000000 Z
11
+ date: 2017-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -180,14 +180,14 @@ files:
180
180
  - lib/helper/mail_helpers.rb
181
181
  - lib/helper/web_steps_helpers.rb
182
182
  - project/Gemfile
183
+ - project/features/Screenshot/failed_377.png
183
184
  - project/features/Screenshot/failed_sample.png
184
185
  - project/features/TestData/globalData.yml
185
- - project/features/TestSuite/test.feature
186
+ - project/features/TestSuite/WebGUI.feature
186
187
  - project/features/step_definitions/lib_steps/test.rb
187
188
  - project/features/step_definitions/repositories/project_object.yml
188
189
  - project/features/support/env.rb
189
190
  - project/features/support/hooks.rb
190
- - project/features/support/project_config.yml
191
191
  homepage: http://rubygems.org/gems/ifd_automation
192
192
  licenses:
193
193
  - MIT
@@ -1 +0,0 @@
1
- Feature: Test
@@ -1,8 +0,0 @@
1
- default_browser: firefox
2
- wait_time: 30
3
- test_page_address: http://google.com
4
- selenium_grid: 10.5.1.215
5
- send_email_username:
6
- send_email_password:
7
- receive_email_username:
8
- receive_email_password: