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
| module OmniAuthMock | |
| def auth_mock | |
| omniauth_hash = { | |
| "provider" => "linkedin", | |
| "uid" => "oOkD8MWCjm", | |
| "info" => { | |
| "name" => "Sean O'Connor", | |
| "email" => "test@mail.com", | |
| "nickname" => "Sean O'Connor", | |
| "first_name" => "Sean", |
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
| # C корректно заполненными полями | |
| ------Фамилия, Имя | |
| # С пустым полем | |
| # С латиницей/арабицей/китайский/тайский... в фамилии | |
| # Со сложной фамилией (Смоктуновский-Верховодец) | |
| # С фамилией содержащей апостроф (O'Connor) | |
| # С фамилией содержащей 2 больших буквы (McDonald) | |
| # С полем, содержашим пробелы Вначале/ В середине / В конце | |
| # С полем, содержащим единственный пробел |
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 DriverJSError < StandardError; end | |
| AfterStep do |scenario, step| | |
| errors = page.driver.browser.manage.logs.get(:browser) | |
| if errors.present? | |
| message = errors.map(&:message).join("\n\n") | |
| raise DriverJSError, message | |
| 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
| # in features/support/env.rb | |
| require 'selenium/webdriver' | |
| # we need a firefox extension to start intercepting javascript errors before the page | |
| # scripts load | |
| Capybara.register_driver :selenium do |app| | |
| profile = Selenium::WebDriver::Firefox::Profile.new | |
| # see https://github.com/mguillem/JSErrorCollector | |
| profile.add_extension File.join(Rails.root, "features/support/extensions/JSErrorCollector.xpi") | |
| Capybara::Selenium::Driver.new app, :profile => profile |
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 am on the Welcome Screen$/ do | |
| element_exists("view") | |
| sleep(STEP_PAUSE) | |
| end | |
| And(/^I should see "([^"]*)" on the screen$/) do |expected_mark| | |
| wait_for(WAIT_TIMEOUT) { view_with_mark_exists( expected_mark ) } | |
| sleep(STEP_PAUSE) | |
| end | |
| Then(/^I enter "([^"]*)" in the "([^"]*)" field$/) do |text_to_type, field_name| | |
| touch("UITextFieldLabel marked:'#{field_name}'") |
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
| (function( $ ) { | |
| $.fn.simulateDragDrop = function(options) { | |
| return this.each(function() { | |
| new $.simulateDragDrop(this, options); | |
| }); | |
| }; | |
| $.simulateDragDrop = function(elem, options) { | |
| this.options = options; | |
| this.simulateEvent(elem, options); | |
| }; |
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
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
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
| sudo port install git-core +bash_completion | |
| if [ -f /opt/local/etc/bash_completion ]; then | |
| . /opt/local/etc/bash_completion | |
| fi | |
| GIT_PS1_SHOWDIRTYSTATE=true | |
| PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;33m\]\w\[\033[00m\]\[\033[01;31m\]$(__git_ps1 " {%s}")\[\033[00m\]\$ ' |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.IO; | |
| namespace drawwell | |
| { | |
| class Program | |
| { |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.IO; | |
| namespace drawwell | |
| { | |
| class Program | |
| { |