CSC/ECE 517 Spring 2016 E1624 Compose functional tests for Suggest topics of student functionality: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 22: Line 22:


==Design of solution==
==Design of solution==
To test the functionality of student's suggest topic, we plan to use Capybara to write the test code for each step listed below with branches for all three different cases.
To test the functionality of student's suggest topic, we plan to use Capybara to write the test code for each step listed below, covering all three scenarios.
(We wish to add some UI screenshots for each step, for better illustration, but seems the file upload function of this expertiza wiki is available for student user level so far.)
(We wish to add some UI screenshots for each step, for better illustration, but seems the file upload function of this expertiza wiki is available for student user level so far.)
===Flow of suggest topic function===
===Flow of suggest topic function===
Line 34: Line 34:
In this step, we need to write two functional tests: one is to check whether the course can be added and does the added one have topic suggestion enabled, the other one is to check whether the topic is added.
In this step, we need to write two functional tests: one is to check whether the course can be added and does the added one have topic suggestion enabled, the other one is to check whether the topic is added.
====Step 2 Add student to the course====
====Step 2 Add student to the course====
After the course is added, the student ("student11" for this test project) will be added by clicking the '''Add participants''' action to the course.  
After the course is added, the student (''student11'' for this test project) will be added by clicking the '''Add participants''' action to the course.  
Enter "student11" with the "participant" choice selected then click "add" button.
Enter "student11" with the "participant" choice selected then click "add" button.
In this step, we need to test whether the student, named "student11", is added to the course correctly.
In this step, we need to test whether the student, named ''student11'', is added to the course correctly.
====Step 3 Use student to suggest a new topic====
====Step 3.1 Use student to suggest a new topic without holding any topic====
No matter whether the student is already
====Step 3.2 Use student to suggest a new topic holding a topic and wish to switch ====
====Step 3.3 Use student to suggest a new topic holding a topic and do NOT wish to switch ====
====Step 4 Approve the suggested topic====
====Step 5.1 Student did not holding any topic before suggestion====
====Step 5.1 Student held a topic and wish to switch to new suggested topic====
====Step 5.1 Student held a topic but NOT wish to switch to new suggested topic====

Revision as of 17:32, 4 April 2016

This wiki page is for the description of changes made under E1624 Final project design assignment for Spring 2016, CSC/ECE 517.


Problem Statement

What it does

Suggested topic functionality is designed for students to suggest topics they interested in. An assignment can be set up to allow students to suggest topics at the discretion of the instructor. Then, students can suggest topics, and add related descriptions. The proposer can state that (s)he wants to work on the suggested topic. When the instructor approves a suggested topic, if the proposer wanted to work on it, it is assigned to the proposer. Otherwise, it is placed on the signup sheet for anyone to reserve. The purpose of suggested topic is to make the writing assignment more personalized.

What’s wrong with it

Currently, there is no functional test for student's topic suggestion function.

What needs to be done

  • Understand the flow of the suggested topic function.
  • Do not use the development DB, otherwise your tests will not pass on TravisCI.
  • Create RSpec file in /spec/features/ folder.
  • Use fixtures to create the assignment record and any other records such as participant records in test DB.
  • Use Capybara to write functional tests for these three scenarios.
    • One team is on the waitlist. They sent a suggestion for new topic and they want to choose their suggested topic. After their suggested topic is approved, they should leave the waitlist and hold their suggested topic;
    • One team is holding a topic. They sent a suggestion for new topic and they want to choose their suggested topic. After their suggested topic is approved and they choose to switch to suggested topic, they will hold suggested topic and their old topic will be released. And if another team is in waitlist of that old topic, that team should hold the old topic now;
    • One team is holding a topic. They sent a suggestion for new topic and they do not want to work on their suggested topic. After their suggested topic is approved and they choose to public suggested topic, they will still hold their old topic. Their suggested topic will be added in sign-up sheet.
  • Create multiple tests to check valid and invalid cases.


Design of solution

To test the functionality of student's suggest topic, we plan to use Capybara to write the test code for each step listed below, covering all three scenarios. (We wish to add some UI screenshots for each step, for better illustration, but seems the file upload function of this expertiza wiki is available for student user level so far.)

Flow of suggest topic function

Step 1 Use instructor to add a course with topic suggestion enabled

First step is to login with the instructor account (instructor6 here), and then create a course by clicking the "New public assignment" button. After the name and type of the course are specified, by clicking the "create" button, the assignment edit page will show up automatically. The key thing here is to click the "Topics" button and select the "Allow topic suggestions from students?" checkbox. Also, to test the second and third scenarios that the student already hold a topic, a "New topic" is need to be added. After all above are done, it is time to click the "save" button.

In this step, we need to write two functional tests: one is to check whether the course can be added and does the added one have topic suggestion enabled, the other one is to check whether the topic is added.

Step 2 Add student to the course

After the course is added, the student (student11 for this test project) will be added by clicking the Add participants action to the course. Enter "student11" with the "participant" choice selected then click "add" button. In this step, we need to test whether the student, named student11, is added to the course correctly.

Step 3.1 Use student to suggest a new topic without holding any topic

Step 3.2 Use student to suggest a new topic holding a topic and wish to switch

Step 3.3 Use student to suggest a new topic holding a topic and do NOT wish to switch

Step 4 Approve the suggested topic

Step 5.1 Student did not holding any topic before suggestion

Step 5.1 Student held a topic and wish to switch to new suggested topic

Step 5.1 Student held a topic but NOT wish to switch to new suggested topic