CSC/ECE 517 Fall 2015 E1581 Integration testing for student interface
Create integration tests for the student interface using capybara and rspec. Integration testing is the phase in software testing in which individual software modules are combined and tested as a group. It occurs after unit testing and before validation testing. Integration testing takes as its input modules that have been unit tested, groups them in larger aggregates, applies tests defined in an integration test plan to those aggregates, and delivers as its output the integrated system ready for system testing.
Design
To properly execute the integration tests we will write the test cases to mimic a user operating the system. We will create strong integration test cases to help ensure the outcome of application's student interface remains the same regardless of changes to its inner functionality. In an attempt to keep our tests DRY we will put common code in a support directory.
Testing tools
capybara (Hydrochoerus hydrochaeris) is a large rodent of the genus Hydrochoerus of which the only other extant member is lesser capybara (Hydrochoerus isthmius)1. Capybara is an integration testing tool for rack based web applications. It simulates how a user would interact with a website. It is a highly social species and can be found in groups as large as 100 individuals, but usually lives in groups of 10–20 individuals. The capybara is not a threatened species and is hunted for its meat, Hide (skin)|hide and also for a grease from its thick fatty skin which is used in the pharmaceutical trade.
RSpec is a behavior-driven development (BDD) framework for the Ruby (programming language)|Ruby programming language, inspired by JBehave. It contains its own mocking framework that is fully integrated into the framework based upon JMock. The framework can be considered a domain-specific language (DSL) and resembles a natural language specification.
Test Plan
There are 8 features to be tested:
- Log in
- Add someone to a team Should not be possible if you exceed the max # of team members)
- Select a topic(if the assignment has topics)
- Select a submission to review For assignments with or without topics
- Bring up a review form
- Fill out & submit a review form
- View your scores
- Respond to a review (“author feedback”)
Log in
we create a file called ‘student_signin_spec.rb’. We define a method named login; and because we need this method in every later feature test we will put this in the support directory.
- Scenario 1: Log in with ‘invalid combination of username and password’
When we sign in with correct name and password; we expect that there should be content ‘Invalid username/password’ appear in the new page.
- Scenario 2: Log in with ‘valid combination of username and password’
When we sign in with correct name and password; we expect that there should be content ‘User: (username)’ appear in the new page.
Add someone to a team
- Scenario 1: Team member exceed max amount
- Sign in
- Click link assignment
- Click link “Your team”
- Fill in the box with invitation receiver name and click button send invitation.
After doing these steps, we expect fault would happen. We could capture contents ‘Your team already has max members.’
- Scenario 2 : Team member don't exceed max amount
- Sign in
- Click link certain assignment
- Click link “Your team”
- Fill in the text area with invitation receiver name
- Click send invitation button
- Sign out.
- Sign in as receiver
- Click link assignment
- Click link “Your team”
- Click button ‘accept’
- Sign out.
- Sign in as the sender
- Click link certain assignment
- Click link “Your team”
On this page, we expect the receiver's name will appear.
Select a topic
Note: assignment has topics
We need the following steps:
- sign in.
- click the link for assignment
- click link “signup sheet”
- click the sign up for the remaining topic we want, or join the waiting list if the topic is not available.
- sign out
Select a submission to review
- sign in.
- click the link for the assignment we want to review.
- click the link for “other’s work”
- click the link for the submission we want to review
- fill in all the required forms, and then click “save” to save our review.
- sign out
Bring up a review form
Repeated for an assignment without a topic and an assignment with a topic
- Execute the ‘Request a new submission’ button action
- Check that a review form has successfully been created
Fill out and submit a review form
- Scenario 1:
Note: Do this for an assignment without a topic and an assignment with a topic.
- Open a review form
- Fill out all text fields
- Select all scores from dropdowns
- Submit form
- Check for successful save
- Scenario 2:
- Open a review form
- Fill out some text fields
- Select some scores
- Save form
- Reopen form
- Fill out remaining fields and scores
- Save form
- Check for successful save
View your scores
- Scenario 1: No Scores available yet
- Sign in
- Click link for Assignment
- Click ‘Your scores’
- Check that nothing exists yet
- Check for dashes.
- Scenario 2: Scores available.
- Sign in
- Click link for Assignment
- Click ‘Your scores’
- Check that displayed scores match scores independently calculated from all reviews.
Respond to a review (“author feedback”)
- Sign in as author
- Click link for Assignment
- Click ‘Your scores’
- Click ‘show reviews’
- Click ‘Give feedback’
- Fill out Feedback form
- Click Save Feedback
- Sign out
- Sign in as reviewer
- Click link for Assignment
- Click ‘Other’s work’
- Check that a feedback exists.