Skip to content

Instantly share code, notes, and snippets.

@piyushbansal
Last active December 22, 2015 14:18
Show Gist options
  • Save piyushbansal/6484487 to your computer and use it in GitHub Desktop.
Save piyushbansal/6484487 to your computer and use it in GitHub Desktop.
gci_student_register_required_inputs.acc
def GSoCStudentRegistrationDataSeeding():
program_helper = program_utils.GSoCProgramHelper()
sponsor = program_helper.createSponsor()
gsoc = program_helper.createProgram(override={'name':'Google Summer of Code',
'short_name':'gsoc new'})
org_app = program_helper.createOrgApp()
timeline = timeline_utils.GSoCTimelineHelper(gsoc.timeline, org_app)
timeline.studentSignup()
site = program_helper.createSite()
from pyccuracy.actions import ActionBase
from tests import acceptance_datastore_manipulations
class PopulateDatstoreAction(ActionBase):
regex = r'^(And )?I populate datastore for [\"](?P<test>.+)[\"]$'
def execute(self, context, test):
if test =="GCIStudentRegistration":
acceptance_datastore_manipulations.GCIStudentRegistrationDataSeeding()
As a Melange User
I want to register as a student for GCI
So that I can participate in the program
Scenario 1 - Asserting that the page is infact for registration.
Given
#Note : Don't change the relative order of the below mentioned scenarios.
#The order is the way it is, because at the end we're testing that it is
#entirely possible to register using just required fields.
I populate datastore for "GCIStudentRegistration"
I go to GCI Home Page
When
I click "Register_as_student" link and wait
And I am in the GCI Age Check Page
I fill "Birth_date" textbox with "1998-12-08"
I click "Submit" button and wait
And I am in the Localhost Login Page
I fill "Email" textbox with "student@example.com"
I click "Login" button and wait
I am in the GCI Home Page
I click "Register_as_student" link and wait
Then
I see "Register as a Student" title
Scenario 2 - Testing that the Username field is required field.
Given
I am in the GCI Student Register Page
When
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
I see "Username_error_message" div contains "This field is required."
I fill "Username" textbox with "test_student"
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
Then
I do not see "Username_error_message" div
Scenario 3 - Testing that the Public name field is required field.
Given
# I go to GCI Student Register Page
# I stay on the same page.
When
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
I see "Public_name_error_message" div contains "This field is required."
I fill "Public_name" textbox with "skywalker"
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
Then
I do not see "Public_name_error_message" div
Scenario 4 - Testing that the First name field is required field.
Given
# I go to GCI Student Register Page
# I stay on the same page.
When
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
I see "First_name_error_message" div contains "This field is required."
I fill "First_name" textbox with "luke"
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
Then
I do not see "First_name_error_message" div
Scenario 5 - Testing that the Last name field is required field.
Given
# I go to GCI Student Register Page
# I stay on the same page.
When
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
I see "Last_name_error_message" div contains "This field is required."
I fill "Last_name" textbox with "skywalker"
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
Then
I do not see "Last_name_error_message" div
Scenario 6 - Testing that the Email field is required field.
Given
# I go to GCI Student Register Page
# I stay on the same page.
When
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
I see "Email_error_message" div contains "This field is required."
I fill "Email" textbox with "luke@gmail.com"
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
Then
I do not see "Email_error_message" div
Scenario 7 - Testing that the Street Address field is required field.
Given
# I go to GCI Student Register Page
# I stay on the same page.
When
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
I see "Street_address_1_error_message" div contains "This field is required."
I fill "Street_address_1" textbox with "Tatooine"
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
Then
I do not see "Street_address_1_error_message" div
Scenario 8 - Testing that the City field is required field.
Given
# I go to GCI Student Register Page
# I stay on the same page.
When
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
I see "City_error_message" div contains "This field is required."
I fill "City" textbox with "New Delhi"
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
Then
I do not see "City_error_message" div
Scenario 9 - Testing that the Country field is required field.
Given
# I go to GCI Student Register Page
# I stay on the same page.
When
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
I see "Country_error_message" div contains "This field is required."
I select the option with text of "India" in "Country" select
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
Then
I do not see "Country_error_message" div
Scenario 10 - Testing that the Zip field is required field.
Given
# I go to GCI Student Register Page
# I stay on the same page.
When
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
I see "Zip_error_message" div contains "This field is required."
I fill "Zip" textbox with "201010"
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
Then
I do not see "Zip_error_message" div
Scenario 11 - Testing that the Phone field is required field.
Given
# I go to GCI Student Register Page
# I stay on the same page.
When
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
I see "Phone_error_message" div contains "This field is required."
I fill "Phone" textbox with "918885366345"
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
Then
I do not see "Phone_error_message" div
Scenario 12 - Testing that the School name field is required field.
Given
# I go to GCI Student Register Page
# I stay on the same page.
When
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
I see "School_name_error_message" div contains "This field is required."
I fill "School_name" textbox with "The academy"
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
Then
I do not see "School_name_error_message" div
Scenario 13 - Testing that the School Country field is required field.
Given
# I go to GCI Student Register Page
# I stay on the same page.
When
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
I see "School_country_error_message" div contains "This field is required."
I select the option with text of "India" in "School_country" select
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
Then
I do not see "School_country_error_message" div
Scenario 14 - Testing that the Expected Graduation year field is required field.
Given
# I go to GCI Student Register Page
# I stay on the same page.
When
I click "Submit" button and wait
I see "Error_message" div contains "Sorry, we could not save your profile. Please fix the errors mentioned below."
I see "Expected_graduation_year_error_message" div contains "This field is required."
I fill "Expected_graduation_year" textbox with "2016"
I click "Submit" button and wait
I see "Success_message" div contains "Profile saved successfully."
Then
I do not see "Expected_graduation_year_error_message" div
Scenario 15 - Clearing the data.
Given
I clear datastore by going at "http://localhost:8080/clear_db"
When
Then
#The data gets cleared.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment