bdd-helper 0.0.2 → 1.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,9 @@
1
+ class GlobalContext
2
+
3
+ # Resets global variables for each scenario in an execution
4
+ def initialize
5
+ $page_title = nil
6
+ $current_url = nil
7
+ $window_size =nil
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ class BrowserUtilMethods
2
+
3
+ def scroll_to(element)
4
+ script = <<-JS
5
+ arguments[0].scrollIntoView(true);
6
+ JS
7
+ page.execute_script(script, element.native)
8
+ end
9
+
10
+ rescue StandardError => e
11
+ puts e
12
+ end
@@ -0,0 +1,178 @@
1
+ begin
2
+ When(/^scroll (\d+) px (down) the page$/) do |pixel, arg|
3
+ "
4
+ This scrolls down the page by the given amount of pixel.
5
+ "
6
+ # E.g : And scroll 500 px down the page
7
+ page.execute_script("window.scrollBy(0,#{pixel})")
8
+ end
9
+
10
+ When(/^scroll (\d+) px (up) the page$/) do |pixel, arg|
11
+ "
12
+ This scrolls up the page by the given amount of pixel.
13
+ "
14
+ # E.g : And scroll 500 px up the page
15
+ page.execute_script("window.scrollBy(0,#{-pixel})")
16
+ end
17
+
18
+ When(/^scroll (bottom) of the page$/) do |arg|
19
+ "
20
+ This scrolls the page to the bottom
21
+ "
22
+ # E.g : And scroll bottom of the page
23
+ page.execute_script('window.scrollTo(0, document.body.scrollHeight)')
24
+ end
25
+
26
+ When(/^scroll (top) of the page$/) do |arg|
27
+ "
28
+ This scrolls the page to the top
29
+ "
30
+ # E.g : And scroll top of the page
31
+ page.execute_script('window.scrollTo(document.body.scrollHeight,0)')
32
+ end
33
+
34
+ When(/^focus to element by "([^"]*)" text$/) do |text|
35
+ # E.g : And focus to element by "Agree Button" text
36
+ scroll_to(find(xpath: "//*[contains(text(), '#{text}')]"))
37
+ end
38
+
39
+ When(/^refresh the page$/) do
40
+ "
41
+ This refreshes the current page
42
+ "
43
+ # E.g : And refresh the page
44
+ page.evaluate_script('window.location.reload()')
45
+ end
46
+
47
+ When(/^open a (new window)$/) do |args|
48
+ # E.g : And open a new window
49
+ open_new_window(:window)
50
+ end
51
+
52
+ When(/^open a (new tab)$/) do |args|
53
+ # E.g : And open a new tab
54
+ open_new_window
55
+ end
56
+
57
+ When(/^switch to (last window|last tab)$/) do |arg|
58
+ # E.g : And switch to last window
59
+ # E.g : And switch to last tab
60
+ page.driver.browser.switch_to.window(page.driver.browser.window_handles.last)
61
+ end
62
+
63
+ When(/^switch to (first window|first tab)$/) do |arg|
64
+ # E.g : And switch to first window
65
+ # E.g : And switch to first tab
66
+ page.driver.browser.switch_to.window(page.driver.browser.window_handles.first)
67
+ end
68
+
69
+ When(/^switch to window by "([^"]*)" title$/) do |window_title|
70
+ "
71
+ Window title should be title of the target window
72
+ "
73
+ # E.g : And switch to window by "Welcome" title
74
+ switch_to_window { title == window_title }
75
+ end
76
+
77
+ When(/^resize window to (\d+) width (\d+) height$/) do |width, height|
78
+ "
79
+ This resize to the current window by the given width and height
80
+ "
81
+ # E.g : And resize window to 1280 width 720 height
82
+ page.driver.browser.manage.window.resize_to(width, height)
83
+ end
84
+
85
+ When(/^get window size$/) do
86
+ "
87
+ This gets the current window's size then defines it to the global variable
88
+ "
89
+ # E.g : And get window size
90
+ $window_size = page.driver.browser.manage.window.size
91
+ end
92
+
93
+ When(/^close window$/) do
94
+ "
95
+ This closes the current window
96
+ "
97
+ # E.g : And close window
98
+ page.driver.browser.close
99
+ end
100
+
101
+ When(/^get current url$/) do
102
+ "
103
+ This get full URL of the current page then defines it to the global variable
104
+ "
105
+ # E.g : And get current url
106
+ $current_url = current_url
107
+ end
108
+
109
+ When(/^go back$/) do
110
+ "
111
+ This move back a single entry in the browser's history
112
+ "
113
+ # E.g : And go back
114
+ go_back
115
+ end
116
+
117
+ When(/^go forward$/) do
118
+ "
119
+ This move forward a single entry in the browser's history
120
+ "
121
+ # E.g : And go forward
122
+ go_forward
123
+ end
124
+
125
+ When(/^visit base page$/) do
126
+ "
127
+ Should configure base_url from bdd-helper config
128
+ "
129
+ # E.g : And visit base page
130
+ visit BddHelper.base_url
131
+ end
132
+
133
+ When(/^visit "([^"]*)" url$/) do |url|
134
+ "
135
+ The URL can either be a relative URL or an absolute URL
136
+ "
137
+ # E.g : And visit "http://www.example.com" url
138
+ visit url
139
+ end
140
+
141
+ When(/^visit relative url "([^"]*)"$/) do |url|
142
+ "
143
+ The URL can be a relative URL
144
+ "
145
+ # E.g : And visit relative url '/login'
146
+ visit BddHelper.base_url + url
147
+ end
148
+
149
+ When(/^maximize window$/) do
150
+ "
151
+ This maximizes the current window
152
+ "
153
+ # E.g : And maximize window
154
+ page.driver.browser.manage.window.maximize
155
+ end
156
+
157
+ When(/^accept alert$/) do
158
+ # E.g : And accept alert
159
+ page.driver.browser.switch_to.alert.accept
160
+ end
161
+
162
+ When(/^dismiss alert$/) do
163
+ # E.g : And dismiss alert
164
+ page.driver.browser.switch_to.alert.dismiss
165
+ end
166
+
167
+ When(/^get window title$/) do
168
+ "
169
+ This gets title of the current page then defines it to the global variable
170
+ "
171
+ # E.g : And get window title
172
+ $page_title = title
173
+ end
174
+
175
+ rescue StandardError => e
176
+ puts e
177
+ end
178
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bdd-helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
- - Mehmet Ali Aydin
8
- autorequire:
7
+ - kloia
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-22 00:00:00.000000000 Z
11
+ date: 2022-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -16,120 +16,103 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.11'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 2.11.0
19
+ version: '3.36'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '2.11'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 2.11.0
26
+ version: '3.36'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: cucumber
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - "~>"
38
32
  - !ruby/object:Gem::Version
39
- version: '2.4'
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 2.4.0
33
+ version: '7.1'
43
34
  type: :runtime
44
35
  prerelease: false
45
36
  version_requirements: !ruby/object:Gem::Requirement
46
37
  requirements:
47
38
  - - "~>"
48
39
  - !ruby/object:Gem::Version
49
- version: '2.4'
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 2.4.0
40
+ version: '7.1'
53
41
  - !ruby/object:Gem::Dependency
54
42
  name: rspec
55
43
  requirement: !ruby/object:Gem::Requirement
56
44
  requirements:
57
45
  - - "~>"
58
46
  - !ruby/object:Gem::Version
59
- version: '3.5'
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- version: 3.5.0
47
+ version: '3.10'
63
48
  type: :runtime
64
49
  prerelease: false
65
50
  version_requirements: !ruby/object:Gem::Requirement
66
51
  requirements:
67
52
  - - "~>"
68
53
  - !ruby/object:Gem::Version
69
- version: '3.5'
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- version: 3.5.0
54
+ version: '3.10'
73
55
  - !ruby/object:Gem::Dependency
74
- name: selenium-cucumber
56
+ name: selenium-webdriver
75
57
  requirement: !ruby/object:Gem::Requirement
76
58
  requirements:
77
59
  - - "~>"
78
60
  - !ruby/object:Gem::Version
79
- version: '3.1'
61
+ version: '4.0'
80
62
  - - ">="
81
63
  - !ruby/object:Gem::Version
82
- version: 3.1.5
64
+ version: 4.0.3
83
65
  type: :runtime
84
66
  prerelease: false
85
67
  version_requirements: !ruby/object:Gem::Requirement
86
68
  requirements:
87
69
  - - "~>"
88
70
  - !ruby/object:Gem::Version
89
- version: '3.1'
71
+ version: '4.0'
90
72
  - - ">="
91
73
  - !ruby/object:Gem::Version
92
- version: 3.1.5
74
+ version: 4.0.3
93
75
  - !ruby/object:Gem::Dependency
94
- name: selenium-webdriver
76
+ name: faker
95
77
  requirement: !ruby/object:Gem::Requirement
96
78
  requirements:
97
79
  - - "~>"
98
80
  - !ruby/object:Gem::Version
99
- version: '3.0'
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- version: 3.0.5
81
+ version: '2.19'
103
82
  type: :runtime
104
83
  prerelease: false
105
84
  version_requirements: !ruby/object:Gem::Requirement
106
85
  requirements:
107
86
  - - "~>"
108
87
  - !ruby/object:Gem::Version
109
- version: '3.0'
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- version: 3.0.5
113
- description: Package of helper step defitions for BDD testing with Gherkin and Cucumber
114
- email: maaydin@gmail.com
88
+ version: '2.19'
89
+ description: Package of helper steps for BDD testing with Cucumber
90
+ email: burak@kloia.com
115
91
  executables: []
116
92
  extensions: []
117
93
  extra_rdoc_files: []
118
94
  files:
119
95
  - lib/bdd-helper.rb
120
- - lib/steps/assertion.rb
121
- - lib/steps/browser.rb
122
- - lib/steps/check.rb
123
- - lib/steps/click.rb
96
+ - lib/demo.feature
97
+ - lib/steps/action/check_steps.rb
98
+ - lib/steps/action/choose_steps.rb
99
+ - lib/steps/action/click_steps.rb
100
+ - lib/steps/action/fill_steps.rb
101
+ - lib/steps/action/key_action_steps.rb
102
+ - lib/steps/action/select_steps.rb
103
+ - lib/steps/assertion/assertion_steps.rb
124
104
  - lib/steps/config.rb
125
- - lib/steps/fill.rb
126
- - lib/steps/select.rb
127
- - lib/steps/unclassified.rb
128
- homepage: http://rubygems.org/gems/bdd-helper
105
+ - lib/steps/customized/customized_steps.rb
106
+ - lib/steps/global/global_context.rb
107
+ - lib/steps/util/browser_util_methods.rb
108
+ - lib/steps/util/browser_util_steps.rb
109
+ homepage: https://github.com/kloia/bdd-helper
129
110
  licenses:
130
111
  - MIT
131
- metadata: {}
132
- post_install_message:
112
+ metadata:
113
+ source_code_uri: https://github.com/kloia/bdd-helper
114
+ changelog_uri: https://github.com/kloia/bdd-helper/blob/master/CHANGELOG.md
115
+ post_install_message:
133
116
  rdoc_options: []
134
117
  require_paths:
135
118
  - lib
@@ -137,16 +120,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
137
120
  requirements:
138
121
  - - ">="
139
122
  - !ruby/object:Gem::Version
140
- version: '0'
123
+ version: 2.6.0
141
124
  required_rubygems_version: !ruby/object:Gem::Requirement
142
125
  requirements:
143
126
  - - ">="
144
127
  - !ruby/object:Gem::Version
145
128
  version: '0'
146
129
  requirements: []
147
- rubyforge_project:
148
- rubygems_version: 2.6.11
149
- signing_key:
130
+ rubygems_version: 3.2.22
131
+ signing_key:
150
132
  specification_version: 4
151
- summary: Helper step definitions for Gherkin
133
+ summary: Helper steps for client-based automation testing
152
134
  test_files: []
@@ -1,90 +0,0 @@
1
- @timeout = 20
2
-
3
- Then(/^page (should|should_not) contain "([^"]*)" content$/) do |condition, content|
4
- # E.g. : page should contain "Test" content
5
- # E.g. : page should_not contain "Test" content
6
- # page.should have_content(content, count: count, wait: @timeout)
7
- sleep 1
8
- if condition == 'should'
9
- page.should have_content(content, wait: @timeout)
10
-
11
- elsif condition == 'should_not'
12
- page.should_not have_content(content, wait: @timeout)
13
- end
14
- end
15
-
16
- Then(/^page (should|should_not) contain the following contents:$/) do |condition, table|
17
- sleep 1
18
- values = table.raw
19
- values.each {|raw|
20
- if condition == 'should'
21
- page.should have_content(raw[0], wait: @timeout)
22
- elsif condition == 'should_not'
23
- page.should_not have_content(raw[0], wait: @timeout)
24
- end
25
- }
26
- end
27
-
28
- Then(/^page (should|should_not) contain "([^"]*)" "([^"]*)" web element/) do |condition, web_element_type, web_element|
29
- # E.g. : page should contain "css" "#test .form" web element
30
- sleep 1
31
- if condition == 'should'
32
- page.should have_selector(:"#{web_element_type}", web_element, wait: @timeout)
33
-
34
- elsif condition == 'should_not'
35
- page.should_not have_selector(:"#{web_element_type}", web_element, wait: @timeout)
36
- end
37
- end
38
-
39
- Then(/^page (should|should_not) contain "([^"]*)" button$/) do |condition, button|
40
- # E.g. : page should contain "Save" button
41
- # E.g. : page should_not contain "Save" button
42
- # page.should have_content(content, count: count, wait: @timeout)
43
- sleep 1
44
- if condition == 'should'
45
- page.should have_button(button, wait: @timeout)
46
-
47
- elsif condition == 'should_not'
48
- page.should_not have_button(button, wait: @timeout)
49
- end
50
- end
51
-
52
- Then(/^"([^"]*)" button (should|should_not) be disabled$/) do |button, condition|
53
- sleep 1
54
- if condition == 'should'
55
- find_button button, disabled: true
56
-
57
- elsif condition == 'should_not'
58
- find_button button, disabled: false
59
- end
60
- end
61
-
62
- When(/^"([^"]*)" checkbox should be (checked|unchecked)$/) do |checkbox, condition|
63
- # E.g. : .. "Agree" checkbox should be checked
64
- # checkbox can be label, value or id
65
- if condition == 'checked'
66
- expect(page).to have_field(checkbox, checked: true, visible: true)
67
- elsif condition == 'unchecked'
68
- expect(page).to have_field(checkbox, checked: false, visible: true)
69
- end
70
- end
71
-
72
- When(/^"([^"]*)" radio button should be (selected|unselected)$/) do |radio_button, condition|
73
- # E.g. : .. "Yes" radio button should be selected
74
- # radio_button can be name, id or label
75
- if condition == 'checked'
76
- expect(page).to have_field(radio_button, checked: true, visible: true)
77
- elsif condition == 'unchecked'
78
- expect(page).to have_field(radio_button, checked: false, visible: true)
79
- end
80
- end
81
-
82
- Then(/^validation message should be "([^"]*)" about "([^"]*)" field$/) do |expected_message, element_value|
83
- sleep 1.5
84
- if page.has_css?(element_value)
85
- expected_message.should == page.execute_script("return document.querySelector('#{element_value}').innerHTML.trim();")
86
-
87
- elsif page.has_no_css?(element_value)
88
- expected_message.should == ''
89
- end
90
- end
data/lib/steps/browser.rb DELETED
@@ -1,45 +0,0 @@
1
- And(/^refresh the page$/) do
2
- page.evaluate_script('window.location.reload()')
3
- sleep 1
4
- # location = current_url
5
- # page.driver.browser.navigate.refresh
6
- # sleep 1
7
- # current_url.should == location
8
- end
9
-
10
- When(/^navigate browser to "([^"]*)" url$/) do |url|
11
- visit url
12
- #current_url.should == url
13
- end
14
-
15
- # When(/^navigate browser to "([^"]*)" path$/) do |path|
16
- # visit $URL + path
17
- # current_url.should == $URL + path
18
- # end
19
-
20
- And(/^switch window to (first|last) opened$/) do |condition|
21
- if condition == 'first'
22
- page.driver.browser.switch_to.window(page.driver.browser.window_handles.first)
23
- elsif condition == 'last'
24
- page.driver.browser.switch_to.window(page.driver.browser.window_handles.last)
25
- end
26
- end
27
-
28
- Then(/^user should redirected to "([^"]*)" path$/) do |path|
29
- page.should have_current_path(path, wait: $TIMEOUT)
30
- end
31
-
32
- # Given(/^user on main page$/) do
33
- # current_url.should == @url + '/'
34
- # end
35
-
36
- Then(/^alert message (should|should_not) be "([^"]*)" seçiniz."$/) do |condition, message|
37
- if condition == 'should'
38
- resp = page.driver.browser.switch_to.alert.text
39
- resp.should == message
40
-
41
- elsif condition == 'should_not'
42
- resp = page.driver.browser.switch_to.alert.text
43
- resp.should_not == message
44
- end
45
- end
data/lib/steps/check.rb DELETED
@@ -1,20 +0,0 @@
1
- When(/^(check|uncheck) "([^"]*)" checkbox$/) do |condition, checkbox|
2
- # E.g. : .. check "Agree" checkbox
3
- # checkbox can be name, id or label
4
- if condition == 'check'
5
- check(checkbox)
6
- elsif condition == 'uncheck'
7
- uncheck(checkbox)
8
- end
9
- end
10
-
11
- When(/^choose "([^"]*)" radio button$/) do |radio_button|
12
- # E.g. : .. choose "Yes" radio button
13
- # radio_button can be name, id or label
14
- choose(radio_button)
15
- end
16
-
17
- And(/^check type "([^"]*)" value "([^"]*)" web element$/) do |web_element_type, web_element|
18
- page.should have_selector(:"#{web_element_type}", web_element, wait: @timeout)
19
- find(:"#{web_element_type}", web_element).set(true)
20
- end
data/lib/steps/click.rb DELETED
@@ -1,27 +0,0 @@
1
- When(/^click "([^"]*)" (link|button) by (id|title|text)$/) do |identifier, identifier_type, condition|
2
- # E.g: .. click "Save" button by text
3
- Capybara.ignore_hidden_elements = false
4
- if condition == 'title' || condition == 'text'
5
- page.should have_content(identifier)
6
-
7
- elsif condition == 'id'
8
- page.should have_selector(:id, identifier)
9
- end
10
-
11
- if identifier_type == 'link'
12
- # link can be id, title or text
13
- Capybara.ignore_hidden_elements = false
14
- click_link(identifier)
15
-
16
- elsif identifier_type == 'button'
17
- # button can be id, title, value or text
18
- Capybara.ignore_hidden_elements = false
19
- click_button(identifier)
20
- end
21
- end
22
-
23
- Then(/^click type "([^"]*)" value "([^"]*)" web element$/) do |web_element_type, web_element|
24
- # E.g: .. click type "id" value "save" web element
25
- page.should have_selector(:"#{web_element_type}", web_element)
26
- find(:"#{web_element_type}", web_element).click
27
- end
data/lib/steps/fill.rb DELETED
@@ -1,54 +0,0 @@
1
- And(/^fill "([^"]*)" with "([^"]*)"$/) do |field, value|
2
- # E.g : ..fill "Phone Number" with "5555555555"
3
- # field can be name, id or label
4
- fill_in(field, with: value)
5
- end
6
-
7
- And(/^fill input boxes with these values:$/) do |table|
8
- values = table.raw
9
- values.each {|raw| fill_in(raw[0], with: raw[1])}
10
- end
11
-
12
- Then(/^fill type "([^"]*)" value "([^"]*)" web element with "([^"]*)"$/) do |web_element_type, web_element, value|
13
- # E.g: .. click type "id" value "save" web element
14
- page.should have_selector(:"#{web_element_type}", web_element, wait: @timeout)
15
- find(:"#{web_element_type}", web_element).set(value)
16
- end
17
-
18
- # =scoping=
19
- # within("//li[@id='employee']") do
20
- # fill_in 'Name', :with => 'Jimmy'
21
- # end
22
- # within(:css, "li#employee") do
23
- # fill_in 'Name', :with => 'Jimmy'
24
- # end
25
- # within_fieldset('Employee') do
26
- # fill_in 'Name', :with => 'Jimmy'
27
- # end
28
- # within_table('Employee') do
29
- # fill_in 'Name', :with => 'Jimmy'
30
- # end
31
-
32
- And(/^fill "([^"]*)" with random (email|password|name|gsm)$/) do |field, condition|
33
- def generate_code(number, condition)
34
- if condition == 'email'
35
- charset = Array('A'..'Z') + Array('a'..'z') + Array(0..9)
36
- Array.new(number) {charset.sample}.join + "@gmail.com"
37
-
38
- elsif condition == 'password'
39
- charset = Array('A'..'Z') + Array('a'..'z') + Array(0..9)
40
- Array.new(number) {charset.sample}.join
41
-
42
- elsif condition == 'name'
43
- charset = Array('A'..'Z') + Array('a'..'z')
44
- Array.new(number) {charset.sample}.join
45
-
46
- elsif condition == 'gsm'
47
- charset = Array(0..9)
48
- Array.new(7) {charset.sample}.join
49
- end
50
- end
51
-
52
- var = generate_code(10, condition)
53
- fill_in(field, with: var)
54
- end
data/lib/steps/select.rb DELETED
@@ -1,38 +0,0 @@
1
- And(/^select "([^"]*)" as "([^"]*)" from dropdown$/) do |dropdown, option|
2
- # E.g : select "Country" as "United States" from dropdown
3
- # E.g : select "United States", from: "Country", :match => :first ===>> to select first matched option
4
- # dropdown can be id, name, label text
5
- select(option, from: dropdown) # OR ==>> find('#select_id').select('value')
6
- end
7
-
8
- Then /^"([^"]*)" (should|should_not) be selected for "([^"]*)" dropdown$/ do |selected_option, condition, dropdown|
9
- # E.g : "United States" should be selected for "Country" dropdown
10
- if condition == 'should'
11
- page.should have_select(dropdown, selected: selected_option)
12
-
13
- elsif condition == 'should_not'
14
- page.should_not have_select(dropdown, selected: selected_option)
15
- end
16
- end
17
-
18
- Then /^"([^"]*)" dropdown (should|should_not) contain "([^"]*)" option$/ do |dropdown, condition, option_text|
19
- # E.g : .. "Country" dropdown should contain "United States" option
20
- if condition == 'should'
21
- page.should have_select(dropdown, with_options: [option_text])
22
-
23
- elsif condition == 'should_not'
24
- page.should_not have_select(dropdown, with_options: [option_text])
25
- end
26
- end
27
-
28
- Then /^"([^"]*)" dropdown (should|should_not) contain following options:$/ do |dropdown, condition, table|
29
- values = table.raw
30
- sleep 1
31
- values.each {|raw|
32
- if condition == 'should'
33
- page.should have_select(dropdown, with_options: [raw[0]])
34
-
35
- elsif condition == 'should_not'
36
- page.should_not have_select(dropdown, with_options: [raw[0]])
37
- end}
38
- end
@@ -1,17 +0,0 @@
1
- When(/^hover to "([^"]*)" value "([^"]*)" web element$/) do |web_element_type, web_element|
2
- find(:"#{web_element_type}", web_element).trigger(:mouseover)
3
- end
4
-
5
- When(/^wait "([^"]*)" seconds$/) do |sec_value|
6
- sleep sec_value.to_i
7
- end
8
-
9
- And(/^generate random string and type into "([^"]*)"$/) do |field|
10
- charset = (0...8).map {(65 + rand(26)).chr}.join
11
- fill_in(field, with: charset)
12
- end
13
-
14
- And(/^execute javascript code "([^"]*)"/) do |code|
15
- page.execute_script(code)
16
- sleep 2
17
- end