Skip to content

Instantly share code, notes, and snippets.

Avatar
🎧
Focusing

Wellington Avelino dos Santos wellavelino

🎧
Focusing
View GitHub Profile
@wellavelino
wellavelino / Rakefile.rb
Last active Jun 21, 2021
A simple rakefile example
View Rakefile.rb
require 'rubygems'
require 'cucumber'
require 'cucumber/rake/task'
desc 'Execute Buyer features'
task :buyer_features, [:apk_path] do |_task, args|
puts 'Running Buyer features'
sh "bundle exec calabash-android run #{args[:apk_path]} -p android features/ -t ~@seller -f html -o reports/buyer/buyer.html"
end
View report_join.rb
require 'nokogiri'
require 'find'
class JunitMerge
FAILURES_DIR = 'artifacts/composer-output/failures/'.freeze
REPORT_DIRECTORY = 'artifacts/composer-output/'.freeze
COLLATED_REPORT = 'artifacts/composer-output/junit4-reports/collated_report.xml'.freeze
OUTDATED_REPORTS = 'artifacts/composer-output/junit4-reports'.freeze
def run
View logs.txt
[12:03:20]: Running tests for locale: ro
[12:03:20]: $ /Users/wavelinodossantos/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument --no-window-animation -w \
-e testLocale ro \
-e endingLocale en_US \
-e appendTimestamp true \
-e package com.wellington.android.localization.screenshot \
com.wellington.android.test/com.wellington.android.utils.TestRunner
[12:03:32]: ▸ com.wellington.android.localization.screenshot.LocalizationScreenShot:.
[12:03:32]: ▸ Time: 10.522
[12:03:32]: ▸ OK (1 test)
@wellavelino
wellavelino / customFailureHandle.kt
Created Jan 30, 2020
Custom failure handle for espresso
View customFailureHandle.kt
import android.os.Environment.DIRECTORY_DOCUMENTS
import android.os.Environment.getExternalStoragePublicDirectory
import android.util.Log
import android.view.View
import androidx.test.espresso.AmbiguousViewMatcherException
import androidx.test.espresso.EspressoException
import androidx.test.espresso.FailureHandler
import androidx.test.espresso.InjectEventSecurityException
import androidx.test.espresso.PerformException
import androidx.test.espresso.core.internal.deps.guava.base.Throwables.throwIfUnchecked
View gist:ab03e913bce14411cb64087f882ce91d
def reportsDirectory = "$buildDir/artifacts/composer-output"
def embedScreenshotsTask = task('embedScreenshots', group: 'reporting') {
dependsOn {
fetchScreenshotsTask
}
doFirst {
println new File(reportsDirectory, 'screenshots/failures')
View gnib_check
#!/bin/bash
BOT_TOKEN=""
CHAT_ID=""
MESSAGE=""
LAST_MESSAGE=""
COUNT=0
while true; do
slot=$(curl -ks https://burghquayregistrationoffice.inis.gov.ie/Website/AMSREG/AMSRegWeb.nsf/\(getApps4DTAvailability\)\?readform\&\&cat\=Other\&sbcat\=All\&typ\=Renewal)
@wellavelino
wellavelino / rerun.rb
Created Jul 22, 2019
re_run_failures
View rerun.rb
require 'nokogiri'
def re_run_failed_tests(report_dir, retry_count = 3)
count = 0
loop do
puts "Starting test execution number: #{count}"
failures = check_for_failures(report_dir)
parsed_test_failures = failures.join(",")
test_output = "artifacts/composer-output/failed-retry#{count}"
View screnshots_pull.groovy
// Basead on https://github.com/zawadz88/ScreenshotCapturingSample/blob/master/app/build.gradle
def reportsDirectory = "artifacts/composer-output"
def embedScreenshotsTask = task('embedScreenshots', group: 'reporting') {
dependsOn {
fetchScreenshotsTask
}
doFirst {
View it_companies.txt
https://newrelic.com/about/careers
https://www.twilio.com/company/jobs#open-positions
https://company.ding.com/careers/
https://careers.shutterstock.com/teams/technology/
http://www.top1000.ie/industries/technology
View rake_report.rb
task :run_features, [:feature, :scenario] do |_task, args|
puts "Running #{args[:feature]} feature with #{args[:scenario]} scenarios and report"
sh "cucumber -t @#{args[:feature]} -t @#{args[:scenario]} -f html -o #{args[:scenario]}_scenarios.html"
end