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
| const { test, expect } = require(โ@playwright/testโ); | |
| const axios = require(โaxiosโ); | |
| test(โLogin using OTP code via SMSโ, async ({ page }) => { | |
| const phoneNumber = โ15555555555โ; // Replace with a Mailinator test phone number | |
| // Navigate to the login page and initiate login | |
| await page.goto(โhttps://yourapp.com/loginโ); | |
| await page.fill(โ#phoneโ, phoneNumber); | |
| await page.click(โbutton[type=โsubmitโ]โ); |
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
| const { test, expect } = require(โ@playwright/testโ); | |
| const axios = require(โaxiosโ); | |
| test(โLogin using OTP code via emailโ, async ({ page }) => { | |
| // Generate a unique inbox name | |
| const inbox = `testuser_${Date.now()}`; | |
| const emailAddress = `${inbox}@your-private-domain.mailinator.com`; // replace this with your priviate domain | |
| // Navigate to the login page and initiate login |
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... |
NewerOlder