This file contains hidden or 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
Then /^I left tentamen application$/ do | |
expect(@browser.url).to eq on(AuthenticationPage).page_url_value | |
end |
This file contains hidden or 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
class AuthenticationPage | |
include PageObject | |
page_url 'https://tentamen.eu/session/new' | |
expected_title "Welcome back" | |
text_field(:email, :id => 'user_email') | |
text_field(:password, :id => 'user_password') | |
checkbox(:remember_me, :id => 'user_remember_me') | |
button(:log_in, :value => 'Log in') |
This file contains hidden or 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
def counter_strings length | |
if length.nil? | |
return "" | |
elsif length == 1 | |
return '*' | |
else | |
result = [] | |
position = 2 | |
increment = 2 | |
while position <= length |
This file contains hidden or 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
def send_keys_filtered(text, locator) | |
text.split('').each do |character| | |
if SHIFT_KEYS.has_key? character | |
@driver.action.key_down(:shift).send_keys(SHIFT_KEYS[character]).key_up(:shift).perform | |
else | |
find(locator).send_keys(character) | |
end | |
end | |
end |
This file contains hidden or 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
#rails console --sandbox | |
transition = application.application_state_transitions.last | |
transition.created_at = 7.days.ago | |
transition.save |
This file contains hidden or 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
Given /^I load cookies$/ do | |
@browser.cookies.load('remember_me.cookies') | |
end |
This file contains hidden or 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
Feature: Remember me | |
When I check this option | |
I would like to automatically log in | |
if I have not logged out | |
Background: | |
Given I go to Home page | |
And I am logged out | |
Scenario: Remember me |
This file contains hidden or 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
browser = Watir::Browser.new | |
Before do |scenario| | |
if scenario.name.include? "check for remember me" | |
@browser = Watir::Browser.new | |
else | |
@browser = browser | |
@browser.cookies.clear | |
end | |
end | |
After do |scenario| |