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
describe('My Login application', () => { | |
it('Should login with valid credentials', () =>{ | |
cy.visit(`https://the-internet.herokuapp.com/login`); | |
cy.get('#username') | |
.type('tomsmith') | |
cy.get('#password') | |
.type('SuperSecretPassword!') |
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
require 'selenium-webdriver' | |
require 'rspec/expectations' | |
include RSpec::Matchers | |
def setup | |
caps = Selenium::WebDriver::Remote::Capabilities.send("chrome") | |
# This url is the local access url of the docker container | |
@driver = Selenium::WebDriver.for(:remote, url: "http://0.0.0.0:4444/wd/hub", desired_capabilities: caps) | |
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 run | |
setup | |
yield | |
teardown | |
end | |
run do | |
@driver.get 'http://www.kenst.com/about' | |
expect(@driver.title).to eql "About โ Chris Kenst's Blog" | |
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
require 'pry' # Add to gemfile if not already there | |
# Not a functioning test | |
# Also not the greatest example | |
def run | |
setup | |
yield | |
teardown | |
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
require 'selenium-webdriver' | |
require 'rspec/expectations' | |
include RSpec::Matchers | |
def setup | |
options = Selenium::WebDriver::Chrome::Options.new | |
options.add_argument('--headless') | |
options.add_argument('--disable-gpu') | |
options.add_argument('--remote-debugging-port=9222') | |
@driver = Selenium::WebDriver.for :chrome, options: 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
# Using pry as our REPL of choice. Could also use irb | |
pry | |
require 'selenium-webdriver' | |
#set our driver to use chrome and pass in switches. | |
driver = Selenium::WebDriver.for :chrome, switches: %w[--headless --no-sandbox --disable-gpu --remote-debugin-port=9222] | |
#let's go to kenst.com & make sure we are on the page | |
driver.get 'http://www.kenst.com' |
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
# This selenium script will automatically fill out stripe's checkout popup modal | |
# from the example modal within Stripe's documentation | |
require 'selenium-webdriver' | |
require 'rspec/expectations' | |
def setup | |
@driver = Selenium::WebDriver.for :chrome | |
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
$ rvm osx-ssl-certs status all | |
# Certificates for... | |
$ rvm osx-ssl-certs update all | |
# Updating certificates... |
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
#our REPL of choice is irb, could also use pry | |
irb | |
#require the selenium webdriver library | |
require 'selenium-webdriver' | |
#launch chrome as our driver | |
driver = Selenium::WebDriver.for :chrome | |
#navigate to google |
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
require 'selenium-webdriver' | |
RSpec.configure do |config| | |
config.before(:each) do | |
case ENV['host'] | |
when 'saucelabs' | |
caps = Selenium::WebDriver::Remote::Capabilities.send(ENV['browser']) | |
caps.version = ENV['browser_version'] | |
caps.platform = ENV['operating_system'] |
NewerOlder