Skip to content

Commit

Permalink
✅ Capybara Test Helpers ✅
Browse files Browse the repository at this point in the history
  • Loading branch information
ElMassimo committed Nov 17, 2020
0 parents commit 671328b
Show file tree
Hide file tree
Showing 183 changed files with 16,622 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/rails.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
env:
RUBY_VERSION: 2.7

name: rails

on: [push, pull_request]

defaults:
run:
working-directory: ./examples/rails_app

jobs:
build:
name: RSpec & Cucumber
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install dependencies
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Run RSpecs
run: bin/rspec
- name: Run Cucumber
run: bin/cucumber
- name: Upload coverage results to GitHub
uses: actions/upload-artifact@main
with:
name: coverage-report
path: coverage
44 changes: 44 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
env:
RUBY_VERSION: 2.7

name: build

on: [push, pull_request]

jobs:
build:
name: RSpec & Rubocop
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Setup Code Climate test-reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Install dependencies
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Run tests
run: bin/rspec
- name: Lint Ruby code
run: bin/rubocop
- name: Upload code coverage to Code Climate
run: |
export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
./cc-test-reporter after-build -r ${{secrets.CC_TEST_REPORTER_ID}}
- name: Upload coverage results to GitHub
uses: actions/upload-artifact@main
with:
name: coverage-report
path: coverage
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/.bundle/
/.yardoc
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/

# rspec failure tracking
.rspec_status
3 changes: 3 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--format documentation
--color
--require spec_helper
97 changes: 97 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
inherit_from: .rubocop_todo.yml

Layout/ArgumentAlignment:
Enabled: false

Lint/AssignmentInCondition:
Enabled: false

Layout/FirstArgumentIndentation:
Enabled: false

Style/Documentation:
Enabled: false

Naming/RescuedExceptionsVariableName:
PreferredName: error

Layout/SpaceInsideStringInterpolation:
EnforcedStyle: space

Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented

Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent

Style/SymbolArray:
Enabled: false

Metrics/ParameterLists:
Enabled: false

Style/AccessModifierDeclarations:
Enabled: false

Style/MissingRespondToMissing:
Enabled: false

Style/ParallelAssignment:
Enabled: false

Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma

Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma

Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma

Style/Lambda:
EnforcedStyle: literal

Style/ClassAndModuleChildren:
Enabled: false

Style/BlockDelimiters:
Enabled: false

Layout/AccessModifierIndentation:
Enabled: true
EnforcedStyle: outdent

Layout/CaseIndentation:
EnforcedStyle: 'end'

# Disabled to allow the outdented comment style
Layout/CommentIndentation:
Enabled: false

Lint/SuppressedException:
Enabled: false

Metrics/AbcSize:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/ClassLength:
Enabled: false

Naming/PredicateName:
Enabled: false

Style/NumericPredicate:
Enabled: false

Security/YAMLLoad:
Enabled: false

Style/MutableConstant:
Enabled: false
14 changes: 14 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2020-11-05 13:38:45 UTC using RuboCop version 0.86.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 250
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.1
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Capybara Test Helpers 1.0.0 (2020-11-17) ##

* Initial Release.
38 changes: 38 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# frozen_string_literal: true

source 'https://rubygems.org'

# Specify your gem's dependencies in capybara_test_helpers.gemspec
gemspec

gem 'rake', '~> 12.0'

group :development do
gem 'pry-byebug'
gem 'pry-rescue'
gem 'pry-stack_explorer'
gem 'rubocop'
end

group :test do
gem 'rspec', '~> 3.0'
gem 'selenium-webdriver', '~> 3'
gem 'simplecov', '< 0.18'
gem 'webdrivers'

# Generator
gem 'generator_spec', require: false
gem 'rails', require: false
gem 'rspec-rails', require: false

# Sample App
gem 'launchy'
gem 'puma'
gem 'sinatra'
gem 'tilt'
gem 'yaml'

# Benchmarks
gem 'amazing_print'
gem 'rainbow'
end
Loading

0 comments on commit 671328b

Please sign in to comment.