<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aajain2</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aajain2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Aajain2"/>
	<updated>2026-07-13T21:35:34Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1766_Test_team_functionality&amp;diff=110163</id>
		<title>CSC/ECE 517 Fall 2017/E1766 Test team functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1766_Test_team_functionality&amp;diff=110163"/>
		<updated>2017-10-27T22:03:55Z</updated>

		<summary type="html">&lt;p&gt;Aajain2: /* Result */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
Expertiza is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using Ruby on Rails framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
The purpose of this task is to write functional tests for team functionality. Once an assignment is out, a student can select this assignment and others can join in the team. To test this functionality we wrote functional tests for the various scenarios.&lt;br /&gt;
One such scenario is :&lt;br /&gt;
&lt;br /&gt;
* Once the assignment is out and a student selects it, he/she can send out invites to other students to join the team.&lt;br /&gt;
* Invited students can accept the invitation and join the team.&lt;br /&gt;
&lt;br /&gt;
== Functional Tests ==&lt;br /&gt;
&lt;br /&gt;
Functional tests ensure that the functionalities of a software system are working as expected. To write our functional tests, we used the Capybara gem available for Ruby.&lt;br /&gt;
Capybara gem allows a user to test their web application through simulations.&lt;br /&gt;
&lt;br /&gt;
== Functional Tests Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Functional Tests for Create group assignment ===&lt;br /&gt;
&lt;br /&gt;
In Expertiza instructor can create public assignment for particular course, define the required rubrics and add students to that assignment.&lt;br /&gt;
&lt;br /&gt;
The following test spec has been written to create public group assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create_new_assignment&lt;br /&gt;
  login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  visit &amp;quot;/assignments/new?private=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
  select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
  fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
  fill_in 'assignment_form_assignment_spec_location', with: 'testLocation'&lt;br /&gt;
  check(&amp;quot;assignment_form_assignment_microtask&amp;quot;)&lt;br /&gt;
  check(&amp;quot;team_assignment&amp;quot;)&lt;br /&gt;
  fill_in 'assignment_form_assignment_max_team_size', with: '3', visible: false&lt;br /&gt;
  check(&amp;quot;assignment_form_assignment_reviews_visible_to_all&amp;quot;)&lt;br /&gt;
  check(&amp;quot;assignment_form_assignment_is_calibrated&amp;quot;)&lt;br /&gt;
  check(&amp;quot;assignment_form_assignment_availability_flag&amp;quot;)&lt;br /&gt;
  expect(page).to have_select(&amp;quot;assignment_form[assignment][reputation_algorithm]&amp;quot;, options: ['--', 'Hamer', 'Lauw'])&lt;br /&gt;
&lt;br /&gt;
  click_button 'Create'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add topics to the assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_topic_to_assignment assignment&lt;br /&gt;
  visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
  click_link 'Topics'&lt;br /&gt;
  click_link 'New topic'&lt;br /&gt;
  fill_in 'topic_topic_identifier', with: '112'&lt;br /&gt;
  fill_in 'topic_topic_name', with: 'test_topic_1'&lt;br /&gt;
  fill_in 'topic_category', with: 'test_topic_1'&lt;br /&gt;
  fill_in 'topic_max_choosers', with: 3&lt;br /&gt;
  click_button 'Create'&lt;br /&gt;
  create(:assignment_due_date)&lt;br /&gt;
  create_list(:participant, 3)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional Tests for Log in as student and selecting a topic of assignment ===&lt;br /&gt;
&lt;br /&gt;
When student login into his Expertiza account, he can check for new assignment under &amp;quot;Assignments&amp;quot; tab and choose the topic of his interest. Student then can send invitation to other students who are also enrolled in same course.&lt;br /&gt;
We have written following test spec to impersonate as a student and select a topic&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;should impersonate as student&amp;quot; do&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    # Assignment name&lt;br /&gt;
    expect(page).to have_content('public assignment for test')&lt;br /&gt;
    click_link 'public assignment for test'&lt;br /&gt;
    expect(page).to have_content('Submit or Review work for public assignment for test')&lt;br /&gt;
&lt;br /&gt;
    click_link 'Signup sheet'&lt;br /&gt;
    expect(page).to have_content('Signup sheet for public assignment for test assignment')&lt;br /&gt;
    assignment_id = Assignment.first.id&lt;br /&gt;
    visit &amp;quot;/sign_up_sheet/sign_up?id=#{assignment_id}&amp;amp;topic_id=1&amp;quot;&lt;br /&gt;
    expect(page).to have_content('Your topic(s): test_topic_1') &lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sending invitations to other students&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link 'public assignment for test'&lt;br /&gt;
    click_link 'Your team'&lt;br /&gt;
    expect(page).to have_content('public assignment for test_Team1')&lt;br /&gt;
    fill_in 'user_name', with: 'student2065'&lt;br /&gt;
    click_button 'Invite'&lt;br /&gt;
    fill_in 'user_name', with: 'student2066'&lt;br /&gt;
    click_button 'Invite'&lt;br /&gt;
    expect(page).to have_content('student2065')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional Tests for accepting an invitation ===&lt;br /&gt;
&lt;br /&gt;
In Expertiza assignments, the only way for a student to join an existing team is to be invited by the leader.&lt;br /&gt;
&lt;br /&gt;
Following test spec has been written to accept the invitation to join the team and verify that the assignment topic is assigned to all users&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;joins the team&amp;quot; do&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2065&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    expect(page).to have_content('public assignment for test')&lt;br /&gt;
    visit '/invitation/accept?inv_id=1&amp;amp;student_id=1&amp;amp;team_id=1'&lt;br /&gt;
    visit '/student_teams/view?student_id=1'&lt;br /&gt;
    expect(page).to have_content('Team Information for public assignment for test')&lt;br /&gt;
&lt;br /&gt;
    # to test invalid case - student who is not part of the team does not have created assignment&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    page.should has_no_content?('public assignment for test')&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Functional Tests for whether students choosing the same topic are in the same team===&lt;br /&gt;
&lt;br /&gt;
Since the only way for students to be in a team is by invitation, students who choose the same topic will be in different team. Our test is to let two different students select the same topic and see if their teammates contains each other. Therefore, first we let ‘student2064’ and 'student2065' sign for the same topic, and in their pages, to see if there is 'student2065' or 'student2064'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      expect(page).to have_content &amp;quot;Team Name&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;student2065&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;student2064&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running the tests ==&lt;br /&gt;
&lt;br /&gt;
The tests can be run on the terminal by navigating to the /spec/features directory using the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 rspec team_functionalities_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whether the test fails or succeeds, allows us to determine which parts of the system are functioning properly.&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
Coverage increased (+0.3%) to 51.108% when pulling 4915488 on ankit13jain:master into 781e456 on expertiza:master.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# link for forked repository [[https://github.com/ankit13jain/expertiza]] &lt;br /&gt;
# Github link for original repository [[https://github.com/expertiza/expertiza.git]]&lt;br /&gt;
# Github link for Capybara [[https://github.com/jnicklas/capybara.git]]&lt;/div&gt;</summary>
		<author><name>Aajain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1766_Test_team_functionality&amp;diff=110160</id>
		<title>CSC/ECE 517 Fall 2017/E1766 Test team functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1766_Test_team_functionality&amp;diff=110160"/>
		<updated>2017-10-27T22:03:29Z</updated>

		<summary type="html">&lt;p&gt;Aajain2: /* Result */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
Expertiza is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using Ruby on Rails framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
The purpose of this task is to write functional tests for team functionality. Once an assignment is out, a student can select this assignment and others can join in the team. To test this functionality we wrote functional tests for the various scenarios.&lt;br /&gt;
One such scenario is :&lt;br /&gt;
&lt;br /&gt;
* Once the assignment is out and a student selects it, he/she can send out invites to other students to join the team.&lt;br /&gt;
* Invited students can accept the invitation and join the team.&lt;br /&gt;
&lt;br /&gt;
== Functional Tests ==&lt;br /&gt;
&lt;br /&gt;
Functional tests ensure that the functionalities of a software system are working as expected. To write our functional tests, we used the Capybara gem available for Ruby.&lt;br /&gt;
Capybara gem allows a user to test their web application through simulations.&lt;br /&gt;
&lt;br /&gt;
== Functional Tests Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Functional Tests for Create group assignment ===&lt;br /&gt;
&lt;br /&gt;
In Expertiza instructor can create public assignment for particular course, define the required rubrics and add students to that assignment.&lt;br /&gt;
&lt;br /&gt;
The following test spec has been written to create public group assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create_new_assignment&lt;br /&gt;
  login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  visit &amp;quot;/assignments/new?private=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
  select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
  fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
  fill_in 'assignment_form_assignment_spec_location', with: 'testLocation'&lt;br /&gt;
  check(&amp;quot;assignment_form_assignment_microtask&amp;quot;)&lt;br /&gt;
  check(&amp;quot;team_assignment&amp;quot;)&lt;br /&gt;
  fill_in 'assignment_form_assignment_max_team_size', with: '3', visible: false&lt;br /&gt;
  check(&amp;quot;assignment_form_assignment_reviews_visible_to_all&amp;quot;)&lt;br /&gt;
  check(&amp;quot;assignment_form_assignment_is_calibrated&amp;quot;)&lt;br /&gt;
  check(&amp;quot;assignment_form_assignment_availability_flag&amp;quot;)&lt;br /&gt;
  expect(page).to have_select(&amp;quot;assignment_form[assignment][reputation_algorithm]&amp;quot;, options: ['--', 'Hamer', 'Lauw'])&lt;br /&gt;
&lt;br /&gt;
  click_button 'Create'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add topics to the assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_topic_to_assignment assignment&lt;br /&gt;
  visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
  click_link 'Topics'&lt;br /&gt;
  click_link 'New topic'&lt;br /&gt;
  fill_in 'topic_topic_identifier', with: '112'&lt;br /&gt;
  fill_in 'topic_topic_name', with: 'test_topic_1'&lt;br /&gt;
  fill_in 'topic_category', with: 'test_topic_1'&lt;br /&gt;
  fill_in 'topic_max_choosers', with: 3&lt;br /&gt;
  click_button 'Create'&lt;br /&gt;
  create(:assignment_due_date)&lt;br /&gt;
  create_list(:participant, 3)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional Tests for Log in as student and selecting a topic of assignment ===&lt;br /&gt;
&lt;br /&gt;
When student login into his Expertiza account, he can check for new assignment under &amp;quot;Assignments&amp;quot; tab and choose the topic of his interest. Student then can send invitation to other students who are also enrolled in same course.&lt;br /&gt;
We have written following test spec to impersonate as a student and select a topic&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;should impersonate as student&amp;quot; do&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    # Assignment name&lt;br /&gt;
    expect(page).to have_content('public assignment for test')&lt;br /&gt;
    click_link 'public assignment for test'&lt;br /&gt;
    expect(page).to have_content('Submit or Review work for public assignment for test')&lt;br /&gt;
&lt;br /&gt;
    click_link 'Signup sheet'&lt;br /&gt;
    expect(page).to have_content('Signup sheet for public assignment for test assignment')&lt;br /&gt;
    assignment_id = Assignment.first.id&lt;br /&gt;
    visit &amp;quot;/sign_up_sheet/sign_up?id=#{assignment_id}&amp;amp;topic_id=1&amp;quot;&lt;br /&gt;
    expect(page).to have_content('Your topic(s): test_topic_1') &lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sending invitations to other students&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link 'public assignment for test'&lt;br /&gt;
    click_link 'Your team'&lt;br /&gt;
    expect(page).to have_content('public assignment for test_Team1')&lt;br /&gt;
    fill_in 'user_name', with: 'student2065'&lt;br /&gt;
    click_button 'Invite'&lt;br /&gt;
    fill_in 'user_name', with: 'student2066'&lt;br /&gt;
    click_button 'Invite'&lt;br /&gt;
    expect(page).to have_content('student2065')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional Tests for accepting an invitation ===&lt;br /&gt;
&lt;br /&gt;
In Expertiza assignments, the only way for a student to join an existing team is to be invited by the leader.&lt;br /&gt;
&lt;br /&gt;
Following test spec has been written to accept the invitation to join the team and verify that the assignment topic is assigned to all users&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;joins the team&amp;quot; do&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2065&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    expect(page).to have_content('public assignment for test')&lt;br /&gt;
    visit '/invitation/accept?inv_id=1&amp;amp;student_id=1&amp;amp;team_id=1'&lt;br /&gt;
    visit '/student_teams/view?student_id=1'&lt;br /&gt;
    expect(page).to have_content('Team Information for public assignment for test')&lt;br /&gt;
&lt;br /&gt;
    # to test invalid case - student who is not part of the team does not have created assignment&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    page.should has_no_content?('public assignment for test')&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Functional Tests for whether students choosing the same topic are in the same team===&lt;br /&gt;
&lt;br /&gt;
Since the only way for students to be in a team is by invitation, students who choose the same topic will be in different team. Our test is to let two different students select the same topic and see if their teammates contains each other. Therefore, first we let ‘student2064’ and 'student2065' sign for the same topic, and in their pages, to see if there is 'student2065' or 'student2064'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      expect(page).to have_content &amp;quot;Team Name&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;student2065&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;student2064&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running the tests ==&lt;br /&gt;
&lt;br /&gt;
The tests can be run on the terminal by navigating to the /spec/features directory using the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 rspec team_functionalities_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whether the test fails or succeeds, allows us to determine which parts of the system are functioning properly.&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
Coverage increased (+0.3%) to 51.108% when pulling 46e4529 on ankit13jain:master into 781e456 on expertiza:master.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# link for forked repository [[https://github.com/ankit13jain/expertiza]] &lt;br /&gt;
# Github link for original repository [[https://github.com/expertiza/expertiza.git]]&lt;br /&gt;
# Github link for Capybara [[https://github.com/jnicklas/capybara.git]]&lt;/div&gt;</summary>
		<author><name>Aajain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1766_Test_team_functionality&amp;diff=110158</id>
		<title>CSC/ECE 517 Fall 2017/E1766 Test team functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1766_Test_team_functionality&amp;diff=110158"/>
		<updated>2017-10-27T22:02:42Z</updated>

		<summary type="html">&lt;p&gt;Aajain2: /* Result */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
Expertiza is a peer review based system which provides incremental learning from the class. This project has been developed together by faculty and students using Ruby on Rails framework. Expertiza allows the instructor to create, edit and delete assignments, create new assignment topics, assign them to a particular class or selected students, have students work on teams and then review each other's assignments at the end. For the students, they can signup for topics, form teams, and submit their projects and assignments. Students then review the work done by other students and give suggestions to improve. Teams after reviews are allotted scores and they can refer to the peer comments to further improve their work. It also supports submission of different file types for assignments, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
The purpose of this task is to write functional tests for team functionality. Once an assignment is out, a student can select this assignment and others can join in the team. To test this functionality we wrote functional tests for the various scenarios.&lt;br /&gt;
One such scenario is :&lt;br /&gt;
&lt;br /&gt;
* Once the assignment is out and a student selects it, he/she can send out invites to other students to join the team.&lt;br /&gt;
* Invited students can accept the invitation and join the team.&lt;br /&gt;
&lt;br /&gt;
== Functional Tests ==&lt;br /&gt;
&lt;br /&gt;
Functional tests ensure that the functionalities of a software system are working as expected. To write our functional tests, we used the Capybara gem available for Ruby.&lt;br /&gt;
Capybara gem allows a user to test their web application through simulations.&lt;br /&gt;
&lt;br /&gt;
== Functional Tests Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Functional Tests for Create group assignment ===&lt;br /&gt;
&lt;br /&gt;
In Expertiza instructor can create public assignment for particular course, define the required rubrics and add students to that assignment.&lt;br /&gt;
&lt;br /&gt;
The following test spec has been written to create public group assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create_new_assignment&lt;br /&gt;
  login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  visit &amp;quot;/assignments/new?private=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
  select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
  fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
  fill_in 'assignment_form_assignment_spec_location', with: 'testLocation'&lt;br /&gt;
  check(&amp;quot;assignment_form_assignment_microtask&amp;quot;)&lt;br /&gt;
  check(&amp;quot;team_assignment&amp;quot;)&lt;br /&gt;
  fill_in 'assignment_form_assignment_max_team_size', with: '3', visible: false&lt;br /&gt;
  check(&amp;quot;assignment_form_assignment_reviews_visible_to_all&amp;quot;)&lt;br /&gt;
  check(&amp;quot;assignment_form_assignment_is_calibrated&amp;quot;)&lt;br /&gt;
  check(&amp;quot;assignment_form_assignment_availability_flag&amp;quot;)&lt;br /&gt;
  expect(page).to have_select(&amp;quot;assignment_form[assignment][reputation_algorithm]&amp;quot;, options: ['--', 'Hamer', 'Lauw'])&lt;br /&gt;
&lt;br /&gt;
  click_button 'Create'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add topics to the assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_topic_to_assignment assignment&lt;br /&gt;
  visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
  click_link 'Topics'&lt;br /&gt;
  click_link 'New topic'&lt;br /&gt;
  fill_in 'topic_topic_identifier', with: '112'&lt;br /&gt;
  fill_in 'topic_topic_name', with: 'test_topic_1'&lt;br /&gt;
  fill_in 'topic_category', with: 'test_topic_1'&lt;br /&gt;
  fill_in 'topic_max_choosers', with: 3&lt;br /&gt;
  click_button 'Create'&lt;br /&gt;
  create(:assignment_due_date)&lt;br /&gt;
  create_list(:participant, 3)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional Tests for Log in as student and selecting a topic of assignment ===&lt;br /&gt;
&lt;br /&gt;
When student login into his Expertiza account, he can check for new assignment under &amp;quot;Assignments&amp;quot; tab and choose the topic of his interest. Student then can send invitation to other students who are also enrolled in same course.&lt;br /&gt;
We have written following test spec to impersonate as a student and select a topic&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;should impersonate as student&amp;quot; do&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    # Assignment name&lt;br /&gt;
    expect(page).to have_content('public assignment for test')&lt;br /&gt;
    click_link 'public assignment for test'&lt;br /&gt;
    expect(page).to have_content('Submit or Review work for public assignment for test')&lt;br /&gt;
&lt;br /&gt;
    click_link 'Signup sheet'&lt;br /&gt;
    expect(page).to have_content('Signup sheet for public assignment for test assignment')&lt;br /&gt;
    assignment_id = Assignment.first.id&lt;br /&gt;
    visit &amp;quot;/sign_up_sheet/sign_up?id=#{assignment_id}&amp;amp;topic_id=1&amp;quot;&lt;br /&gt;
    expect(page).to have_content('Your topic(s): test_topic_1') &lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sending invitations to other students&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link 'public assignment for test'&lt;br /&gt;
    click_link 'Your team'&lt;br /&gt;
    expect(page).to have_content('public assignment for test_Team1')&lt;br /&gt;
    fill_in 'user_name', with: 'student2065'&lt;br /&gt;
    click_button 'Invite'&lt;br /&gt;
    fill_in 'user_name', with: 'student2066'&lt;br /&gt;
    click_button 'Invite'&lt;br /&gt;
    expect(page).to have_content('student2065')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional Tests for accepting an invitation ===&lt;br /&gt;
&lt;br /&gt;
In Expertiza assignments, the only way for a student to join an existing team is to be invited by the leader.&lt;br /&gt;
&lt;br /&gt;
Following test spec has been written to accept the invitation to join the team and verify that the assignment topic is assigned to all users&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;joins the team&amp;quot; do&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2065&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    expect(page).to have_content('public assignment for test')&lt;br /&gt;
    visit '/invitation/accept?inv_id=1&amp;amp;student_id=1&amp;amp;team_id=1'&lt;br /&gt;
    visit '/student_teams/view?student_id=1'&lt;br /&gt;
    expect(page).to have_content('Team Information for public assignment for test')&lt;br /&gt;
&lt;br /&gt;
    # to test invalid case - student who is not part of the team does not have created assignment&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    page.should has_no_content?('public assignment for test')&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Functional Tests for whether students choosing the same topic are in the same team===&lt;br /&gt;
&lt;br /&gt;
Since the only way for students to be in a team is by invitation, students who choose the same topic will be in different team. Our test is to let two different students select the same topic and see if their teammates contains each other. Therefore, first we let ‘student2064’ and 'student2065' sign for the same topic, and in their pages, to see if there is 'student2065' or 'student2064'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      expect(page).to have_content &amp;quot;Team Name&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;student2065&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;student2064&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running the tests ==&lt;br /&gt;
&lt;br /&gt;
The tests can be run on the terminal by navigating to the /spec/features directory using the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 rspec team_functionalities_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whether the test fails or succeeds, allows us to determine which parts of the system are functioning properly.&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
Coverage increased (+0.3%) to 51.086% when pulling 46e4529 on ankit13jain:master into 781e456 on expertiza:master.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# link for forked repository [[https://github.com/ankit13jain/expertiza]] &lt;br /&gt;
# Github link for original repository [[https://github.com/expertiza/expertiza.git]]&lt;br /&gt;
# Github link for Capybara [[https://github.com/jnicklas/capybara.git]]&lt;/div&gt;</summary>
		<author><name>Aajain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1766_Test_team_functionality&amp;diff=110042</id>
		<title>CSC/ECE 517 Fall 2017/E1766 Test team functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1766_Test_team_functionality&amp;diff=110042"/>
		<updated>2017-10-27T18:47:56Z</updated>

		<summary type="html">&lt;p&gt;Aajain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
Expertiza is an open source web based peer review system developed and maintained by students and faculty at North Carolina State University. It enables students enrolled in a particular course to form online teams and complete assignments. A typical cycle of an assignment involves the following major steps:&lt;br /&gt;
&lt;br /&gt;
* A pool of topics is made available to the students to choose from and form team to complete it within a pre-set deadline.&lt;br /&gt;
* After the development phase is finished, begins the peer review phase. Here students can review work of other teams, on the basis of some predefined factors and provide their feedback.&lt;br /&gt;
* Members of a team can also provide feedback for the respective review done for their work.&lt;br /&gt;
* In some projects there is a second development phase which allows team members to improve upon their work keeping past reviews in consideration.&lt;br /&gt;
* After this second development cycle begins another review phase, where original reviewers can re-review the updated work and provide critical feedback. &lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
The purpose of this task is to write functional tests for team functionality. Once an assignment is out, a student can select this assignment and others can join in the team. To test this functionality we wrote functional tests for the various scenarios.&lt;br /&gt;
One such scenario is :&lt;br /&gt;
&lt;br /&gt;
* Once the assignment is out and a student selects it, he/she can send out invites to other students to join the team.&lt;br /&gt;
* Invited students can accept the invitation and join the team.&lt;br /&gt;
&lt;br /&gt;
== Functional Tests ==&lt;br /&gt;
&lt;br /&gt;
Functional tests ensure that the functionalities of a software system are working as expected. To write our functional tests, we used the Capybara gem available for Ruby.&lt;br /&gt;
Capybara gem allows a user to test their web application through simulations.&lt;br /&gt;
&lt;br /&gt;
== Functional Tests Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Functional Tests for Create group assignment ===&lt;br /&gt;
&lt;br /&gt;
In Expertiza instructor can create public assignment for particular course, define the required rubrics and add students to that assignment.&lt;br /&gt;
&lt;br /&gt;
The following test spec has been written to create public group assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create_new_assignment&lt;br /&gt;
  login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  visit &amp;quot;/assignments/new?private=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
  select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
  fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
  fill_in 'assignment_form_assignment_spec_location', with: 'testLocation'&lt;br /&gt;
  check(&amp;quot;assignment_form_assignment_microtask&amp;quot;)&lt;br /&gt;
  check(&amp;quot;team_assignment&amp;quot;)&lt;br /&gt;
  fill_in 'assignment_form_assignment_max_team_size', with: '3', visible: false&lt;br /&gt;
  check(&amp;quot;assignment_form_assignment_reviews_visible_to_all&amp;quot;)&lt;br /&gt;
  check(&amp;quot;assignment_form_assignment_is_calibrated&amp;quot;)&lt;br /&gt;
  check(&amp;quot;assignment_form_assignment_availability_flag&amp;quot;)&lt;br /&gt;
  expect(page).to have_select(&amp;quot;assignment_form[assignment][reputation_algorithm]&amp;quot;, options: ['--', 'Hamer', 'Lauw'])&lt;br /&gt;
&lt;br /&gt;
  click_button 'Create'&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add topics to the assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def add_topic_to_assignment assignment&lt;br /&gt;
  visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
  click_link 'Topics'&lt;br /&gt;
  click_link 'New topic'&lt;br /&gt;
  fill_in 'topic_topic_identifier', with: '112'&lt;br /&gt;
  fill_in 'topic_topic_name', with: 'test_topic_1'&lt;br /&gt;
  fill_in 'topic_category', with: 'test_topic_1'&lt;br /&gt;
  fill_in 'topic_max_choosers', with: 3&lt;br /&gt;
  click_button 'Create'&lt;br /&gt;
  create(:assignment_due_date)&lt;br /&gt;
  create_list(:participant, 3)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional Tests for Log in as student and selecting a topic of assignment ===&lt;br /&gt;
&lt;br /&gt;
When student login into his Expertiza account, he can check for new assignment under &amp;quot;Assignments&amp;quot; tab and choose the topic of his interest. Student then can send invitation to other students who are also enrolled in same course.&lt;br /&gt;
We have written following test spec to impersonate as a student and select a topic&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;should impersonate as student&amp;quot; do&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2064&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    # Assignment name&lt;br /&gt;
    expect(page).to have_content('public assignment for test')&lt;br /&gt;
    click_link 'public assignment for test'&lt;br /&gt;
    expect(page).to have_content('Submit or Review work for public assignment for test')&lt;br /&gt;
&lt;br /&gt;
    click_link 'Signup sheet'&lt;br /&gt;
    expect(page).to have_content('Signup sheet for public assignment for test assignment')&lt;br /&gt;
    assignment_id = Assignment.first.id&lt;br /&gt;
    visit &amp;quot;/sign_up_sheet/sign_up?id=#{assignment_id}&amp;amp;topic_id=1&amp;quot;&lt;br /&gt;
    expect(page).to have_content('Your topic(s): test_topic_1') &lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sending invitations to other students&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    click_link 'public assignment for test'&lt;br /&gt;
    click_link 'Your team'&lt;br /&gt;
    expect(page).to have_content('public assignment for test_Team1')&lt;br /&gt;
    fill_in 'user_name', with: 'student2065'&lt;br /&gt;
    click_button 'Invite'&lt;br /&gt;
    fill_in 'user_name', with: 'student2066'&lt;br /&gt;
    click_button 'Invite'&lt;br /&gt;
    expect(page).to have_content('student2065')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functional Tests for accepting an invitation ===&lt;br /&gt;
&lt;br /&gt;
In Expertiza assignments, the only way for a student to join an existing team is to be invited by the leader.&lt;br /&gt;
&lt;br /&gt;
Following test spec has been written to accept the invitation to join the team and verify that the assignment topic is assigned to all users&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;joins the team&amp;quot; do&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2065&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    expect(page).to have_content('public assignment for test')&lt;br /&gt;
    visit '/invitation/accept?inv_id=1&amp;amp;student_id=1&amp;amp;team_id=1'&lt;br /&gt;
    visit '/student_teams/view?student_id=1'&lt;br /&gt;
    expect(page).to have_content('Team Information for public assignment for test')&lt;br /&gt;
&lt;br /&gt;
    # to test invalid case - student who is not part of the team does not have created assignment&lt;br /&gt;
    user = User.find_by(name: &amp;quot;student2066&amp;quot;)&lt;br /&gt;
    stub_current_user(user, user.role.name, user.role)&lt;br /&gt;
    visit '/student_task/list'&lt;br /&gt;
    page.should has_no_content?('public assignment for test')&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Functional Tests for whether students choosing the same topic are in the same team===&lt;br /&gt;
&lt;br /&gt;
Since the only way for students to be in a team is by invitation, students who choose the same topic will be in different team. Our test is to let two different students select the same topic and see if their teammates contains each other. Therefore, first we let ‘student2064’ and 'student2065' sign for the same topic, and in their pages, to see if there is 'student2065' or 'student2064'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      expect(page).to have_content &amp;quot;Team Name&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;student2065&amp;quot;&lt;br /&gt;
      expect(page).to have_content &amp;quot;student2064&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running the tests ==&lt;br /&gt;
&lt;br /&gt;
The tests can be run on the terminal by navigating to the /spec/features directory using the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 rspec team_functionalities_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whether the test fails or succeeds, allows us to determine which parts of the system are functioning properly.&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
[[File:new1.PNG|200px|Image: 200 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:new2.PNG|200px|Image: 200 pixels]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# link for forked repository [[https://github.com/ankit13jain/expertiza]] &lt;br /&gt;
# Github link for original repository [[https://github.com/expertiza/expertiza.git]]&lt;br /&gt;
# Github link for Capybara [[https://github.com/jnicklas/capybara.git]]&lt;/div&gt;</summary>
		<author><name>Aajain2</name></author>
	</entry>
</feed>