diff --git a/advanced_topics/01_debugging_with_save_and_open/Gemfile b/advanced_topics/01_debugging_with_save_and_open/Gemfile index 8e87122..54fea7c 100644 --- a/advanced_topics/01_debugging_with_save_and_open/Gemfile +++ b/advanced_topics/01_debugging_with_save_and_open/Gemfile @@ -1,7 +1,8 @@ source 'https://rubygems.org' -gem 'capybara', '~> 3.13', '>= 3.13.2' # Released: January 24, 2019 -gem 'rspec', '~> 3.8' # Released: August 4, 2018 -gem 'selenium-webdriver', '~> 3.141' # Released: November 1, 2018 -gem 'launchy', '~> 2.4', '>= 2.4.3' # Released November 3, 2014 -gem 'ffi', '~> 1.11', '>= 1.11.3' +gem 'capybara' # Released: January 24, 2019 +gem 'rexml' +gem 'rspec'# Released: August 4, 2018 +gem 'selenium-webdriver'# Released: November 1, 2018 +gem 'launchy'# Released November 3, 2014 +gem 'ffi' diff --git a/advanced_topics/01_debugging_with_save_and_open/Gemfile.lock b/advanced_topics/01_debugging_with_save_and_open/Gemfile.lock index f6a8eec..37a36eb 100644 --- a/advanced_topics/01_debugging_with_save_and_open/Gemfile.lock +++ b/advanced_topics/01_debugging_with_save_and_open/Gemfile.lock @@ -1,61 +1,64 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.6.0) - public_suffix (>= 2.0.2, < 4.0) - capybara (3.28.0) + addressable (2.8.5) + public_suffix (>= 2.0.2, < 6.0) + capybara (3.39.2) addressable + matrix mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) - regexp_parser (~> 1.5) + regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - childprocess (1.0.1) - rake (< 13.0) - diff-lcs (1.3) - ffi (1.12.2) - launchy (2.4.3) - addressable (~> 2.3) - mini_mime (1.0.2) - mini_portile2 (2.4.0) - nokogiri (1.10.8) - mini_portile2 (~> 2.4.0) - public_suffix (3.1.1) - rack (2.0.7) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rake (12.3.3) - regexp_parser (1.6.0) - rspec (3.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.2) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.4) + diff-lcs (1.5.0) + ffi (1.16.2) + launchy (2.5.2) + addressable (~> 2.8) + matrix (0.4.2) + mini_mime (1.1.5) + nokogiri (1.15.4-x86_64-darwin) + racc (~> 1.4) + public_suffix (5.0.3) + racc (1.7.1) + rack (3.0.8) + rack-test (2.1.0) + rack (>= 1.3) + regexp_parser (2.8.1) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.1) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.2) - rubyzip (1.3.0) - selenium-webdriver (3.142.3) - childprocess (>= 0.5, < 2.0) - rubyzip (~> 1.2, >= 1.2.2) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) + rubyzip (2.3.2) + selenium-webdriver (4.13.1) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) + websocket (1.2.10) xpath (3.2.0) nokogiri (~> 1.8) PLATFORMS - ruby + x86_64-darwin-22 DEPENDENCIES - capybara (~> 3.13, >= 3.13.2) - ffi (~> 1.11, >= 1.11.3) - launchy (~> 2.4, >= 2.4.3) - rspec (~> 3.8) - selenium-webdriver (~> 3.141) + capybara + ffi + launchy + rexml + rspec + selenium-webdriver BUNDLED WITH - 1.17.2 + 2.4.20 diff --git a/advanced_topics/01_debugging_with_save_and_open/spec/features/save_and_open_page_spec.rb b/advanced_topics/01_debugging_with_save_and_open/spec/features/save_and_open_page_spec.rb index e61d025..d1b4f12 100644 --- a/advanced_topics/01_debugging_with_save_and_open/spec/features/save_and_open_page_spec.rb +++ b/advanced_topics/01_debugging_with_save_and_open/spec/features/save_and_open_page_spec.rb @@ -18,7 +18,7 @@ visit '/' end - scenario 'save_and_open_page' do + scenario 'Save and Open Page' do save_and_open_page end end diff --git a/advanced_topics/01_debugging_with_save_and_open/spec/features/save_and_open_screenshot_spec.rb b/advanced_topics/01_debugging_with_save_and_open/spec/features/save_and_open_screenshot_spec.rb index 65d72a3..77c2f89 100644 --- a/advanced_topics/01_debugging_with_save_and_open/spec/features/save_and_open_screenshot_spec.rb +++ b/advanced_topics/01_debugging_with_save_and_open/spec/features/save_and_open_screenshot_spec.rb @@ -18,7 +18,7 @@ visit '/' end - scenario 'save_and_open_screenshot' do + scenario 'Save and Open Screenshot' do save_and_open_screenshot end end diff --git a/advanced_topics/01_debugging_with_save_and_open/spec/spec_helper.rb b/advanced_topics/01_debugging_with_save_and_open/spec/spec_helper.rb index 819db2b..bcfab26 100644 --- a/advanced_topics/01_debugging_with_save_and_open/spec/spec_helper.rb +++ b/advanced_topics/01_debugging_with_save_and_open/spec/spec_helper.rb @@ -7,7 +7,7 @@ Bundler.setup(:default) Bundler.require -Capybara.default_driver = :selenium_chrome +Capybara.default_driver = :selenium Capybara.app_host = 'https://the-internet.herokuapp.com' Capybara.default_max_wait_time = 10 diff --git a/advanced_topics/01_debugging_with_save_and_open/tmp/capybara/capybara-202309281045287262307449.html b/advanced_topics/01_debugging_with_save_and_open/tmp/capybara/capybara-202309281045287262307449.html new file mode 100644 index 0000000..0cb0718 --- /dev/null +++ b/advanced_topics/01_debugging_with_save_and_open/tmp/capybara/capybara-202309281045287262307449.html @@ -0,0 +1,97 @@ + + + + + The Internet + + + + + + + + + +
+
+ + + + + + + +
+
+
+ Fork me on GitHub +
+ +

Welcome to the-internet

+

Available Examples

+ + +
+
+ + + + \ No newline at end of file diff --git a/advanced_topics/01_debugging_with_save_and_open/tmp/capybara/capybara-202309281045293631785691.png b/advanced_topics/01_debugging_with_save_and_open/tmp/capybara/capybara-202309281045293631785691.png new file mode 100644 index 0000000..60c0205 Binary files /dev/null and b/advanced_topics/01_debugging_with_save_and_open/tmp/capybara/capybara-202309281045293631785691.png differ diff --git a/advanced_topics/02_chrome_logging/Gemfile b/advanced_topics/02_chrome_logging/Gemfile index 8eaf133..5451cc0 100644 --- a/advanced_topics/02_chrome_logging/Gemfile +++ b/advanced_topics/02_chrome_logging/Gemfile @@ -1,6 +1,7 @@ source 'https://rubygems.org' -gem 'capybara', '~> 3.13', '>= 3.13.2' -gem 'rspec', '~> 3.8' -gem 'selenium-webdriver', '~> 3.141' -gem 'ffi', '~> 1.11', '>= 1.11.3' +gem 'capybara' +gem 'rspec' +gem 'selenium-webdriver' +gem 'ffi' +gem 'rexml' diff --git a/advanced_topics/02_chrome_logging/Gemfile.lock b/advanced_topics/02_chrome_logging/Gemfile.lock index a4ccb72..697753c 100644 --- a/advanced_topics/02_chrome_logging/Gemfile.lock +++ b/advanced_topics/02_chrome_logging/Gemfile.lock @@ -1,58 +1,61 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.6.0) - public_suffix (>= 2.0.2, < 4.0) - capybara (3.28.0) + addressable (2.8.5) + public_suffix (>= 2.0.2, < 6.0) + capybara (3.39.2) addressable + matrix mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) - regexp_parser (~> 1.5) + regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - childprocess (1.0.1) - rake (< 13.0) - diff-lcs (1.3) - ffi (1.12.2) - mini_mime (1.0.2) - mini_portile2 (2.4.0) - nokogiri (1.10.8) - mini_portile2 (~> 2.4.0) - public_suffix (3.1.1) - rack (2.0.7) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rake (12.3.3) - regexp_parser (1.6.0) - rspec (3.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.2) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.4) + diff-lcs (1.5.0) + ffi (1.16.2) + matrix (0.4.2) + mini_mime (1.1.5) + nokogiri (1.15.4-x86_64-darwin) + racc (~> 1.4) + public_suffix (5.0.3) + racc (1.7.1) + rack (3.0.8) + rack-test (2.1.0) + rack (>= 1.3) + regexp_parser (2.8.1) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.1) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.2) - rubyzip (1.3.0) - selenium-webdriver (3.142.3) - childprocess (>= 0.5, < 2.0) - rubyzip (~> 1.2, >= 1.2.2) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) + rubyzip (2.3.2) + selenium-webdriver (4.13.1) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) + websocket (1.2.10) xpath (3.2.0) nokogiri (~> 1.8) PLATFORMS - ruby + x86_64-darwin-22 DEPENDENCIES - capybara (~> 3.13, >= 3.13.2) - ffi (~> 1.11, >= 1.11.3) - rspec (~> 3.8) - selenium-webdriver (~> 3.141) + capybara + ffi + rexml + rspec + selenium-webdriver BUNDLED WITH - 1.17.2 + 2.4.20 diff --git a/advanced_topics/03_apparition_driver/Gemfile b/advanced_topics/03_apparition_driver/Gemfile index e12158f..4bd63cb 100644 --- a/advanced_topics/03_apparition_driver/Gemfile +++ b/advanced_topics/03_apparition_driver/Gemfile @@ -1,7 +1,8 @@ source 'https://rubygems.org' -gem 'capybara', '~> 3.13', '>= 3.13.2' -gem 'rspec', '~> 3.8' -gem 'apparition', github: 'twalpole/apparition' -gem 'selenium-webdriver', '~> 3.141' -gem 'ffi', '~> 1.11', '>= 1.11.3' +gem 'capybara', '~> 3.39', '>= 3.39.2' # June 10, 2023 +gem 'rspec', '~> 3.12' # October 26, 2022 +gem 'apparition', '~> 0.6.0', github: 'twalpole/apparition' +gem 'selenium-webdriver', '~> 4.13', '>= 4.13.1' # September 26, 2023 +gem 'ffi', '~> 1.16', '>= 1.16.2' # September 25, 2023 +gem 'rexml', '~> 3.2', '>= 3.2.6' # July 27, 2023 diff --git a/advanced_topics/03_apparition_driver/Gemfile.lock b/advanced_topics/03_apparition_driver/Gemfile.lock index 5dd45dc..51326cc 100644 --- a/advanced_topics/03_apparition_driver/Gemfile.lock +++ b/advanced_topics/03_apparition_driver/Gemfile.lock @@ -1,70 +1,73 @@ GIT - remote: git://github.com/twalpole/apparition.git - revision: 292a16ed741132c392e013a3eb1efd003a175615 + remote: https://github.com/twalpole/apparition.git + revision: ca86be4d54af835d531dbcd2b86e7b2c77f85f34 specs: - apparition (0.4.0) + apparition (0.6.0) capybara (~> 3.13, < 4) websocket-driver (>= 0.6.5) GEM remote: https://rubygems.org/ specs: - addressable (2.6.0) - public_suffix (>= 2.0.2, < 4.0) - capybara (3.28.0) + addressable (2.8.5) + public_suffix (>= 2.0.2, < 6.0) + capybara (3.39.2) addressable + matrix mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) - regexp_parser (~> 1.5) + regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - childprocess (1.0.1) - rake (< 13.0) - diff-lcs (1.3) - ffi (1.12.2) - mini_mime (1.0.2) - mini_portile2 (2.4.0) - nokogiri (1.10.8) - mini_portile2 (~> 2.4.0) - public_suffix (3.1.1) - rack (2.0.7) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rake (12.3.3) - regexp_parser (1.6.0) - rspec (3.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.2) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.4) + diff-lcs (1.5.0) + ffi (1.16.2) + matrix (0.4.2) + mini_mime (1.1.5) + nokogiri (1.15.4-x86_64-darwin) + racc (~> 1.4) + public_suffix (5.0.3) + racc (1.7.1) + rack (3.0.8) + rack-test (2.1.0) + rack (>= 1.3) + regexp_parser (2.8.1) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.1) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.2) - rubyzip (1.3.0) - selenium-webdriver (3.142.3) - childprocess (>= 0.5, < 2.0) - rubyzip (~> 1.2, >= 1.2.2) - websocket-driver (0.7.1) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) + rubyzip (2.3.2) + selenium-webdriver (4.13.1) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) + websocket (1.2.10) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.4) + websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) PLATFORMS - ruby + x86_64-darwin-22 DEPENDENCIES - apparition! - capybara (~> 3.13, >= 3.13.2) - ffi (~> 1.11, >= 1.11.3) - rspec (~> 3.8) - selenium-webdriver (~> 3.141) + apparition (~> 0.6.0)! + capybara (~> 3.39, >= 3.39.2) + ffi (~> 1.16, >= 1.16.2) + rexml (~> 3.2, >= 3.2.6) + rspec (~> 3.12) + selenium-webdriver (~> 4.13, >= 4.13.1) BUNDLED WITH - 1.17.2 + 2.4.20 diff --git a/advanced_topics/03_apparition_driver/screenshots/screenshot_2023-09-28 11:14:54 +0900.png b/advanced_topics/03_apparition_driver/screenshots/screenshot_2023-09-28 11:14:54 +0900.png new file mode 100644 index 0000000..80f8361 Binary files /dev/null and b/advanced_topics/03_apparition_driver/screenshots/screenshot_2023-09-28 11:14:54 +0900.png differ diff --git a/advanced_topics/03_apparition_driver/spec/features/01_visit_home_spec.rb b/advanced_topics/03_apparition_driver/spec/features/01_visit_home_spec.rb index 797e2c2..39f1f36 100644 --- a/advanced_topics/03_apparition_driver/spec/features/01_visit_home_spec.rb +++ b/advanced_topics/03_apparition_driver/spec/features/01_visit_home_spec.rb @@ -8,7 +8,7 @@ scenario 'Take Screenshot: Welcome to the-internet' do expect(page).to have_content('Welcome to the-internet') screenshot_name = "screenshot_" + Time.now.to_s - save_screenshot("../screenshots/#{screenshot_name}.png") + save_screenshot("screenshots/#{screenshot_name}.png") end scenario 'HTTP Status Code: OK 200' do diff --git a/advanced_topics/04_applitools/Gemfile b/advanced_topics/04_applitools/Gemfile index d63b485..57273a6 100644 --- a/advanced_topics/04_applitools/Gemfile +++ b/advanced_topics/04_applitools/Gemfile @@ -1,7 +1,8 @@ source 'https://rubygems.org' -gem 'capybara', '~> 3.13', '>= 3.13.2' -gem 'rspec', '~> 3.8' -gem 'selenium-webdriver', '~> 3.141' -gem 'eyes_capybara', '~> 3.14', '>= 3.14.10' -gem 'ffi', '~> 1.11', '>= 1.11.3' +gem 'capybara', '~> 3.39', '>= 3.39.2' # June 10, 2023 +gem 'rspec', '~> 3.12' # October 26, 2022 +gem 'selenium-webdriver', '~> 4.13', '>= 4.13.1' # September 26, 2023 +gem 'ffi', '~> 1.16', '>= 1.16.2' # September 25, 2023 +gem 'rexml', '~> 3.2', '>= 3.2.6' # July 27, 2023 +gem 'eyes_capybara', '~> 5.0' # July 11, 2023 \ No newline at end of file diff --git a/advanced_topics/04_applitools/Gemfile.lock b/advanced_topics/04_applitools/Gemfile.lock index 232e3b6..3b402df 100644 --- a/advanced_topics/04_applitools/Gemfile.lock +++ b/advanced_topics/04_applitools/Gemfile.lock @@ -1,84 +1,129 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.6.0) - public_suffix (>= 2.0.2, < 4.0) - capybara (3.28.0) + addressable (2.8.5) + public_suffix (>= 2.0.2, < 6.0) + capybara (3.39.2) addressable + matrix mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) - regexp_parser (~> 1.5) + regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - childprocess (1.0.1) - rake (< 13.0) - chunky_png (1.3.6) - crass (1.0.4) - css_parser (1.7.0) + colorize (1.1.0) + crass (1.0.6) + css_parser (1.16.0) addressable - diff-lcs (1.3) - eyes_capybara (3.15.31) + diff-lcs (1.5.0) + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) + eyes_capybara (5.0.0) capybara - eyes_selenium (= 3.15.31) - eyes_core (3.15.31) - chunky_png (= 1.3.6) + eyes_selenium (= 5.0.0) + eyes_core (5.0.0) + colorize + eyes_universal (~> 3.6.0) faraday - oily_png (~> 1.2) + faraday-cookie_jar + faraday_middleware oj - eyes_selenium (3.15.31) + sorted_set + websocket + eyes_selenium (5.0.0) crass css_parser - eyes_core (= 3.15.31) - selenium-webdriver + eyes_core (= 5.0.0) + selenium-webdriver (>= 3) state_machine - faraday (0.15.4) - multipart-post (>= 1.2, < 3) - ffi (1.12.2) - mini_mime (1.0.2) - mini_portile2 (2.4.0) - multipart-post (2.1.1) - nokogiri (1.10.8) - mini_portile2 (~> 2.4.0) - oily_png (1.2.0) - chunky_png (~> 1.3.1) - oj (3.9.0) - public_suffix (3.1.1) - rack (2.0.7) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rake (12.3.3) - regexp_parser (1.6.0) - rspec (3.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.2) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.4) + eyes_universal (3.6.0) + faraday (1.10.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) + http-cookie (~> 1.0.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.0) + faraday (~> 1.0) + ffi (1.16.2) + http-cookie (1.0.5) + domain_name (~> 0.5) + matrix (0.4.2) + mini_mime (1.1.5) + multipart-post (2.3.0) + nokogiri (1.15.4-x86_64-darwin) + racc (~> 1.4) + oj (3.16.1) + public_suffix (5.0.3) + racc (1.7.1) + rack (3.0.8) + rack-test (2.1.0) + rack (>= 1.3) + rbtree (0.4.6) + regexp_parser (2.8.1) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.1) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.2) - rubyzip (1.3.0) - selenium-webdriver (3.142.3) - childprocess (>= 0.5, < 2.0) - rubyzip (~> 1.2, >= 1.2.2) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + selenium-webdriver (4.13.1) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) + set (1.0.3) + sorted_set (1.0.3) + rbtree + set (~> 1.0) state_machine (1.2.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.8.2) + websocket (1.2.10) xpath (3.2.0) nokogiri (~> 1.8) PLATFORMS - ruby + x86_64-darwin-22 DEPENDENCIES - capybara (~> 3.13, >= 3.13.2) - eyes_capybara (~> 3.14, >= 3.14.10) - ffi (~> 1.11, >= 1.11.3) - rspec (~> 3.8) - selenium-webdriver (~> 3.141) + capybara (~> 3.39, >= 3.39.2) + eyes_capybara (~> 5.0) + ffi (~> 1.16, >= 1.16.2) + rexml (~> 3.2, >= 3.2.6) + rspec (~> 3.12) + selenium-webdriver (~> 4.13, >= 4.13.1) BUNDLED WITH - 1.17.2 + 2.4.20 diff --git a/advanced_topics/04_applitools/spec/features/01_login_and_logout_spec.rb b/advanced_topics/04_applitools/spec/features/01_login_and_logout_spec.rb index 4dca3a5..60cba55 100644 --- a/advanced_topics/04_applitools/spec/features/01_login_and_logout_spec.rb +++ b/advanced_topics/04_applitools/spec/features/01_login_and_logout_spec.rb @@ -5,7 +5,7 @@ # Initialize the eyes SDK and set your private API key. let(:eyes) do Applitools::Selenium::Eyes.new.tap do |eyes| - eyes.api_key = '1HWNQQkG5dGMVMTRSfGVsya5mfvlNVJ98LoOxeo6eEYI110' + eyes.api_key = APPLITOOLS_KEY_API end end diff --git a/advanced_topics/04_applitools/spec/features/package-lock.json b/advanced_topics/04_applitools/spec/features/package-lock.json new file mode 100644 index 0000000..9904dfd --- /dev/null +++ b/advanced_topics/04_applitools/spec/features/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "features", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/advanced_topics/04_applitools/spec/package-lock.json b/advanced_topics/04_applitools/spec/package-lock.json new file mode 100644 index 0000000..075e9bc --- /dev/null +++ b/advanced_topics/04_applitools/spec/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "spec", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/intro/Gemfile b/intro/Gemfile index 33c7fba..6781f80 100644 --- a/intro/Gemfile +++ b/intro/Gemfile @@ -1,6 +1,7 @@ source 'https://rubygems.org' -gem 'capybara', '~> 3.13', '>= 3.13.2' # Released: January 24, 2019 +gem 'capybara' # Released: January 24, 2019 +gem 'rexml' gem 'rspec', '~> 3.8' # Released: August 4, 2018 gem 'rubocop', '~> 0.65.0' # Released: Feb 19, 2019 gem 'selenium-webdriver', '~> 3.141' # Released: November 1, 2018 diff --git a/intro/Gemfile.lock b/intro/Gemfile.lock index 885efdc..13ca992 100644 --- a/intro/Gemfile.lock +++ b/intro/Gemfile.lock @@ -1,51 +1,56 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.7.0) - public_suffix (>= 2.0.2, < 5.0) - ast (2.4.0) - capybara (3.29.0) + addressable (2.8.5) + public_suffix (>= 2.0.2, < 6.0) + ast (2.4.2) + capybara (3.39.2) addressable + matrix mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) - regexp_parser (~> 1.5) + regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) childprocess (3.0.0) - diff-lcs (1.3) - ffi (1.12.2) - jaro_winkler (1.5.4) - launchy (2.4.3) - addressable (~> 2.3) - mini_mime (1.0.2) - mini_portile2 (2.4.0) - nokogiri (1.10.8) - mini_portile2 (~> 2.4.0) - parallel (1.19.0) - parser (2.6.5.0) - ast (~> 2.4.0) - powerpack (0.1.2) - psych (3.1.0) - public_suffix (4.0.1) - rack (2.0.7) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rainbow (3.0.0) - regexp_parser (1.6.0) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.0) - rspec-support (~> 3.9.0) - rspec-expectations (3.9.0) + diff-lcs (1.5.0) + ffi (1.16.2) + jaro_winkler (1.5.6) + launchy (2.5.2) + addressable (~> 2.8) + matrix (0.4.2) + mini_mime (1.1.5) + nokogiri (1.15.4-x86_64-darwin) + racc (~> 1.4) + parallel (1.23.0) + parser (3.2.2.3) + ast (~> 2.4.1) + racc + powerpack (0.1.3) + psych (5.1.0) + stringio + public_suffix (5.0.3) + racc (1.7.1) + rack (3.0.8) + rack-test (2.1.0) + rack (>= 1.3) + rainbow (3.1.1) + regexp_parser (2.8.1) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.0) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) rubocop (0.65.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) @@ -55,11 +60,12 @@ GEM rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.4.0) - ruby-progressbar (1.10.1) - rubyzip (2.0.0) - selenium-webdriver (3.142.6) + ruby-progressbar (1.13.0) + rubyzip (2.3.2) + selenium-webdriver (3.142.7) childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) + stringio (3.0.8) unicode-display_width (1.4.1) webdrivers (4.1.3) nokogiri (~> 1.6) @@ -69,16 +75,17 @@ GEM nokogiri (~> 1.8) PLATFORMS - ruby + x86_64-darwin-22 DEPENDENCIES - capybara (~> 3.13, >= 3.13.2) + capybara ffi (~> 1.11, >= 1.11.3) launchy (~> 2.4, >= 2.4.3) + rexml rspec (~> 3.8) rubocop (~> 0.65.0) selenium-webdriver (~> 3.141) webdrivers (~> 4.1.0) BUNDLED WITH - 1.17.2 + 2.4.20 diff --git a/intro/spec/features/01_visit_home_spec.rb b/intro/spec/features/01_visit_home_spec.rb index c7b25bd..6792acc 100644 --- a/intro/spec/features/01_visit_home_spec.rb +++ b/intro/spec/features/01_visit_home_spec.rb @@ -18,17 +18,57 @@ expect(page).to have_current_path('https://the-internet.herokuapp.com') end - scenario 'Verify Link Exists: Form Authentication' do + scenario 'Verify Page Links Exist' do + expect(page).to have_link('A/B Testing') + expect(page).to have_link('Add/Remove Elements') + expect(page).to have_link('Basic Auth') + expect(page).to have_link('Broken Images') + expect(page).to have_link('Challenging DOM') + expect(page).to have_link('Checkboxes') + expect(page).to have_link('Context Menu') + expect(page).to have_link('Digest Authentication') + expect(page).to have_link('Disappearing Elements') + expect(page).to have_link('Drag and Drop') + expect(page).to have_link('Dropdown') + expect(page).to have_link('Dynamic Content') + expect(page).to have_link('Dynamic Controls') + expect(page).to have_link('Dynamic Loading') + expect(page).to have_link('Entry Ad') + expect(page).to have_link('Exit Intent') + expect(page).to have_link('File Download') + expect(page).to have_link('File Upload') + expect(page).to have_link('Floating Menu') + expect(page).to have_link('Forgot Password') expect(page).to have_link('Form Authentication') + expect(page).to have_link('Frames') + expect(page).to have_link('Geolocation') + expect(page).to have_link('Horizontal Slider') + expect(page).to have_link('Hovers') + expect(page).to have_link('Infinite Scroll') + expect(page).to have_link('Inputs') + expect(page).to have_link('JQuery UI Menus') + expect(page).to have_link('JavaScript Alerts') + expect(page).to have_link('JavaScript onload event error') + expect(page).to have_link('Key Presses') + expect(page).to have_link('Large & Deep DOM') + expect(page).to have_link('Multiple Windows') + expect(page).to have_link('Nested Frames') + expect(page).to have_link('Notification Messages') + expect(page).to have_link('Redirect Link') + expect(page).to have_link('Secure File Download') + expect(page).to have_link('Shadow DOM') + expect(page).to have_link('Shifting Content') + expect(page).to have_link('Slow Resources') + expect(page).to have_link('Sortable Data Tables') + expect(page).to have_link('Status Codes') + expect(page).to have_link('Typos') + expect(page).to have_link('WYSIWYG Editor') end scenario 'Click Link: Form Authentication ==> Navigate to /login' do click_link('Form Authentication') expect(page).to have_current_path('/login') - end - - scenario 'Verify Link Exists: Dropdown' do - expect(page).to have_link('Dropdown') + expect(page).to have_content('Login Page') end scenario 'Click On: Dropdown ==> Navigate to /dropdown' do diff --git a/intro/spec/features/02_within_spec.rb b/intro/spec/features/02_within_spec.rb index 495b08b..3b3ef37 100644 --- a/intro/spec/features/02_within_spec.rb +++ b/intro/spec/features/02_within_spec.rb @@ -16,4 +16,10 @@ expect(page).to have_content('checkbox 2') end end + + scenario 'Within (Page Footer): Elemental Selenium' do + within('div#page-footer.row') do + expect(page).to have_link('Elemental Selenium') + end + end end diff --git a/intro/spec/features/03_login_spec.rb b/intro/spec/features/03_login_spec.rb index c5a9ff8..830defe 100644 --- a/intro/spec/features/03_login_spec.rb +++ b/intro/spec/features/03_login_spec.rb @@ -56,9 +56,11 @@ end scenario 'tomsmith / SuperSecretPassword!' do + success_message = 'You logged into a secure area!' fill_in('Username', with: 'tomsmith') fill_in('Password', with: 'SuperSecretPassword!') click_button('Login') expect(page).to have_css('h2', text: 'Secure Area') + expect(page).to have_css('div.flash', text: success_message) end end diff --git a/intro/spec/features/06_slow_loading_spec.rb b/intro/spec/features/06_slow_loading_spec.rb index 6b7b71f..d77525f 100644 --- a/intro/spec/features/06_slow_loading_spec.rb +++ b/intro/spec/features/06_slow_loading_spec.rb @@ -14,16 +14,36 @@ end end + +# Wait controlled by SPEC_HELPER: Capybara.default_max_wait_time = 30 +# See https://github.com/teamcapybara/capybara#asynchronous-javascript-ajax-and-friends + feature 'Checking Slow Loading Components' do background do visit 'dynamic_loading/1' end -# Wait controlled by SPEC_HELPER: Capybara.default_max_wait_time = 30 -# See https://github.com/teamcapybara/capybara#asynchronous-javascript-ajax-and-friends + scenario 'Title: Example 1' do + expect(page).to have_css('h4', text: 'Example 1: Element on page that is hidden') + end scenario 'Page Should Wait For Hello World' do click_button('Start') expect(page).to have_content('Hello World!') end end + +feature 'Checking Components Loaded Later' do + background do + visit 'dynamic_loading/2' + end + + scenario 'Title: Example 2' do + expect(page).to have_css('h4', text: 'Example 2: Element rendered after the fact') + end + + scenario 'Page Should wait for Hello World!' do + click_button('Start') + expect(page).to have_content('Hello World!') + end +end \ No newline at end of file diff --git a/intro/spec/features/07_javascript_alerts_spec.rb b/intro/spec/features/07_javascript_alerts_spec.rb index b070fbb..cbc4ae5 100644 --- a/intro/spec/features/07_javascript_alerts_spec.rb +++ b/intro/spec/features/07_javascript_alerts_spec.rb @@ -31,7 +31,7 @@ accept_alert do click_button('Click for JS Alert') end - expect(page).to have_content('You successfuly clicked an alert') + expect(page).to have_content('You successfully clicked an alert') end scenario 'JS Confirm: Dismiss Alert, Select [Cancel] => Message: You clicked: Cancel' do @@ -48,4 +48,19 @@ expect(message).to eq('I am a JS Confirm') expect(page).to have_content('You clicked: Ok') end + + scenario 'JS Prompt: Dismiss' do + dismiss_confirm do + click_button('Click for JS Prompt') + end + expect(page).to have_content('You entered: null') + end + + scenario 'JS Prompt: Enter prompt and accept' do + message = accept_prompt(with: 'Hello') do + click_button('Click for JS Prompt') + end + expect(message).to eq('I am a JS prompt') + expect(page).to have_content('You entered: Hello') + end end diff --git a/intro/spec/spec_helper.rb b/intro/spec/spec_helper.rb index 704d0cd..24cbd0d 100644 --- a/intro/spec/spec_helper.rb +++ b/intro/spec/spec_helper.rb @@ -3,6 +3,7 @@ require 'bundler' require 'capybara/dsl' require 'capybara/rspec' +#require 'capybara/rails' #add this if the application being tested is a rails app Bundler.setup(:default) Bundler.require @@ -10,11 +11,14 @@ # Which default browser do you want Selenium WebDriver to use? # :selenium_chrome # Selenium driving Chrome # :selenium_chrome_headless # Selenium driving Chrome in a headless configuration +# :selenium # Selenium driving firefox +# :selenium_headless #selenium driving Firefox in a headless configuration # https://github.com/teamcapybara/capybara#selenium -Capybara.default_driver = :selenium_chrome +Capybara.default_driver = :selenium Capybara.app_host = 'https://the-internet.herokuapp.com' Capybara.default_max_wait_time = 10 +# Capybara.default_max_wait_time = 30 # Run using: # bundle exec rspec spec/features/login.rb --format documentation