CSC/ECE 517 Fall 2016 E1684: Feature Test for Assignment Submission
Introduction to Expertiza
Expertiza is an open-source project on GitHub used by students to view/submit assignments and review others' work. Expertiza also provides tools to visualize the scores and gauge the improvements made during the course semester. It also facilitates and monitors team projects. It is targeted at educational and non-profit organizations.
Project Requirement
There should be a feature test for submission of the assignment by the student. Once the assignment is created by the instructor the only call to action for the student is assignment submission. The purpose of this project is to test whether the submission function could work properly under different scenarios:
- Upload valid link
- Upload invalid link
- Upload multiple links
- Upload empty link
- Upload file
Background
Travis CI
Travis CI is a hosted, distributed continuous integration service used to build and test software projects hosted at GitHub.
Configuration: Travis CI is configured by adding a file named .travis.yml, which is a YAML format text file, to the root directory of the repository. This file specifies the programming language used, the desired building and testing environment (including dependencies which must be installed before the software can be built and tested), and various other parameters.
Operation: When Travis CI has been activated for a given repository, GitHub will notify it whenever new commits are pushed to that repository or a pull request is submitted. It can also be configured to only run for specific branches, or branches whose names match a specific pattern. Travis CI will then check out the relevant branch and run the commands specified in .travis.yml, which usually build the software and run any automated tests. When that process has completed, Travis notifies the developer(s) in the way it has been configured to do so—for example, by sending an email containing the test results (showing success or failure), or by posting a message on an IRC channel. In the case of pull requests, the pull request will be annotated with the outcome and a link to the build log, using a GitHub integration.
Capybara
Capybara supports selenium-webdriver, which is mostly used in web-based automation frameworks. It supports JavaScript, can access HTTP resources outside of application, and can also be setup for testing in headless mode which is especially useful for CI scenarios.
Using Capybara with RSpec: Load RSpec 2.x support by adding the following line(typically to the spec_helper.rb file):
require 'capybara/rspec'
Approach
- First, using factories to create test data: create assignment, create topic, create participant.
- Mock the workflow of Assignment submission using Capybara.
- Check the result of the submission both from webpage and database.
In database level, the submission results are stored in table: TEAMS.
Workflow
Insert test database: create assignment, create topic, create participant.
Student login -> click on the assignment -> upload link or upload file