CSC/ECE 517 Fall 2016/E1665. Test staggered-deadline functionality
Introduction
Expertiza is a web application which enables students to choose a topic in an assignment, submit assignments and peer review others' work. This application also allows the instructors to add assignments to a course, and create multiple topics with varying rubrics and different deadlines for an assignment.The Expertiza project is developed on Open Source Software (OSS) and is supported by the National Science Foundation.
Background
Rspec
Rspec is a behavior-driven development tool for Ruby programmers which helps write human readable specifications that direct and validate the development of an application. RSpec is composed of multiple libraries which can be used together or independently with other testing tools like Capybara and Cucumber. There are four parts of RSpec. They are:
- rspec-core
- rspec-expectations
- rspec-mocks
- rspec-rails
Capybara
Capybara is a web-based test automation software that simulates scenarios for user stories. It can automate web application testing for behavior-driven software development (BDD). It is a gem that can be used on top of a web-based driver. It offers a user-friendly domain specific language to describe a sequence of actions executed by the web driver. It is a part of the Cucumber testing framework.
It is supported by the following web-based drivers:
- RackTest
- Selenium
- Capybara-webkit
Functional Testing
Functional testing is a type of black-box testing used in quality assurance, Functional tests are done by feeding the inputs and checking the outputs giving least importance to the internal structure of the program. It describes what the system does. Functional testing verifies a program by checking it against the specification documents. There are different types of functional testing:
- Smoke testing
- Sanity testing
- Regression testing
- Usability testing
Project Description and Test Strategy
Staggered deadline means having different deadlines for different topics under the same assignment. This is a relatively new feature of Expertiza. Deadline of different topics under the same assignment may need to be different for reasons like dependency of one topic on another. The aim of this project is to write RSpec tests to test the functionality of staggered deadline using Capybara. According to the instruction, we design 3 test cases:
Initial state: Two students with different topics submit their work before the assignment's submission deadline in round 1.
Scenario 1: Change deadline of topic 1 to bring it into review stage in round 1, check if the student assigned with topic 1 can review others' work, check if the rubrics are right for round 1.
Scenario 2: Change the deadlines of both the topics to bring them into review stage in round 2, check if the students assigned with these topics can review each other's work, check if the rubrics are right for round 2.
Scenario 3: Change the deadline of both the topic to bring them into finish stage in round 2, check that the students assigned with these topics are unable to review each other.
Test Steps in UI
Our test plan is divided into the following steps:
- Create an assignment: Create an assignment with topic with varying rubric by round feature.
- Add participants to newly created assignment.
- Submit a Topic: Impersonate each participant, choose a topic and submit something.
- Change topic Deadline: Change deadline of each topic and let each topic be in different stages (like submission round 1, review round 1, submission round 2 and review round 2)
- View topic stage: Impersonate each participant and check their topic’s current stage on student_task#list view.
- Submit reviews: Participant with topic in review stage can review other participant’s work, ensuring that right rubrics are used for different topics.The reviewers can fill in the rubrics, save and submit their reviews successfully.
In order to test using the UI, type the following commands to start the server:
git clone https://github.com/517OSS/expertiza.git bundle install rake db:migrate rails s
Once the Expertiza website is up, test the following:
Create an Assignment:
- Login as instructor 'instructor6'
- Click on 'Create public assignment'.
- Fill in the textboxes with assignment name, and assignment directory and other necessary details.
- Click the 'Create' button.
- Click on the link 'Rubrics'.
- Check the box 'Review rubric varies by round?'.
- Click on 'Save'.
- Click the link 'Topics'.
- Click on 'New topic'
- Fill in the Topic id, Topic name,Topic category and Number of slots.
- Click 'Create'.
After returning, the assignment created is listed under 'Assignments' tab.
Add Participants to Newly Created Assignment:
- Create a new assignment 'Assignment1665' using factories, with two review rounds and Staggered Deadline enabled.
- Added three participants to the newly created assignment using factories.
Submit a topic:
- Create a stub to Impersonate the student 'student2064'.
- Click on 'Assignment1665' from the task list.
- Click on ‘Your Work’.
- Fill in the textbox with the submission link.
- Click on ‘upload link’
On clicking the 'upload' button, the submitted link is displayed on the page.
Change Topic Deadline:
- Create an assignment 'Assignment1665' using factories, with two rounds of reviews, and the staggered deadline functionality enabled.
- Create different types of deadlines with names 'submission', 'review', 'metareview', 'drop_topic', 'signup' and 'team_formation'.
- Create two topics 'Topic_1' and 'Topic_2' under 'Assignment1665' using factories.
- Create assignment due dates for 'submission' and 'review' for two rounds using factories.
- Set the topic due dates to corresponding assignment due dates using factories.
- Change the different deadlines of one topic to different dates.
On returning, click on 'Assignments' tab, and click on 'Edit' under 'Actions'. Click on the 'Topics' tab and then click the link 'Show start/due dates'. The instructor should be able to see the changed due dates for each of the topics
View Topic Stages:
- Change the deadline date of topic assigned to 'student2064' to a past date and change deadline date of topic assigned to 'student2065' to a future date.
- Impersonate a participant 'student2064' using a stub.
- Click on 'Assignments' tab on top of the page.
- The page should display the current stage of 'Assignment1665' as 'Review'
- Impersonate 'student2065' using a stub.
- Click on 'Assignments' tab on top of the page.
- The page should display the current stage of 'Assignment1665' as 'Submission'
Submit Review:
- Impersonate 'student2064' using a stub.
- Click on the link 'Assignment1665'.
- Click on the link 'Others' work'.
- Select a topic to be reviewed.
- Click on the link 'Begin'.
- The student can see 'Questionnare1' for the review round 1.
- Fill in the response checkboxes.
- Click the button 'Save Review'.
On returning, the reviewer should be able to see the 'View' option for the reviews done.
Running Tests From Terminal
The test file we added is 'staggered_deadline_spec.rb'. Once the server is running, open a new terminal, navigate the cloned 'expertiza' folder. The tests can be run in the terminal using the command:
rspec /spec/features/staggered_deadline_spec.rb
Here is the result: