Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Ruby hỗ trợ kế thừa (inheritance) với dynamic dispatch, mixin và singleton method (thuộc về, và để định nghĩa cho, một instance đơn hơn là định nghĩa dành cho lớp). Mặc dù Ruby không hỗ trợ đa kế thừa, các lớp vẫn có thể được đưa vào các module dưới dạng các mixins. | Black-Box Testing with Selenium 193 details of how the controllers and views work. These tests are covered in detail in Chapter 7 Testing on page 198. The opposite of white-box test is a black-box test. In black-box testing the tests have no awareness of the internal workings of the program being tested. Black-box tests are often performed jointly by the developers and consumers of a system. when used in this way black-box tests are acceptance tests. Acceptance tests are quite literally the mea- acceptance tests sure of success of a system. Since acceptance tests know nothing of implementation details acceptance testing tools are not specific to any language or library. We build acceptance tests for web applications with the open source tool Sele-nium.7 Testing a Rails application with Selenium usually involves three separate libraries Selenium Core is the underlying Selenium engine. Selenium Core can run tests on about a dozen different browser platforms. The Selenium IDE is a Firefox extension for recording tests. Tests recorded in the Selenium IDE can then be run on other browers using Selenium Core. Selenium on Rails is a Rails plugin that provides a Ruby-based library for invoking Selenium. For substantial tests this library is easier to work with than the test format produced by the Selenium IDE. To see these libraries in action follow the instructions on the Selenium home page for installing Selenium Core and the Selenium IDE. We will use the Selenium IDE to record a test for the People application. 1. After installing Selenium IDE restart Firefox. 2. Run the People application against the test environment RAILS_ENV test script server 3. Open Firefox and navigate to the People index page people. 4. From the Firefox Tools menu select Selenium Recorder to turn on the Selenium Recorder. Resize the browser window and the recorder so you can see both. 7. http www.openqa.org selenium Black-Box Testing with Selenium 194 5. Click the New Person link to create a new