오랫동안 오이와 우리 브래지어를 사용 해왔다. 이제는 AJAX 상호 작용을 포함하는 동작을 작성해야하므로 Webrat 용 Selenium 어댑터를 사용하려고 생각했습니다. 셀레늄 + webrat + 오이를 설치하고 구성하기위한 쉽고 업데이트 된 단계별 가이드를 알려줄 수 있습니까? 비 자바 스크립트 시나리오와 자바 스크립트 시나리오를 혼합 할 수 있기를 원합니다.Cucumber + Webrat + Selenium guide
12
A
답변
8
내 프로젝트에서 rspec과 함께 Selenium을 사용하고 Selenium IDE 용 사용자 정의 포매터에서 코드를 생성합니다.
레일에는 셀레늄이 많이 있지만 Selenium-RC http://seleniumhq.org/download/을 사용하면 성공하므로 PC에 다운로드하십시오.
- 의 압축을 풀고 실행> 자바 -jar 셀레늄 server.jar
- 당신이 성공을 얻을 것이다 셀레늄 - 클라이언트 루비의 문서를 읽고, 그 뒤에 열기 :
여기 내 단계입니다!
- 보석이 RSpec을 설치, RSpec에 레일 버전 1.2.6
- 보석 셀레늄 클라이언트 물론
- 열기 셀레늄-IDE (파이어 폭스 설치 (그렇지, 당신은 버전 셀레늄 클라이언트 소스 코드의 제한 언급 할 필요)) 열기 옵션 -> 옵션 -> 포맷 나를 위해 당신의 사양 폴더에
- 추가를 클릭하고 지금 http://www.techdarkside.com/rspec_export.txt
에서이 코드를 붙여 넣습니다, 당신은 단지 수출 사양, 내가 사용하는 사양/기능/xxxx_spec.rb 아래 코드를 참조하십시오.
매우 유사한 접근 방식은 최신 Rspec book는 당신이 필요로하는 모든를 제공합니다 webrat + 오이를 들어 here
에서 찾을 수 있습니다.
예 (그들은 아직 셀레늄 + 오이 장 마감이없는)
require 'rubygems'
gem "rspec", "=1.2.6"
gem "selenium-client", ">=1.2.15"
require "selenium/client"
require "selenium/rspec/spec_helper"
describe "Google Search" do
attr_reader :selenium_driver
alias :page :selenium_driver
before(:all) do
@selenium_driver = Selenium::Client::Driver.new \
:host => "localhost",
:port => 4444,
:browser => "*firefox",
:url => "http://www.google.com",
:timeout_in_second => 60
end
before(:each) do
selenium_driver.start_new_browser_session
end
# The system capture need to happen BEFORE closing the Selenium session
append_after(:each) do
@selenium_driver.close_current_browser_session
end
it "can find Selenium" do
page.open "/"
page.title.should eql("Google")
page.type "q", "Selenium seleniumhq"
page.click "btnG", :wait_for => :page
page.value("q").should eql("Selenium seleniumhq")
page.text?("seleniumhq.org").should be_true
page.title.should eql("Selenium seleniumhq - Google Search")
page.text?("seleniumhq.org").should be_true
page.element?("link=Cached").should be_true
end
end
관련 문제
- 1. Cucumber + webrat + selenium, 어떻게 숨겨진 텍스트를 무시하나요?
- 2. rails image_submit_tag with cucumber/webrat
- 3. Webrat Selenium : 브라우저 시작시 오류 발생 (Selenium :: CommandError)
- 4. Page Object 패턴을 Cucumber 및 Webrat/Selenium과 함께 사용하는 방법?
- 5. Cucumber + Selenium on javascript apps
- 6. Cucumber + Capybara + Selenium : 텍스트 선택
- 7. WebRat + Selenium WebDriver : ajax가 완료 될 때까지 기다림
- 8. 성가신 Webrat/Selenium 도메인 이름을 변경할 때의 경고
- 9. 오이, Webrat 및 Selenium 레일에 NoMethod 오류 3
- 10. 오이, Webrat 또는
- 11. Webrat/오이 Matcher를 - 링크
- 12. 는 잘 WebRat
- 13. webrat 설치시 오류가 발생했습니다.
- 14. Webkit Porting Guide
- 15. Cucumber Stories가있는 세션 변수
- 16. 게으름 피우는 "rake cucumber"
- 17. RSpec, webrat 및 이스케이프 문자
- 18. 스노우 레오파드 + 오이/webrat/rspec
- 19. Selenium 2는 Selenium 2를 지원합니까?
- 20. Rails3 + Cucumber + Factory_girl_rails + Authlogic 문제
- 21. cucumber & capybara로 액세스 제어 테스트하기
- 22. Cucumber, Capybara의 HTML 유효성 검사와 JavaScript 테스트가 모두 실패합니다.
- 23. Selenium RC에서 Selenium IDE 스크립트를 어떻게 실행합니까?
- 24. Selenium Api, Selenium locators and regex
- 25. Selenium Remote Control과 Selenium Server의 차이점은 무엇입니까?
- 26. Selenium Automation
- 27. 오이 webrat 두 번째 클릭 링크 삭제
- 28. 오이/Webrat : GET 요청에 params 제공
- 29. 레일 3 및 Webrat : 잘못된 리디렉션
- 30. 오이/Webrat : CSS 클래스의 링크를 따르십니까?