CSC/ECE 517 Fall 2015 E1581 Integration testing for student interface

From Expertiza_Wiki
Jump to navigation Jump to search

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

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.

Capybara is a web-based automation framework used for creating functional tests which can simulate how users would interact with your application.

Setup

In order to run these test successfully the test data must be inserted into the expertiza_test database. To add the test data to the database run this command: "mysql -u root -p -h localhost expertiza_test < spec/features/db/TestData.sql". You should now be able to run the integration tests.

Test Plan

There are 8 features to be tested:

  1. Log in
  2. Add someone to a team
  3. Select a topic(if the assignment has topics)
  4. Select a submission to review For assignments with or without topics
  5. Bring up a review form
  6. Fill out & submit a review form
  7. View your scores
  8. 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.

Run test using the command "rspec spec/features/student_sign_in_spec.rb"

Add someone to a team

  • Scenario 1: Team member exceed max amount
  1. Sign in 
  2. Click link certain assignment(in this test: Ethical analysis 2)
  3. Click link  “Your team” 
  4. Fill in the text area with invitation receiver name
  5. Click send invitation button
  6. Sign out.
  7. Sign in as receiver
  8. Click link assignment
  9. Click link  “Your team”
  10. Click  button ‘accept’

On this page, we expect the sender's name will appear.

Run test using the command "rspec spec/features/add_member_spec.rb "

Select a topic

Note: assignment has topics

We need the following steps:

  1. sign in. 
  2. click the link for assignment 
  3. click link  “signup sheet”
  4. click the sign up for the remaining topic we want, as this user has already signed up for this topic, we should get the following message: Your topic(s): Self-plagiarism. 
  5. sign out 

Run test using the command "rspec spec/features/select_a_topic_spec.rb "


Select a submission to review

  1. sign in.  
  2. click the link for the assignment we want to review.
  3. click the link for “other’s work”
  4. click the link for the submission we want to review
  5. sign out 

Run test using the command "rspec spec/features/select_a_submission_to_review_spec.rb "

Bring up a review form

  • Scenario 1: Choose a topic to review
  1. sign in.  
  2. click the link for the assignment we want to review.
  3. click the link for “other’s work”
  4. choose a topic
  5. click 'Begin'
  6. check that a review form has successfully been created
  • Scenario 2: Choose a random topic
  1. sign in.  
  2. click the link for the assignment we want to review.
  3. click the link for “other’s work”
  4. check 'I do not care'
  5. click 'Request new submission' button
  6. click 'Begin' to open review form
  7. check that a review form has successfully been created
  • Scenario 3: Review an assignment without a topic
  1. sign in.  
  2. click the link for the assignment we want to review.
  3. click the link for “other’s work”
  4. click 'Request new submission' button
  5. click 'Begin' to open review form
  6. check that a review form has successfully been created

Run test using the command "rspec spec/features/bring_up_review_form_spec.rb "

Fill out and submit a review form

  • Scenario 1: Fill out form and save
  1. sign in.  
  2. click the link for the assignment we want to review.
  3. click the link for “other’s work”
  4. click 'Begin'
  5. fill out all text fields
  6. save form
  7. check for successful save
  • Scenario 2: Fill out form, save, edit, and resave
  1. sign in.  
  2. click the link for the assignment we want to review.
  3. click the link for “other’s work”
  4. click 'Begin'
  5. fill out one text field
  6. save form
  7. click edit
  8. fill out other text fields
  9. click save
  10. check for successful save

Run test using the command "rspec spec/features/fill_out_review_form_spec.rb "

View your scores

  • Scenario 1: No Scores available yet
  1. Sign in
  2. Click link for Assignment
  3. Click ‘Your scores’
  4. Check that nothing exists yet
  5. Check for dashes.
  • Scenario 2: Scores available.
  1. Sign in
  2. Click link for Assignment
  3. Click ‘Your scores’
  4. Check that displayed scores match scores independently calculated from all reviews.

To run this test run: $ rspec spec/features/student_view_score.rb

Respond to a review (“author feedback”)

  1. Sign in as author
  2. Click link for Assignment
  3. Click ‘Your scores’
  4. Click ‘show reviews’
  5. Click ‘Give feedback’
  6. Fill out Feedback form
  7. Click Save Feedback
  8. Check for confirmation that the feedback was saved

To run this test run:$ rspec spec/features/review_feedback.rb

Links

1. https://drive.google.com/open?id=0B3EOsci5DEveMGZOdVNIazJlNVE
2. https://drive.google.com/a/ncsu.edu/file/d/0B-l-xu44qiJUZDRFMU02U09kZWs/view?usp=sharing
3. https://drive.google.com/a/ncsu.edu/file/d/0B80MLsKsoSOmaVV5Tm1mQWIwb0U/view?usp=sharing
4. https://drive.google.com/a/ncsu.edu/file/d/0B7dSj1bvwNp9X29TTHJMVFhPWkE/view?usp=sharing
Note: There is a problem at the end of the third video and the save can not complete because of a time out issue. This does not effect the test, just the ability to demonstrate the test.