User:Darshna1993/sandbox

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.

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:
 * 1) rspec-core
 * 2) rspec-expectations
 * 3) rspec-mocks
 * 4) 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
This project is to write RSpec tests to test functionality of Staggered deadline in Expertiza using Capybara. The procedures to be tested are:
 * Create an assignment.
 * Submit a topic.
 * Change a topic deadline.
 * View topic stage.
 * Submit reviews.

Test Plan
Our test plan is divided into the following steps:
 * 1) Create an assignment: Create an assignment with topic with varying rubric by round feature.
 * 2) Add participants to newly created assignment.
 * 3) Submit a Topic: Impersonate each participant, choose a topic and submit something.
 * 4) 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)
 * 5) View topic stage: Impersonate each participant and check their topic’s current stage on student_task#list view.
 * 6) 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.

Create an Assignment:
After returning, the assignment created is listed under 'Assignments' tab.
 * 1) Login as instructor 'instructor6'
 * 2) Click on 'Create public assignment'.
 * 3) Fill in the textboxes with assignment name, and assignment directory and other necessary details.
 * 4) Click the 'Create' button.
 * 5) Click on the link 'Rubrics'.
 * 6) Check the box 'Review rubric varies by round?'.
 * 7) Click on 'Save'.
 * 8) Click the link 'Topics'.
 * 9) Click on 'New topic'
 * 10) Fill in the Topic id, Topic name,Topic category and Number of slots.
 * 11) Click 'Create'.

Add Participants to Newly Created Assignment:

 * 1) Create a new assignment 'Assignment1665' using factories, with two review rounds and Staggered Deadline enabled.
 * 2) Added three participants to the newly created assignment using factories.

Submit a topic:
On clicking the 'upload' button, the submitted link is displayed on the page.
 * 1) Create a stub to Impersonate the student 'student2064'.
 * 2) Click on 'Assignment1665' from the task list.
 * 3) Click on ‘Your Work’.
 * 4) Fill in the textbox with the submission link.
 * 5) Click on ‘upload link’

Change Topic Deadline:
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
 * 1) Create an assignment 'Assignment1665' using factories, with two rounds of reviews, and the staggered deadline functionality enabled.
 * 2) Create different types of deadlines with names 'submission', 'review', 'metareview', 'drop_topic', 'signup' and 'team_formation'.
 * 3) Create two topics 'Topic_1' and 'Topic_2' under 'Assignment1665' using factories.
 * 4) Create assignment due dates for 'submission' and 'review' for two rounds using factories.
 * 5) Set the topic due dates to corresponding assignment due dates using factories.
 * 6) Change the different deadlines of one topic to different dates.

View Topic Stages:

 * 1) 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.
 * 2) Impersonate a participant 'student2064' using a stub.
 * 3) Click on 'Assignments' tab on top of the page.
 * 4) The page should display the current stage of 'Assignment1665' as 'Review'
 * 5) Impersonate 'student2065' using a stub.
 * 6) Click on 'Assignments' tab on top of the page.
 * 7) The page should display the current stage of 'Assignment1665' as 'Submission'

Submit Review:
On returning, the reviewer should be able to see the 'View' option for the reviews done.
 * 1) Impersonate 'student2064' using a stub.
 * 2) Click on the link 'Assignment1665'.
 * 3) Click on the link 'Others' work'.
 * 4) Select a topic to be reviewed.
 * 5) Click on the link 'Begin'.
 * 6) The student can see 'Questionnare1' for the review round 1.
 * 7) Fill in the response checkboxes.
 * 8) Click the button 'Save Review'.

Execution
The command used to execute the RSpec test was 'rspec /spec/features/staggered_deadline_spec.rb'.