brew update
brew upgrade elixir
elixir --version
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
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
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
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
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
Then /^I see lessons with albanian subtitle$/ do | |
HOST = 'www.googleapis.com' | |
PATH = '/youtube/v3/captions' | |
PART = 'snippet' | |
on(YoutubePage).first_lesson_in_grid_element.when_visible(@app['PAGE_TIMEOUT']).click | |
youtube_video_id = @browser.element(:tag_name, 'iframe').attribute_value('data-video-id') | |
youtube_client = HTTPClient.new | |
response = JSON.parse youtube_client.get("https://#{HOST}#{PATH}?key=#{@app['GOOGLE_API_KEY']}&part=#{PART}&videoId=#{youtube_video_id}").body | |
pass = false | |
response['items'].each {|item| |
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
<html> | |
<h1>Test!</h1> | |
<script> | |
window.opener.location.replace("http://www.tentamen.hr"); | |
</script> | |
</html> |