Skip to content

Developer Resources

huanger2 edited this page Apr 22, 2025 · 17 revisions

Deployment Testing in-class (Yaman and Tash) - Apr 21, 2025

  1. Setup the following ENV variables in heroku
APP_KEY
REDIRECT URI
CANVAS_CLIENT_ID
CANVAS_URL

RAILS_MASTER_KEY

Redirect uri should have domain-name/auth/callback

  1. Pushing branch Iter4 to flextensions heroku
heroku login
git remote add golden https://git.heroku.com/flextensions.git
git push golden main
  1. https://sp25-02-flextensions-4f5b4fbccd7f.herokuapp.com

Testing

Test Commands

Test Type Command
RSpec Tests (no a11y) bundle exec rspec --tag '~a11y'
Cucumber Tests (no a11y) bundle exec cucumber --tags 'not @a11y and not @skip'
All Regular Tests bundle exec rspec --tag '~a11y' && bundle exec cucumber --tags 'not @a11y and not @skip'
Accessibility Tests (RSpec) bundle exec rspec --tag a11y
Accessibility Tests (Cucumber) bundle exec cucumber --tags @a11y
All Tests (including a11y) bundle exec rspec && bundle exec cucumber --tags 'not @skip'
Lint Code (RuboCop) bundle exec rubocop
Auto-fix Lint Issues bundle exec rubocop -A
Validate Swagger API npx @redocly/cli lint app/assets/swagger/swagger.json --extends=minimal

Test Tags

Tag Description
@javascript Tests requiring JS execution in browser (uses Selenium/headless browser), without the tag, it will run in rack, which is exponentially faster to test
@a11y Accessibility tests using axe-core to verify WCAG compliance
@skip Temporarily skipped tests (known failures)
@wip Work In Progress tests still under development

Tips

  • Use ~ (RSpec) or not (Cucumber) to exclude tags
  • Combine tags in Cucumber with and/or: --tags '@javascript and not @skip'
  • Run accessibility tests separately (slower)

Conventions

  1. Testing convention css selector - <a class="nav-link testid-username" href="#"> Tashrique </a>

Notice the testid-usernameWe will be using this style in class to grab elements from DOM to test.

Please don't remove any class that starts with testid-

Clone this wiki locally