-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gijs Paulides
committed
May 29, 2017
1 parent
ad73a94
commit be54825
Showing
28 changed files
with
171 additions
and
152 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
@multifind | ||
Feature: testing multifind | ||
|
||
Scenario: Searching for multiple elements with 1 results | ||
Given the user navigates to URL "http://training-page.testautomation.info/" | ||
Then the user expects a result in a multi_find lookup | ||
Then the user expects an error in a multi_find lookup | ||
Then the user expects no error in a multi_find lookup | ||
Then the user expects 2 results in a multi_find_all lookup | ||
Then the user expects 1 results in a multi_find_all lookup | ||
Then the user expects 4 existing results in a multi_find_all lookup | ||
Then the user expects an error in a multi_find_all lookup | ||
Then the user expects no error in a multi_find_all lookup | ||
Then the user expects an error in a multi_find_all lookup matching all elements | ||
@multifind | ||
Feature: testing multifind | ||
|
||
Scenario: Searching for multiple elements with 1 results | ||
Given the user navigates to URL "http://training-page.testautomation.info/" | ||
Then the user expects a result in a multi_find lookup | ||
Then the user expects an error in a multi_find lookup | ||
Then the user expects no error in a multi_find lookup | ||
Then the user expects 2 results in a multi_find_all lookup | ||
Then the user expects 1 results in a multi_find_all lookup | ||
Then the user expects 4 existing results in a multi_find_all lookup | ||
Then the user expects an error in a multi_find_all lookup | ||
Then the user expects no error in a multi_find_all lookup | ||
Then the user expects an error in a multi_find_all lookup matching all elements | ||
Then the user expects no error in a multi_find_all lookup matching all elements |
Empty file.
Empty file.
270 changes: 135 additions & 135 deletions
270
features/step_definitions/multifind_steps.rb
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,136 +1,136 @@ | ||
Given(/^the user expects a result in a multi_find lookup$/) do | ||
elm = browser.multi_find( | ||
:selectors => [ | ||
{:input => {:type => 'texta'}}, | ||
{:like => [:a, :id, 'link-sc']} | ||
] | ||
) | ||
unless elm.text == 'blog' | ||
error "Expected element with text `blog`, but received `#{elm.text}`" | ||
end | ||
end | ||
|
||
Given(/^the user expects an error in a multi_find lookup$/) do | ||
err = '' | ||
begin | ||
elm = browser.multi_find( | ||
:selectors => [ | ||
{:input => {:type => 'texta'}}, | ||
{:like => [:a, :id, 'link-sca']} | ||
] | ||
) | ||
err = "Expected an error looking for elements with no results." | ||
rescue RuntimeError => e | ||
puts "Caught expected error: #{e.message}" | ||
end | ||
error err unless err.empty? | ||
end | ||
|
||
Given(/^the user expects no error in a multi_find lookup$/) do | ||
elm = browser.multi_find( | ||
:selectors => [ | ||
{:input => {:type => 'texta'}}, | ||
{:like => [:a, :id, 'link-sca']} | ||
], | ||
:throw => false | ||
) | ||
unless elm.nil? | ||
error "Expected the result to be nil." | ||
end | ||
end | ||
|
||
Given(/^the user expects 2 results in a multi_find_all lookup$/) do | ||
elm = browser.multi_find_all( | ||
:selectors => [ | ||
{:input => {:type => 'text'}}, | ||
{:like => [:a, :id, 'link-sc']} | ||
] | ||
) | ||
unless elm.length == 2 | ||
error "Expected 2 elements, but received `#{elm.length}`" | ||
end | ||
end | ||
|
||
Given(/^the user expects 1 results in a multi_find_all lookup$/) do | ||
elm = browser.multi_find_all( | ||
:selectors => [ | ||
{:input => {:type => 'texta'}}, | ||
{:like => [:a, :id, 'link-sc']} | ||
] | ||
) | ||
unless elm[0].text == 'blog' | ||
error "Expected element with text `blog`, but received `#{elm.text}`" | ||
end | ||
end | ||
|
||
Given(/^the user expects 4 existing results in a multi_find_all lookup$$/) do | ||
elm = browser.multi_find_all( | ||
:selectors => [ | ||
{:input => {:type => 'text'}, :filter_by => :exists?}, | ||
{:like => [:a, :id, 'link-sc']} | ||
] | ||
) | ||
unless elm.length == 4 | ||
error "Expected 4 elements, but received `#{elm.length}`" | ||
end | ||
end | ||
|
||
Given(/^the user expects an error in a multi_find_all lookup$/) do | ||
err = '' | ||
begin | ||
elm = browser.multi_find_all( | ||
:selectors => [ | ||
{:input => {:type => 'texta'}}, | ||
{:like => [:a, :id, 'link-sca']} | ||
] | ||
) | ||
err = "Expected an error looking for elements with no results." | ||
rescue RuntimeError => e | ||
puts "Caught expected error: #{e.message}" | ||
end | ||
error err unless err.empty? | ||
end | ||
|
||
Given(/^the user expects no error in a multi_find_all lookup$/) do | ||
elm = browser.multi_find_all( | ||
:selectors => [ | ||
{:input => {:type => 'texta'}}, | ||
{:like => [:a, :id, 'link-sca']} | ||
], | ||
:throw => false | ||
) | ||
unless elm.length == 0 | ||
error "Expected to receive 0 results." | ||
end | ||
end | ||
|
||
Given(/^the user expects an error in a multi_find_all lookup matching all elements$/) do | ||
err = '' | ||
begin | ||
elm = browser.multi_find_all( | ||
:selectors => [ | ||
{:input => {:type => 'texta'}}, | ||
{:like => [:a, :id, 'link-sc']} | ||
], | ||
:mode => :match_all | ||
) | ||
err = "Expected an error matching all elements with results." | ||
rescue RuntimeError => e | ||
puts "Caught expected error: #{e.message}" | ||
end | ||
error err unless err.empty? | ||
end | ||
Given(/^the user expects no error in a multi_find_all lookup matching all elements$/) do | ||
|
||
elm = browser.multi_find_all( | ||
:selectors => [ | ||
{:input => {:type => 'texta'}}, | ||
{:like => [:a, :id, 'link-sc']} | ||
], | ||
:mode => :match_all, | ||
:throw => false | ||
) | ||
unless elm.length == 0 | ||
error "Expected to receive 0 results." | ||
end | ||
Given(/^the user expects a result in a multi_find lookup$/) do | ||
elm = browser.multi_find( | ||
:selectors => [ | ||
{:input => {:type => 'texta'}}, | ||
{:like => [:a, :id, 'link-sc']} | ||
] | ||
) | ||
unless elm.text == 'blog' | ||
error "Expected element with text `blog`, but received `#{elm.text}`" | ||
end | ||
end | ||
|
||
Given(/^the user expects an error in a multi_find lookup$/) do | ||
err = '' | ||
begin | ||
elm = browser.multi_find( | ||
:selectors => [ | ||
{:input => {:type => 'texta'}}, | ||
{:like => [:a, :id, 'link-sca']} | ||
] | ||
) | ||
err = "Expected an error looking for elements with no results." | ||
rescue RuntimeError => e | ||
puts "Caught expected error: #{e.message}" | ||
end | ||
error err unless err.empty? | ||
end | ||
|
||
Given(/^the user expects no error in a multi_find lookup$/) do | ||
elm = browser.multi_find( | ||
:selectors => [ | ||
{:input => {:type => 'texta'}}, | ||
{:like => [:a, :id, 'link-sca']} | ||
], | ||
:throw => false | ||
) | ||
unless elm.nil? | ||
error "Expected the result to be nil." | ||
end | ||
end | ||
|
||
Given(/^the user expects 2 results in a multi_find_all lookup$/) do | ||
elm = browser.multi_find_all( | ||
:selectors => [ | ||
{:input => {:type => 'text'}}, | ||
{:like => [:a, :id, 'link-sc']} | ||
] | ||
) | ||
unless elm.length == 2 | ||
error "Expected 2 elements, but received `#{elm.length}`" | ||
end | ||
end | ||
|
||
Given(/^the user expects 1 results in a multi_find_all lookup$/) do | ||
elm = browser.multi_find_all( | ||
:selectors => [ | ||
{:input => {:type => 'texta'}}, | ||
{:like => [:a, :id, 'link-sc']} | ||
] | ||
) | ||
unless elm[0].text == 'blog' | ||
error "Expected element with text `blog`, but received `#{elm.text}`" | ||
end | ||
end | ||
|
||
Given(/^the user expects 4 existing results in a multi_find_all lookup$$/) do | ||
elm = browser.multi_find_all( | ||
:selectors => [ | ||
{:input => {:type => 'text'}, :filter_by => :exists?}, | ||
{:like => [:a, :id, 'link-sc']} | ||
] | ||
) | ||
unless elm.length == 4 | ||
error "Expected 4 elements, but received `#{elm.length}`" | ||
end | ||
end | ||
|
||
Given(/^the user expects an error in a multi_find_all lookup$/) do | ||
err = '' | ||
begin | ||
elm = browser.multi_find_all( | ||
:selectors => [ | ||
{:input => {:type => 'texta'}}, | ||
{:like => [:a, :id, 'link-sca']} | ||
] | ||
) | ||
err = "Expected an error looking for elements with no results." | ||
rescue RuntimeError => e | ||
puts "Caught expected error: #{e.message}" | ||
end | ||
error err unless err.empty? | ||
end | ||
|
||
Given(/^the user expects no error in a multi_find_all lookup$/) do | ||
elm = browser.multi_find_all( | ||
:selectors => [ | ||
{:input => {:type => 'texta'}}, | ||
{:like => [:a, :id, 'link-sca']} | ||
], | ||
:throw => false | ||
) | ||
unless elm.length == 0 | ||
error "Expected to receive 0 results." | ||
end | ||
end | ||
|
||
Given(/^the user expects an error in a multi_find_all lookup matching all elements$/) do | ||
err = '' | ||
begin | ||
elm = browser.multi_find_all( | ||
:selectors => [ | ||
{:input => {:type => 'texta'}}, | ||
{:like => [:a, :id, 'link-sc']} | ||
], | ||
:mode => :match_all | ||
) | ||
err = "Expected an error matching all elements with results." | ||
rescue RuntimeError => e | ||
puts "Caught expected error: #{e.message}" | ||
end | ||
error err unless err.empty? | ||
end | ||
Given(/^the user expects no error in a multi_find_all lookup matching all elements$/) do | ||
|
||
elm = browser.multi_find_all( | ||
:selectors => [ | ||
{:input => {:type => 'texta'}}, | ||
{:like => [:a, :id, 'link-sc']} | ||
], | ||
:mode => :match_all, | ||
:throw => false | ||
) | ||
unless elm.length == 0 | ||
error "Expected to receive 0 results." | ||
end | ||
end |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"browser":{"name":"firefox","version":"53.0.2","platform":"windows_nt"}} | ||
{"browser":{"name":"firefox","version":"53.0.3","platform":"linux"}} |
Empty file.