Ifd_Automation 2.8.1 → 2.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/bin/documentation_generator.rb +0 -0
  3. data/bin/generate.rb +0 -0
  4. data/bin/helper.rb +0 -0
  5. data/lib/Ifd_Automation.rb +0 -0
  6. data/lib/Ifd_Automation/all_steps.rb +0 -0
  7. data/lib/Ifd_Automation/require_libs.rb +0 -0
  8. data/lib/Ifd_Automation/version.rb +1 -1
  9. data/lib/helper/assertion_helper.rb +0 -0
  10. data/lib/helper/auto_util.rb +0 -0
  11. data/lib/helper/database_helper.rb +0 -0
  12. data/lib/helper/file_helper.rb +0 -0
  13. data/lib/helper/mail_helper.rb +0 -0
  14. data/lib/helper/rest_helper.rb +0 -0
  15. data/lib/helper/soap_helper.rb +0 -0
  16. data/lib/helper/ssh_helper.rb +1 -1
  17. data/lib/helper/web_steps_helper.rb +43 -16
  18. data/project/Dockerfile +0 -0
  19. data/project/Gemfile +0 -0
  20. data/project/README.md +21 -5
  21. data/project/cucumber.yml +3 -3
  22. data/project/docker-compose.yml +0 -0
  23. data/project/features/Screenshot/sample.jpg +0 -0
  24. data/project/features/TestData/globalData.yml +0 -0
  25. data/project/features/TestSuite/WebGUI.feature +4 -4
  26. data/{lib/Ifd_Automation → project/features/step_definitions/IFD_Libraries}/REST_steps.rb +0 -0
  27. data/{lib/Ifd_Automation → project/features/step_definitions/IFD_Libraries}/SOAP_steps.rb +0 -0
  28. data/{lib/Ifd_Automation → project/features/step_definitions/IFD_Libraries}/database_steps.rb +0 -0
  29. data/{lib/Ifd_Automation → project/features/step_definitions/IFD_Libraries}/dynamic_store_value_steps.rb +0 -0
  30. data/{lib/Ifd_Automation → project/features/step_definitions/IFD_Libraries}/email_steps.rb +0 -0
  31. data/{lib/Ifd_Automation → project/features/step_definitions/IFD_Libraries}/file_steps.rb +0 -0
  32. data/{lib/Ifd_Automation → project/features/step_definitions/IFD_Libraries}/ssh_steps.rb +0 -0
  33. data/project/features/step_definitions/IFD_Libraries/web_steps.rb +98 -0
  34. data/project/features/step_definitions/lib_steps/actionwords.rb +6 -7
  35. data/project/features/step_definitions/lib_steps/steps.rb +3 -4
  36. data/project/features/step_definitions/repositories/project_object.yml +1 -1
  37. data/project/features/support/env.rb +0 -0
  38. data/project/features/support/hooks.rb +0 -0
  39. metadata +9 -9
  40. data/lib/Ifd_Automation/web_steps.rb +0 -84
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dda086dde7d57a9698e02b3a84ada9c438079612102933a90864c07691ed096f
4
- data.tar.gz: efdd82d31ba99c1769528d3043440b7fda4795bdb8daf90cca725765609724da
3
+ metadata.gz: 79bab1248d7f5d0a920e0f5c6dd7140b0435ae944e5a58f0855594a0db554a8f
4
+ data.tar.gz: 05b42b97b11906af46735ff15c1b44e6242aff4770f90794f00251c536216fcb
5
5
  SHA512:
6
- metadata.gz: e67e6fe41ccb92f920ddb09706fae3a4343bb2eb22d7bb67146f165e993b9a74c2d68973971e1abd468669ab55aec8d57edb6f53ee7ba4fd4041ae3e93fbb56e
7
- data.tar.gz: 3aa60889185ce99b26f79b7f756f4060905f2366b6324f326598f5627a425dc65d9e3a90b80e78220d710345f7719cce303135168239de0a020af61037e24872
6
+ metadata.gz: 0506005ae122bb0b7a75c21b7654e410d7bde7af442708b40694c4168043e4da51a9ea299d3605b59e51558603a3cb733a6675f887988185d10d7aef2684bb94
7
+ data.tar.gz: 728d540e016a22977d5b3e9addbec00aba4b2f31dabf22f68199f3b160bd1e11d9d203294d982d67866153a72b3f9cfa5358dd42d7ed4c3756267eb8a594fd0b
File without changes
data/bin/generate.rb CHANGED
File without changes
data/bin/helper.rb CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module IfdAutomation
2
- VERSION = "2.8.1"
2
+ VERSION = "2.8.2"
3
3
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -36,4 +36,4 @@ class IFD_Ssh
36
36
  $context_value = Utils.bind_with_dyn_vars(@output)
37
37
  Utils.set_var(name, '$context_value')
38
38
  end
39
- end
39
+ end
@@ -68,17 +68,15 @@ require 'net/https'
68
68
 
69
69
  def switch_to_window_by_title(window_title)
70
70
  $previous_window = page.driver.browser.window_handle
71
- @window_found = false
71
+ window_found = false
72
72
  page.driver.browser.window_handles.each { |handle|
73
73
  page.driver.browser.switch_to.window handle
74
74
  if page.title == window_title
75
- @window_found = true
75
+ window_found = true
76
76
  break
77
77
  end
78
78
  }
79
- if @window_found == false
80
- raise "Window having title \"#{window_title}\" not found"
81
- end
79
+ raise "Window having title \"#{window_title}\" not found" if not window_found
82
80
  end
83
81
 
84
82
  def scroll_page(to)
@@ -200,7 +198,6 @@ require 'net/https'
200
198
  end
201
199
 
202
200
  def execute_checkproperty(element, property, negate, value, isSpecialChar=false)
203
- validate_option_by(property)
204
201
  Capybara.configure do |config|
205
202
  config.ignore_hidden_elements = false
206
203
  end
@@ -214,13 +211,52 @@ require 'net/https'
214
211
  else
215
212
  # put_log "\n\n\t>>> execute_checkproperty: finish to found element"
216
213
  if foundElement != nil
217
-
218
214
  if property.upcase == 'VALUE'
219
215
  actual_value = foundElement.value()
220
216
 
221
217
  elsif property.upcase == 'TEXT'
222
218
  actual_value = foundElement.text()
223
219
 
220
+ elsif property.upcase == 'SPECIAL CHAR'
221
+ actual_value = foundElement.text()
222
+ isSpecialChar = true
223
+
224
+ elsif property.upcase == 'TAGNAME'
225
+ actual_value = foundElement.tag_name()
226
+
227
+ elsif property.upcase == 'STYLE'
228
+ actual_value = foundElement[:style]
229
+
230
+ elsif property.upcase == 'DISABLED'
231
+ actual_value = foundElement[:disabled]
232
+
233
+ elsif property.upcase == 'WIDTH'
234
+ actual_value = foundElement[:width]
235
+
236
+ elsif property.upcase == 'HEIGHT'
237
+ actual_value = foundElement[:height]
238
+
239
+ elsif property.upcase == 'ID'
240
+ actual_value = foundElement[:id]
241
+
242
+ elsif property.upcase == 'NAME'
243
+ actual_value = foundElement[:name]
244
+
245
+ elsif property.upcase == 'CLASS'
246
+ actual_value = foundElement[:class]
247
+
248
+ elsif property.upcase == 'HREF'
249
+ actual_value = foundElement[:href]
250
+
251
+ elsif property.upcase == 'TITLE'
252
+ actual_value = foundElement[:title]
253
+
254
+ elsif property.upcase == 'TYPE'
255
+ actual_value = foundElement[:type]
256
+
257
+ elsif property.upcase == 'CHECKED'
258
+ actual_value = "true" if foundElement.checked? == true
259
+ actual_value = "false" if foundElement.checked? == false
224
260
  else
225
261
  actual_value = foundElement["#{property}"]
226
262
  end
@@ -251,15 +287,6 @@ require 'net/https'
251
287
  end
252
288
  end
253
289
 
254
- def check_valid_option_by?(option_by)
255
- %w(text value).include? option_by
256
- end
257
-
258
- def validate_option_by(option_by)
259
- raise "Please select valid option, invalid option - #{option_by}" unless check_valid_option_by? option_by
260
- end
261
-
262
-
263
290
  def execute_gettext(element)
264
291
  foundElement = find_object(element)
265
292
  if foundElement != nil
data/project/Dockerfile CHANGED
File without changes
data/project/Gemfile CHANGED
File without changes
data/project/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ###Ifd_Automation gem
2
2
  Ifd_Automation is an open-source tool for automating GUI, RESTful, SOAP, Database and eMail.
3
- Importantly, Ifd_Automation is cross-platform, it allows you to write tests against multiple platforms (Linux, Windows, MacOS) on multiple browsers (chrome, firefox ...) using the same API.
3
+ Importantly, Ifd_Automation is "cross-platform": it allows you to write tests against multiple platforms (Linux, Windows, MacOS) on multiple browsers (chrome, firefox ...) using the same API.
4
4
 
5
5
  ###Getting Started
6
6
  These instructions will get you a copy of the project up and running on your local machine for testing purposes. See deployment for notes on how to install Ifd_Automation gem
@@ -26,10 +26,8 @@ By default, the steps which relate to test data will be read/created from this f
26
26
  - TestSuite folder
27
27
  Place to store user's feature files.
28
28
 
29
- - pre-defined-steps folder
30
- All available steps from framework
31
-
32
29
  - Step_definitions folder
30
+ - IFD_Libraries (contains custom Ifd_Automation steps)
33
31
  - lib_steps
34
32
  - actionword.rb
35
33
  - steps.rb
@@ -39,6 +37,24 @@ All available steps from framework
39
37
  - support
40
38
  - env.rb
41
39
  - hook.rb
42
-
43
40
  ###Usage
44
41
  ####Available steps
42
+ All available steps are located at IFD_Libaries folder, below are instructions show how to use these libraries
43
+
44
+ ----
45
+ #####web steps
46
+ 1. Open browser and navigate to the page test page. The page address can be insert directly into step or using dynamic
47
+ `Given I am on the "page_url" page`
48
+ #####example
49
+ - `Given I am on the "http://google.com" page`
50
+ - `Given I am on the "params='test_page'" page`
51
+
52
+ 2. Wait for number of seconds before doing the next step
53
+ `And I wait for <number> seconds`
54
+ #####example
55
+ `And I wait for 5 seconds`
56
+ 3. Click on an element
57
+ `And I click on "string"`
58
+ #####example
59
+ `And I click on "button_login"`
60
+
data/project/cucumber.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  default: --no-source
2
- remote: SELENIUM=remote
3
- remote_chrome: BROWSER=chrome -p remote
4
- remote_firefox: BROWSER=firefox -p remote
2
+ <% remote = "SELENIUM=remote" %>
3
+ remote_chrome: BROWSER=chrome <%= remote %>
4
+ remote_firefox: BROWSER=firefox <%= remote %>
5
5
  junit_report: -f progress -f junit -o Report
6
6
  html_report: -f progress -f html -o Report
File without changes
File without changes
File without changes
@@ -1,5 +1,5 @@
1
- Feature: Jira ticket name
1
+ Feature: Example feature for GUI testingz
2
+
3
+ Scenario: testing case for web interaction
4
+ Given I am on the "params='login_page'" page
2
5
 
3
- Scenario: login to system with valid account
4
- Given I am on the "https://html5demos.com/drag" page
5
- Given I drag object "test1" to "test2"
@@ -0,0 +1,98 @@
1
+
2
+ # Navigate to a particular page
3
+ Given(/^I am on the "([^"]*)" page$/) do |url|
4
+ url = Utils.check_dynamic_value(url)
5
+ execute_openbrowser(url)
6
+ end
7
+
8
+ # # Wait for the specific time
9
+ When /^I wait for (\d+) seconds$/ do |second|
10
+ sleep(second.to_i)
11
+ end
12
+
13
+ # Finds a button or link by id, text or value and clicks it
14
+ And /^I click on "([^\"]*)"$/ do |object|
15
+ execute_click(object)
16
+ end
17
+
18
+ # double click on web element
19
+ Then /^I double click on element "(.*?)"$/ do |element|
20
+ double_click(element)
21
+ end
22
+
23
+ # Fill in a text box or text area with a value
24
+ And /^I set text on "(.*?)" with "(.*?)"$/ do |object, text|
25
+ text = Utils.check_dynamic_value text
26
+ execute_settext(object, text)
27
+ end
28
+
29
+ # select option
30
+ And /^I select option on "(.*?)" with "(.*?)"$/ do |object, text|
31
+ execute_select(object, text)
32
+ end
33
+
34
+
35
+ # step to maximize browser
36
+ Then(/^I maximize browser window$/) do
37
+ maximize_browser
38
+ end
39
+
40
+ Then /^Capture a screenshot as "(.*)"$/ do |name|
41
+ file_path = $test_data_dir + name.downcase
42
+ page.save_screenshot(file_path)
43
+ end
44
+
45
+ Then(/^I switch to window having title "(.*?)"$/) do |window_title|
46
+ switch_to_window_by_title window_title
47
+ end
48
+
49
+ # steps to scroll web page to top or end
50
+ Then(/^I scroll to (top|end) of page$/) do |to|
51
+ scroll_page(to)
52
+ end
53
+
54
+ # check property for object
55
+ Then /^I check property "(.*?)" with "(.*?)" has( | not)? value "(.*?)"$/ do |object, property, negate, value|
56
+ value = Utils.bind_with_dyn_vars value
57
+ execute_checkproperty(object, property, negate, value)
58
+ end
59
+
60
+ # step to assert javascript pop-up alert text
61
+ Then(/^I should see alert text as "(.*?)"$/) do |actual_value|
62
+ check_alert_text(actual_value)
63
+ end
64
+
65
+ Given /^I move mouse to element "(.*)" and click$/ do |object|
66
+ execute_mousehoverandclick(object)
67
+ end
68
+
69
+ And /^remove attribute "(.*)" on object "(.*)"$/ do |attr, object|
70
+ remove_element_attribute object, attr
71
+ end
72
+
73
+ # set state for check box, combo box
74
+ And /^I set state on "(.*?)" with "(.*?)"$/ do |object, state|
75
+ execute_setstate(object, state)
76
+ end
77
+
78
+ And /I resize window screen to "(.*)","(.*)"/ do |x,y|
79
+ resize_window_screen(x,y)
80
+ end
81
+
82
+ And /I verify object "(.*)" with "(.*)" has value "(.*)"/ do |object,style,expected_value|
83
+ actual_value = get_computed_style(object,style)
84
+ IFD_Assertion.assert_string_equal(expected_value,actual_value)
85
+ end
86
+
87
+ Then /^I should( not)? see page title as (.*)$/ do |present, title|
88
+ check_title(title, present.empty?)
89
+ end
90
+
91
+ And /I move mouse to element "(.*)" and choose item "(.*)" then click/ do |var, element|
92
+ movemouseandclick(var, element)
93
+ end
94
+
95
+ And /I hold element "(.*)" and move from location x "(.*)" to y "(.*)"$/ do |el, x, y|
96
+ drag_drop el, x, y
97
+ end
98
+
@@ -1,10 +1,9 @@
1
1
  module Actionwords
2
2
 
3
- def login_to_system(page_url,user,pass)
4
- step %{I am on the "#{page_url}" page}
5
- step %{I set text on "textbox_username" with "#{user}"}
6
- step %{I set text on "textbox_password" with "#{pass}"}
7
- step %{I click on "login" button}
3
+ def login_to_system
4
+ step %{I am on the "params='login_page'" page}
5
+ step %{I set text on "textbox_username" with "params='login_user'"}
6
+ step %{I set text on "textbox_password" with "params='login_pass'"}
7
+ step %{I click on "aa"}
8
8
  end
9
-
10
- end
9
+ end
@@ -1,7 +1,6 @@
1
1
  require_relative 'actionwords'
2
2
  World(Actionwords)
3
3
 
4
- Given /I log in to page "(.*)" with user "(.*)" and pass "(.*)"/ do |page_url,user,pass|
5
- login_to_system(page_url,user,pass)
6
- end
7
-
4
+ Given /I log in to the system/ do
5
+ login_to_system
6
+ end
@@ -1,2 +1,2 @@
1
1
  textbox_username: {css_selector: '#userField'}
2
- textbox_password: {css_selector: '#passwordField'}
2
+ textbox_password: {css_selector: '#passwordField'}
File without changes
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Ifd_Automation
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anh Pham
@@ -256,17 +256,9 @@ files:
256
256
  - bin/helper.rb
257
257
  - bin/setup
258
258
  - lib/Ifd_Automation.rb
259
- - lib/Ifd_Automation/REST_steps.rb
260
- - lib/Ifd_Automation/SOAP_steps.rb
261
259
  - lib/Ifd_Automation/all_steps.rb
262
- - lib/Ifd_Automation/database_steps.rb
263
- - lib/Ifd_Automation/dynamic_store_value_steps.rb
264
- - lib/Ifd_Automation/email_steps.rb
265
- - lib/Ifd_Automation/file_steps.rb
266
260
  - lib/Ifd_Automation/require_libs.rb
267
- - lib/Ifd_Automation/ssh_steps.rb
268
261
  - lib/Ifd_Automation/version.rb
269
- - lib/Ifd_Automation/web_steps.rb
270
262
  - lib/helper/assertion_helper.rb
271
263
  - lib/helper/auto_util.rb
272
264
  - lib/helper/database_helper.rb
@@ -284,6 +276,14 @@ files:
284
276
  - project/features/Screenshot/sample.jpg
285
277
  - project/features/TestData/globalData.yml
286
278
  - project/features/TestSuite/WebGUI.feature
279
+ - project/features/step_definitions/IFD_Libraries/REST_steps.rb
280
+ - project/features/step_definitions/IFD_Libraries/SOAP_steps.rb
281
+ - project/features/step_definitions/IFD_Libraries/database_steps.rb
282
+ - project/features/step_definitions/IFD_Libraries/dynamic_store_value_steps.rb
283
+ - project/features/step_definitions/IFD_Libraries/email_steps.rb
284
+ - project/features/step_definitions/IFD_Libraries/file_steps.rb
285
+ - project/features/step_definitions/IFD_Libraries/ssh_steps.rb
286
+ - project/features/step_definitions/IFD_Libraries/web_steps.rb
287
287
  - project/features/step_definitions/lib_steps/actionwords.rb
288
288
  - project/features/step_definitions/lib_steps/steps.rb
289
289
  - project/features/step_definitions/repositories/project_object.yml
@@ -1,84 +0,0 @@
1
- Given /I am on the "(.*?)" page/ do |url|
2
- url = Utils.check_dynamic_value(url)
3
- execute_openbrowser(url)
4
- end
5
-
6
- When /I wait for (\d+) seconds/ do |second|
7
- sleep(second.to_i)
8
- end
9
-
10
- And /I click on "(.*?)"/ do |object|
11
- execute_click(object)
12
- end
13
-
14
- Then /I double click on "(.*?)"/ do |element|
15
- double_click(element)
16
- end
17
-
18
- And /I set text on "(.*?)" with "(.*?)"/ do |object, text|
19
- text = Utils.check_dynamic_value text
20
- execute_settext(object, text)
21
- end
22
-
23
- And /I select option on "(.*?)" with "(.*?)"/ do |object, text|
24
- execute_select(object, text)
25
- end
26
-
27
- Then /I maximize browser window/ do
28
- maximize_browser
29
- end
30
-
31
- Then /I capture a screenshot as "(.*)"/ do |name|
32
- file_path = $test_data_dir + name.downcase
33
- page.save_screenshot(file_path)
34
- end
35
-
36
- Then /I switch to window having title "(.*?)"/ do |window_title|
37
- switch_to_window_by_title window_title
38
- end
39
-
40
- Then /I scroll to (top|end) of page/ do |to|
41
- scroll_page(to)
42
- end
43
-
44
- Then /I check property "(.*?)" with "(.*?)" has( | not)? value "(.*?)"/ do |object, property, negate, value|
45
- value = Utils.bind_with_dyn_vars value
46
- execute_checkproperty(object, property, negate, value)
47
- end
48
-
49
- Then /I should see text alert "(.*?)"/ do |actual_value|
50
- check_alert_text(actual_value)
51
- end
52
-
53
- Given /I move mouse to element "(.*)" and click/ do |object|
54
- execute_mousehoverandclick(object)
55
- end
56
-
57
- And /I remove attribute "(.*)" on object "(.*)"/ do |attr, object|
58
- remove_element_attribute object, attr
59
- end
60
-
61
- And /I set state on "(.*?)" with "(.*?)"/ do |object, state|
62
- execute_setstate(object, state)
63
- end
64
-
65
- And /browser window is re-sized to width "(.*)" and height "(.*)"/ do |x,y|
66
- resize_window_screen(x,y)
67
- end
68
-
69
- And /I verify object "(.*)" with "(.*)" has value "(.*)"/ do |object,style,expected_value|
70
- actual_value = get_computed_style(object,style)
71
- IFD_Assertion.assert_string_equal(expected_value,actual_value)
72
- end
73
-
74
- Then /I should( not)? see page title "(.*)"/ do |present, title|
75
- check_title(title, present.empty?)
76
- end
77
-
78
- And /I move mouse to element "(.*)" and choose item "(.*)" then click/ do |var, element|
79
- movemouseandclick(var, element)
80
- end
81
-
82
- And /I hold element "(.*)" and move from location x "(.*)" to y "(.*)"$/ do |el, x, y|
83
- drag_drop el, x, y
84
- end