-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
try creating a system test and running in Travis (#4888)
* try creating a system test * Create application_system_test_case.rb * Update .travis.yml * Update Gemfile * Update Gemfile * Update .travis.yml * Update application_system_test_case.rb * Update .travis.yml * Update .travis.yml * Update .travis.yml * Fix system test * Disable system test on production for now * Comment system test related configs from .travis.yml * Update Gemfile * Update Gemfile.lock * Update application_system_test_case.rb * Update .travis.yml * update gemfile.lock * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update application_system_test_case.rb * apt-get install google-chrome-stable chromium-chromedriver * wget/dpkg install of chromium and chromedriver * Update .travis.yml * Update .travis.yml * gemfile.lock update * Gemfile.lock update * change curl to wget * Chromedriver 2.35 and removed finds missing * Turn off binary option * Add command to start Chrome * update selenium-webdriver to 3.141.0 * --no-sandbox * export DISPLAY=:99.0 * Xvfb : nohup Xvfb -ac :9 -screen 0 1280x1024x16 & * Remove prefix * Chromedriver 73.0.3683.68 * Add chrome flags to ruby initializer * comment out first start of chrome, remove extraneous comments * commenting out `xvfb` and `DISPLAY` * move passenger to general gems; move back if it fails * cleaning up commented lines * Update Gemfile * Update Gemfile * Update Gemfile * Update application_system_test_case.rb
- Loading branch information
Showing
6 changed files
with
61 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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 file contains 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 file contains 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 file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require "test_helper" | ||
|
||
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase | ||
chromeOptions = %w(--headless --disable-gpu --no-sandbox --remote-debugging-port=9222) | ||
caps = Selenium::WebDriver::Remote::Capabilities.chrome("chromeOptions" => {"args" => chromeOptions}) | ||
driven_by :selenium, using: :chrome, screen_size: [1400, 1400], options: { desired_capabilities: caps } | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require "application_system_test_case" | ||
# https://guides.rubyonrails.org/testing.html#implementing-a-system-test | ||
|
||
class SearchTest < ApplicationSystemTestCase | ||
test 'searching an item from the homepage' do | ||
visit '/' | ||
|
||
fill_in("searchform_input", with: "Canon") | ||
find('button.btn-default').click | ||
|
||
assert_selector('h2', text: 'Results for Canon') | ||
end | ||
end |