Skip to content

Instantly share code, notes, and snippets.

View richdownie's full-sized avatar

Rich Downie richdownie

View GitHub Profile
FROM ruby:2.5.3
RUN apt-get update \
&& apt-get install libxi6 \
libnss3 \
libgconf-2-4 \
fonts-liberation \
libappindicator3-1 \
libasound2 \
libatk-bridge2.0-0 \
@richdownie
richdownie / file.txt
Last active March 7, 2019 16:59
Ping Slack with Git Branch
require 'slack-notifier'
slack = Slack::Notifier.new "https://hooks.slack.com/services/<token", channel: 'your_channel',
username: 'TestBot' #slack_speak
git_branch = IO.popen("git symbolic-ref --short HEAD") {|pipe| pipe.read.chomp }
slack.ping "#{git_branch}"
class Navigation
def widgets_index
@browser.get('https://fullstackautomationwithruby.com/widgets')
end
def installs
@browser.get('https://fullstackautomationwithruby.com/installs')
end
require 'cucumber'
require 'selenium-webdriver'
require 'cukehub'
caps = Selenium::WebDriver::Remote::Capabilities.chrome(chromeOptions: { args: [ "--headless" ]})
Before do
@browser = Selenium::WebDriver.for :chrome, desired_capabilities: caps
end
Feature: API Tests
@api_test
Scenario Outline: Test URLS for Response Codes and Message
* I verify <endpoint> <params> <response_code> and <response_message>
Examples:
| endpoint | params | response_code | response_message |
| "https://qa.cloudcheckr.com/api/inventory.xml/get_resources_ami_details" | "&use_account=2150ApiAuto" | "200" | "OK" |
caps = Selenium::WebDriver::Remote::Capabilities.chrome(chromeOptions: { binary: "/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary", args: [ "--headless" ]})
@browser = Selenium::WebDriver.for :chrome, desired_capabilities: caps
require 'cucumber'
require 'selenium-webdriver'
# require 'cukehub' # optional, but recommended. See cukehub.com for more details
caps = Selenium::WebDriver::Remote::Capabilities.chrome(chromeOptions: { binary: "/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary",
args: [ "--headless" ]})
Before do
@browser = Selenium::WebDriver.for :chrome, desired_capabilities: caps
end
class Set < Thor
include Thor::Actions
no_tasks do
def copy_environment(new_environment)
run("cp features/support/envs/env.rb.#{new_environment} features/support/env.rb")
end
end
desc "Chrome", "Use CHROME"
require 'bundler'
namespace :cuke do
desc "run cuke builds by cuke tag"
task :hub, [:tag] do |t, args|
file = "#{args[:tag]}".gsub(/@/, '')
Bundler.with_clean_env do
console_output = ""
IO.popen("cucumber -t #{args[:tag]} -f rerun --out #{file}.txt", 'r+') do |pipe|
console_output = pipe.read
require 'bundler'
namespace :cuke do
desc "run cuke builds by cuke tag"
task :hub, [:tag] do |t, args|
file = "#{args[:tag]}".gsub(/@/, '')
Bundler.with_clean_env do
console_output = ""
IO.popen("cucumber -t #{args[:tag]} -f rerun --out #{file}.txt", 'r+') do |pipe|
puts console_output = pipe.read