CSC/ECE 517 Fall 2015 E1581 Integration testing for student interface: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 126: Line 126:
*Github repository:  https://github.com/xhy279/expertiza/tree/fall2015/spec/features
*Github repository:  https://github.com/xhy279/expertiza/tree/fall2015/spec/features
*Demo videos(4 in total): 1. https://drive.google.com/open?id=0B3EOsci5DEveMGZOdVNIazJlNVE
*Demo videos(4 in total): 1. https://drive.google.com/open?id=0B3EOsci5DEveMGZOdVNIazJlNVE
4.

Revision as of 23:32, 4 December 2015

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.

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.

We have test file "student_sign_in.rb" do this task. Run test using 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.

We have "add_member_spec.rb" to do this task. 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 

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 

Bring up a review form

Repeated for an assignment without a topic and an assignment with 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 'Begin'
  5. 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.

  1. sign in.  
  2. click the link for the assignment we want to review.
  3. click the link for “other’s work”
  4. open a review form
  5. fill out all text fields
  6. select all scores from dropdowns
  7. submit form
  8. check for successful save
  • Scenario 2:
  1. open a review form
  2. sign in.  
  3. click the link for the assignment we want to review.
  4. click the link for “other’s work”
  5. fill out some text fields
  6. select some scores
  7. save form
  8. reopen form
  9. fill out remaining fields and scores
  10. save form
  11. check for successful save

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.

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. Sign out
  9. Sign in as reviewer
  10. Click link for Assignment
  11. Click ‘Other’s work’
  12. Check that a feedback exists.

Links

4.