diff --git a/bloclink/apps/bis/features/data/building.json b/bloclink/apps/bis/features/data/building.json new file mode 100644 index 0000000000000000000000000000000000000000..73c67dd38df8f64e41b986015a8e921b112003b4 --- /dev/null +++ b/bloclink/apps/bis/features/data/building.json @@ -0,0 +1,3 @@ +{ + "id": 152699 +} diff --git a/bloclink/apps/bis/features/data/questions.json b/bloclink/apps/bis/features/data/questions.json new file mode 100644 index 0000000000000000000000000000000000000000..0ca6a013a6e9542679ecf0582b27903de43b35a9 --- /dev/null +++ b/bloclink/apps/bis/features/data/questions.json @@ -0,0 +1,20 @@ +{ + "newyorkcity": { + "fuelTypes": "1", + "heatDistribution": "2", + "heatingSystemAge": "3", + "heatingSystemReplacementPlan": "4", + "buildingType": "6", + "utilityBills": "5,8", + "comfortIssues": "7", + "financeInterest": "9" + }, + "oakland": { + "buildingType": "12,13", + "buildingNeeds": "14", + "buildingChallenges": "15", + "heatingSystem": "16", + "EnergyImprovementPastYears": "18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34", + "EnergyImprovementNextYears": "35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51" + } +} diff --git a/bloclink/apps/bis/features/data/survey.json b/bloclink/apps/bis/features/data/survey.json new file mode 100644 index 0000000000000000000000000000000000000000..48a690e4c128a814b923bdf3944be11d500d0e7b --- /dev/null +++ b/bloclink/apps/bis/features/data/survey.json @@ -0,0 +1,3 @@ +{ + "id": 1 +} diff --git a/bloclink/apps/bis/features/data/user.json b/bloclink/apps/bis/features/data/user.json new file mode 100644 index 0000000000000000000000000000000000000000..49ebac656261c65ddb5c90adb36cb32f57037f16 --- /dev/null +++ b/bloclink/apps/bis/features/data/user.json @@ -0,0 +1,3 @@ +{ + "id": 1594 +} diff --git a/bloclink/apps/bis/features/environment.py b/bloclink/apps/bis/features/environment.py index 28f4199a1ac9886d1016a9b746f83afcd6c00a71..fee6789d4be51528d4bef322746f01b1a440d72f 100644 --- a/bloclink/apps/bis/features/environment.py +++ b/bloclink/apps/bis/features/environment.py @@ -1,10 +1,61 @@ +from behave import fixture, use_fixture from decouple import config -import os -import psycopg2 +import json, psycopg2 from psycopg2 import sql from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT +@fixture +def load_building(context): + with open('features/data/building.json', 'r') as outfile: + data = json.load(outfile) + context.buildingId = data['id'] + +@fixture +def load_user(context): + with open('features/data/user.json', 'r') as outfile: + data = json.load(outfile) + context.userId = data['id'] + +@fixture +def load_survey(context): + with open('features/data/survey.json', 'r') as outfile: + data = json.load(outfile) + context.surveyId = data['id'] + +@fixture +def load_question(context): + context.questionId = context.questions[context.city][context.question] + +@fixture +def load_questions(context): + with open('features/data/questions.json', 'r') as outfile: + context.questions = json.load(outfile) + +def before_tag(context, tag): + if tag in ['newyorkcity', 'oakland']: + context.city = tag + + if tag.startswith("fixture.load.question."): + context.question = tag.replace("fixture.load.question.", "") + use_fixture(load_question, context) + +def before_feature(context, feature): + feature_name = feature.filename.split('/')[-1] + if feature_name == 'submitAnswers.feature': + use_fixture(load_survey, context) + use_fixture(load_building, context) + use_fixture(load_user, context) + use_fixture(load_questions, context) + + if feature_name == 'submitContact.feature': + use_fixture(load_building, context) + use_fixture(load_user, context) + + if feature_name == 'submitQuestionnaire.feature': + use_fixture(load_building, context) + use_fixture(load_user, context) + def before_all(context): prefix = 'http://' if config('ENVIRONMENT') == 'local' else 'https://' basePath = prefix + config('DOMAIN') + '/buildings/bis/' diff --git a/bloclink/apps/bis/features/steps/submitAnswers.py b/bloclink/apps/bis/features/steps/submitAnswers.py index 766fad23152e58f2638eb2d4cfd09ad3726d4032..a83eaf69c537a7a2780e11b8ea9cb898b4227386 100644 --- a/bloclink/apps/bis/features/steps/submitAnswers.py +++ b/bloclink/apps/bis/features/steps/submitAnswers.py @@ -3,14 +3,14 @@ import requests import json -@given('I input {questionId} {answerId} {surveyId} {buildingId} {userId} as answers') -def step_impl(context, questionId, answerId, surveyId, buildingId, userId): +@given('I input {answerId} as answers') +def step_impl(context, answerId): context.inputs = { - 'questionId': questionId.split(','), + 'surveyId': context.surveyId, + 'buildingId': context.buildingId, + 'userId': context.userId, + 'questionId': context.questionId.split(','), 'answerId': answerId.split(','), - 'surveyId': surveyId, - 'buildingId': buildingId, - 'userId': userId, } @when('I click on continue button') diff --git a/bloclink/apps/bis/features/steps/submitBuilding.py b/bloclink/apps/bis/features/steps/submitBuilding.py index a7ad6a657b4a55240832e3f0e55a06af93173be3..13272cc5b417621d28a333d016bbe8e5d39cb507 100644 --- a/bloclink/apps/bis/features/steps/submitBuilding.py +++ b/bloclink/apps/bis/features/steps/submitBuilding.py @@ -11,11 +11,10 @@ def step_impl(context, address): def step_impl(context): context.response = requests.put(url=context.endpoints['submitBuilding'], json={'address': context.address}, headers={'Content-Type': 'PUT'}) -@then('result page should include code {code}') -def step_impl(context, code): - assert code == str(context.response.status_code) - -@then('result page should include success as {success}') -def step_impl(context, success): - assert success == str(json.loads(context.response.text)['success']) +@then('it will {go} to the next question') +def step_impl(context, go): + if go == "True": + assert context.response.status_code == 200 + if go == "False": + assert context.response.status_code != 200 diff --git a/bloclink/apps/bis/features/steps/submitContact.py b/bloclink/apps/bis/features/steps/submitContact.py index c5935848357559b928496fc21eef2e172f668f2a..51dcac419fb81b08b2fb378afe86fb9cf8c84001 100644 --- a/bloclink/apps/bis/features/steps/submitContact.py +++ b/bloclink/apps/bis/features/steps/submitContact.py @@ -3,15 +3,15 @@ import requests import json -@given('I input {firstName} {lastName} {email} {phoneNumber} {buildingId} {userId}') -def step_impl(context, firstName, lastName, email, phoneNumber, buildingId, userId): +@given('I input {firstName} {lastName} {email} {phoneNumber} as contact info') +def step_impl(context, firstName, lastName, email, phoneNumber): context.inputs = { 'firstName': firstName, 'lastName': lastName, 'email': email, 'phoneNumber': phoneNumber, - 'buildingId': buildingId, - 'userId': userId, + 'buildingId': context.buildingId, + 'userId': context.userId, } @when('I submit contact form') diff --git a/bloclink/apps/bis/features/steps/submitQuestionnaire.py b/bloclink/apps/bis/features/steps/submitQuestionnaire.py index 3dddaecc2400451b62a2ade5b3e26be909152ec5..ccc6e93f1ef5f3b96534cb80d7a90dbb9dbfc0fc 100644 --- a/bloclink/apps/bis/features/steps/submitQuestionnaire.py +++ b/bloclink/apps/bis/features/steps/submitQuestionnaire.py @@ -3,19 +3,26 @@ import requests import json -@given('I have {firstName} {lastName} {email} {phone} {surveyId} {buildingId} {buildingQualified} {userId}') -def step_impl(context, firstName, lastName, email, phone, surveyId, buildingId, buildingQualified, userId): +@given('I input {firstName} {lastName} {email} {phone} {surveyId} {buildingQualified} as questionnaire info') +def step_impl(context, firstName, lastName, email, phone, surveyId, buildingQualified): context.inputs = { 'firstName': firstName, 'lastName': lastName, 'email': email, 'phone': phone, 'surveyId': surveyId, - 'buildingId': buildingId, + 'buildingId': context.buildingId, 'buildingQualified': bool(buildingQualified), - 'userId': userId, + 'userId': context.userId, } @when('I submit the questionnaire') def step_impl(context): context.response = requests.put(url=context.endpoints['submitQuestionnaire'], json=context.inputs, headers={'Content-Type': 'PUT'}) + +@then('it will {go} to thanks page') +def step_impl(context, go): + if go == "True": + assert context.response.status_code == 200 + if go == "False": + assert context.response.status_code != 200 diff --git a/bloclink/apps/bis/features/submitAnswers.feature b/bloclink/apps/bis/features/submitAnswers.feature index a4edfadd929eed218469c69b2bd1a3451897dd53..3bb69582223589c83221daea906a3272e78962d7 100644 --- a/bloclink/apps/bis/features/submitAnswers.feature +++ b/bloclink/apps/bis/features/submitAnswers.feature @@ -1,281 +1,199 @@ Feature: A building owner can submit answers - @newyorkcity + @newyorkcity @fixture.load.question.fuelTypes Scenario Outline: Fuel types - Given I input as answers + Given I input as answers When I click on continue button - Then result page should include code - And result page should include success as + Then it will to the next question Examples: Valid answers - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 1 | 3 | 1 | 152699 | 1594 | 200 | True | + | answerId | go | + | 9 | True | - Examples: Survey not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 1 | 3 | 0 | 152699 | 1594 | 400 | False | - | 1 | 3 | 100 | 152699 | 1594 | 400 | False | + Examples: Invalid answers + | answerId | go | + | 59 | False | + | -9 | False | + | 99 | False | - Examples: Building not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 1 | 3 | 1 | 0 | 1594 | 400 | False | - - @newyorkcity + @newyorkcity @fixture.load.question.heatDistribution Scenario Outline: Heat distribution - Given I input as answers + Given I input as answers When I click on continue button - Then result page should include code - And result page should include success as + Then it will to the next question Examples: Valid answers - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 2 | 9 | 1 | 152699 | 1594 | 200 | True | - - Examples: Survey not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 2 | 9 | 0 | 152699 | 1594 | 400 | False | - | 2 | 9 | 100 | 152699 | 1594 | 400 | False | + | answerId | go | + | 9 | True | - Examples: Building not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 2 | 9 | 1 | 0 | 1594 | 400 | False | + Examples: Invalid answers + | answerId | go | + | 39 | False | - @newyorkcity + @newyorkcity @fixture.load.question.heatingSystemAge Scenario Outline: Heating system age - Given I input as answers + Given I input as answers When I click on continue button - Then result page should include code - And result page should include success as + Then it will to the next question Examples: Valid answers - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 3 | 14 | 1 | 152699 | 1594 | 200 | True | + | answerId | go | + | 14 | True | - Examples: Survey not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 3 | 14 | 0 | 152699 | 1594 | 400 | True | - | 3 | 14 | 100 | 152699 | 1594 | 400 | True | + Examples: Invalid answers + | answerId | go | + | 109 | False | - Examples: Building not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 3 | 14 | 1 | 0 | 1594 | 400 | False | - - @newyorkcity + @newyorkcity @fixture.load.question.heatingSystemReplacementPlan Scenario Outline: Heating system replacement plan - Given I input as answers + Given I input as answers When I click on continue button - Then result page should include code - And result page should include success as + Then it will to the next question Examples: Valid answers - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 4 | 18 | 1 | 152699 | 1594 | 200 | True | - - Examples: Survey not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 4 | 18 | 0 | 152699 | 1594 | 400 | False | - | 4 | 18 | 100 | 152699 | 1594 | 400 | False | + | answerId | go | + | 18 | True | - Examples: Building not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 4 | 18 | 1 | 0 | 1594 | 400 | False | + Examples: Invalid answers + | answerId | go | + | 109 | False | - @newyorkcity + @newyorkcity @fixture.load.question.buildingType Scenario Outline: Building type - Given I input as answers + Given I input as answers When I click on continue button - Then result page should include code - And result page should include success as + Then it will to the next question Examples: Valid answers - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 6 | 21 | 1 | 152699 | 1594 | 200 | True | + | answerId | go | + | 21 | True | - Examples: Survey not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 6 | 21 | 0 | 152699 | 1594 | 400 | False | - | 6 | 21 | 100 | 152699 | 1594 | 400 | False | + Examples: Invalid answers + | answerId | go | + | 199 | False | - Examples: Building not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 6 | 21 | 1 | 0 | 1594 | 400 | False | - - @newyorkcity + @newyorkcity @fixture.load.question.utilityBills Scenario Outline: Utility bills - Given I input as answers + Given I input as answers When I click on continue button - Then result page should include code - And result page should include success as + Then it will to the next question Examples: Valid answers - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 5,8 | 24,25 | 1 | 152699 | 1594 | 200 | True | - - Examples: Survey not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 5,8 | 24,25 | 0 | 152699 | 1594 | 400 | False | - | 5,8 | 24,25 | 100 | 152699 | 1594 | 400 | False | + | answerId | go | + | 24,25 | True | - Examples: Building not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 5,8 | 24,25 | 1 | 0 | 1594 | 400 | False | + Examples: Invalid answers + | answerId | go | + | 199,200 | False | - @newyorkcity + @newyorkcity @fixture.load.question.comfortIssues Scenario Outline: Comfort issues - Given I input as answers + Given I input as answers When I click on continue button - Then result page should include code - And result page should include success as + Then it will to the next question Examples: Valid answers - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 7 | 27,28,29 | 1 | 152699 | 1594 | 200 | True | - - Examples: Survey not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 7 | 27,28,29 | 0 | 152699 | 1594 | 400 | False | - | 7 | 27,28,29 | 100 | 152699 | 1594 | 400 | False | + | answerId | go | + | 27,28,29 | True | - Examples: Building not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 7 | 27,28,29 | 1 | 0 | 1594 | 400 | False | + Examples: Invalid answers + | answerId | go | + | 199,200,201 | False | - @newyorkcity + @newyorkcity @fixture.load.question.financeInterest Scenario Outline: Finance interest - Given I input as answers + Given I input as answers When I click on continue button - Then result page should include code - And result page should include success as + Then it will to the next question Examples: Valid answers - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 9 | 1 | 1 | 152699 | 1594 | 200 | True | + | answerId | go | + | 1 | True | - Examples: Survey not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 9 | 1 | 0 | 152699 | 1594 | 400 | False | - | 9 | 1 | 100 | 152699 | 1594 | 400 | False | + Examples: Invalid answers + | answerId | go | + | 99 | False | - Examples: Building not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 9 | 1 | 1 | 0 | 1594 | 400 | False | - - @oakland + @oakland @fixture.load.question.buildingType Scenario Outline: Building type - Given I input as answers + Given I input as answers When I click on continue button - Then result page should include code - And result page should include success as + Then it will to the next question Examples: Valid answers - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 12,13 | 34,40 | 2 | 1189746 | 1601 | 200 | True | - - Examples: Survey not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 12,13 | 34,40 | 0 | 1189746 | 1601 | 400 | False | - | 12,13 | 34,40 | 100 | 1189746 | 1601 | 400 | False | + | answerId | go | + | 34,40 | True | - Examples: Building not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 12,13 | 34,40 | 2 | 0 | 1601 | 400 | False | + Examples: Invalid answers + | answerId | go | + | 99,100 | False | - @oakland + @oakland @fixture.load.question.buildingNeeds Scenario Outline: Building needs - Given I input as answers + Given I input as answers When I click on continue button - Then result page should include code - And result page should include success as + Then it will to the next question Examples: Valid answers - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 14 | 76,77,78 | 2 | 1189746 | 1601 | 200 | True | + | answerId | go | + | 76,77,78 | True | - Examples: Survey not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 14 | 76,77,78 | 0 | 1189746 | 1601 | 400 | False | - | 14 | 76,77,78 | 100 | 1189746 | 1601 | 400 | False | + Examples: Invalid answers + | answerId | go | + | 199,200,201 | False | - Examples: Building not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 14 | 76,77,78 | 2 | 0 | 1601 | 400 | False | - - @oakland - Scenario Outline: Building chanllenges - Given I input as answers + @oakland @fixture.load.question.buildingChallenges + Scenario Outline: Building challenges + Given I input as answers When I click on continue button - Then result page should include code - And result page should include success as + Then it will to the next question Examples: Valid answers - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 15 | 87,88,89 | 2 | 1189746 | 1601 | 200 | True | - - Examples: Survey not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 15 | 87,88,89 | 0 | 1189746 | 1601 | 400 | False | - | 15 | 87,88,89 | 100 | 1189746 | 1601 | 400 | False | + | answerId | go | + | 87,88,89 | True | - Examples: Building not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 15 | 87,88,89 | 2 | 0 | 1601 | 400 | False | + Examples: Invalid answers + | answerId | go | + | 199,200,201 | False | - @oakland + @oakland @fixture.load.question.heatingSystem Scenario Outline: Heating system - Given I input as answers + Given I input as answers When I click on continue button - Then result page should include code - And result page should include success as + Then it will to the next question Examples: Valid answers - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 16 | 101 | 2 | 1189746 | 1601 | 200 | True | + | answerId | go | + | 101 | True | - Examples: Survey not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 16 | 101 | 0 | 1189746 | 1601 | 400 | False | - | 16 | 101 | 100 | 1189746 | 1601 | 400 | False | + Examples: Invalid answers + | answerId | go | + | 201 | False | - Examples: Building not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 16 | 101 | 2 | 0 | 1601 | 400 | False | - - @oakland + @oakland @fixture.load.question.EnergyImprovementPastYears Scenario Outline: Energy improvements past years - Given I input as answers + Given I input as answers When I click on continue button - Then result page should include code - And result page should include success as + Then it will to the next question Examples: Valid answers - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34 | 2,2,2,2,2,2,2,2,2,2,1,1,2,2,2,2,2 | 2 | 1189746 | 1601 | 200 | True | - - Examples: Survey not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34 | 2,2,2,2,2,2,2,2,2,2,1,1,2,2,2,2,2 | 0 | 1189746 | 1601 | 400 | False | - | 18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34 | 2,2,2,2,2,2,2,2,2,2,1,1,2,2,2,2,2 | 100 | 1189746 | 1601 | 400 | False | + | answerId | go | + | 2,2,2,2,2,2,2,2,2,2,1,1,2,2,2,2,2 | True | - Examples: Building not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34 | 2,2,2,2,2,2,2,2,2,2,1,1,2,2,2,2,2 | 2 | 0 | 1601 | 400 | False | + Examples: Invalid answers + | answerId | go | + | 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10 | False | - @oakland + @oakland @fixture.load.question.EnergyImprovementNextYears Scenario Outline: Energy improvements next years - Given I input as answers + Given I input as answers When I click on continue button - Then result page should include code - And result page should include success as + Then it will to the next question Examples: Valid answers - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51 | 2,2,1,2,2,2,2,2,2,2,1,1,2,2,2,2,2 | 2 | 1189746 | 1601 | 200 | True | - - Examples: Survey not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51 | 2,2,1,2,2,2,2,2,2,2,1,1,2,2,2,2,2 | 0 | 1189746 | 1601 | 400 | False | - | 35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51 | 2,2,1,2,2,2,2,2,2,2,1,1,2,2,2,2,2 | 100 | 1189746 | 1601 | 400 | False | + | answerId | go | + | 2,2,1,2,2,2,2,2,2,2,1,1,2,2,2,2,2 | True | - Examples: Building not exist - | questionId | answerId | surveyId | buildingId | userId | code | success | - | 35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51 | 2,2,1,2,2,2,2,2,2,2,1,1,2,2,2,2,2 | 2 | 0 | 1601 | 400 | False | + Examples: Invalid answers + | answerId | go | + | 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10 | False | diff --git a/bloclink/apps/bis/features/submitBuilding.feature b/bloclink/apps/bis/features/submitBuilding.feature index b7545e8491177f7a708802b04cbda5977c0d72ba..e112e73ea648f47a5594f036cfd5e9dead24ef36 100644 --- a/bloclink/apps/bis/features/submitBuilding.feature +++ b/bloclink/apps/bis/features/submitBuilding.feature @@ -3,24 +3,21 @@ Feature: Building search Scenario Outline: Search for a building Given I input a building
When I click on search button - Then result page should include code - And result page should include success as + Then it will to the next question Examples: Valid building - | address | code | success | - | 489 Hart Street, Brooklyn, New York 11221, United States | 200 | True | - | 81 Prospect Street, Staten Island, New York 10304, United States | 200 | True | - | Oakland California Temple, 4770 Lincoln Ave, Oakland, California 94602, United States | 200 | True | + | address | go | + | 489 Hart Street, Brooklyn, New York 11221, United States | True | + | 81 Prospect Street, Staten Island, New York 10304, United States | True | + | Oakland California Temple, 4770 Lincoln Ave, Oakland, California 94602, United States | True | Examples: Invalid building - | address | code | success | - | Staten Island, New York, New York, United States | 400 | False | - | New York, New York, United States | 400 | False | - | New York, New York 10453, United States | 400 | False | - | East New York, Brooklyn, New York, New York 11208, United States | 400 | False | + | address | go | + | Staten Island, New York, New York, United States | False | + | New York, New York, United States | False | + | New York, New York 10453, United States | False | + | East New York, Brooklyn, New York, New York 11208, United States | False | + | New Jersey Motor Vehicle Commission, 481 US Route 46 W, Wayne, New Jersey 07470, United States | False | + | 60 East Jamaica Avenue, Valley Stream, New York 11580, United States | False | - Examples: Uncovered building - | address | code | success | - | New Jersey Motor Vehicle Commission, 481 US Route 46 W, Wayne, New Jersey 07470, United States | 400 | False | - | 60 East Jamaica Avenue, Valley Stream, New York 11580, United States | 400 | False | diff --git a/bloclink/apps/bis/features/submitContact.feature b/bloclink/apps/bis/features/submitContact.feature index da4c02021d50122a4b58b7fe61eb4f45a75f083f..2444d6b43b02c9b78338d374c8c78465de210dfc 100644 --- a/bloclink/apps/bis/features/submitContact.feature +++ b/bloclink/apps/bis/features/submitContact.feature @@ -1,32 +1,23 @@ Feature: A building owner can submit contact information + @fixture.load.contact Scenario Outline: Contact information form - Given I input - When I submit contact form - Then result page should include code - And result page should include success as + Given I input as contact info + When I click on continue button + Then it will to the next question Examples: Valid contact information - | firstName | lastName | email | phoneNumber | buildingId | userId | code | success | - | Tony | Ferguson | tony.ferguson@ufc.com | 347-123-4567 | 152699 | 1594 | 200 | True | - | David | Beckham | David@beckham.com | +41-347-123-4567 | 152699 | 1594 | 200 | True | - | Tony | Ferguson | tony.ferguson@ufc.com | '' | 152699 | 1594 | 200 | True | + | firstName | lastName | email | phoneNumber | go | + | Tony | Ferguson | tony.ferguson@ufc.com | 347-123-4567 | True | + | David | Beckham | David@beckham.com | +41-347-123-4567 | True | + | Tony | Ferguson | tony.ferguson@ufc.com | '' | True | - Examples: Incomplete contact information - | firstName | lastName | email | phoneNumber | buildingId | userId | code | success | - | Tony | '' | tony.ferguson@ufc.com | 347-123-4567 | 152699 | 1594 | 400 | False | - | '' | Ferguson | tony.ferguson@ufc.com | 347-123-4567 | 152699 | 1594 | 400 | False | - | Tony | Ferguson | '' | 347-123-4567 | 152699 | 1594 | 400 | False | - - Examples: Invalid Email address - | firstName | lastName | email | phoneNumber | buildingId | userId | code | success | - | Tony | Ferguson | +0tony.ferguson@ufc.com | 347-123-4567 | 152699 | 1594 | 400 | False | - | Tony | Ferguson | tony.ferguson@ufc | 347-123-4567 | 152699 | 1594 | 400 | False | - - Examples: Invalid phone number - | firstName | lastName | email | phoneNumber | buildingId | userId | code | success | - | Tony | Ferguson | tony.ferguson@ufc.com | Phone# | 152699 | 1594 | 400 | False | - - Examples: Non-exist buildings - | firstName | lastName | email | phoneNumber | buildingId | userId | code | success | - | Tony | Ferguson | tony.ferguson@ufc.com | 347-123-4567 | 0 | 1594 | 400 | False | + Examples: Invalid contact information + | firstName | lastName | email | phoneNumber | go | + | Tony | '' | tony.ferguson@ufc.com | 347-123-4567 | False | + | '' | Ferguson | tony.ferguson@ufc.com | 347-123-4567 | False | + | Tony | Ferguson | '' | 347-123-4567 | False | + | Tony | Ferguson | +0tony.ferguson@ufc.com | 347-123-4567 | False | + | Tony | Ferguson | tony.ferguson@ufc | 347-123-4567 | False | + | Tony | Ferguson | tony.ferguson@ufc.com | Phone# | False | + | Tony | Ferguson | tony.ferguson@ufc.com | 347-123-4567 | False | diff --git a/bloclink/apps/bis/features/submitQuestionnaire.feature b/bloclink/apps/bis/features/submitQuestionnaire.feature index 2900e5cb38fbda1a03ff25930ce98e1fc3d199f9..3218f9f4982914048fd4167ea7c9fbbe6e9e3eb7 100644 --- a/bloclink/apps/bis/features/submitQuestionnaire.feature +++ b/bloclink/apps/bis/features/submitQuestionnaire.feature @@ -1,21 +1,18 @@ Feature: A building owner can submit questionnaire + @newyorkcity Scenario Outline: Review and submit questionnaire - Given I have + Given I input as questionnaire info When I submit the questionnaire - Then result page should include code - And result page should include success as + Then it will to thanks page Examples: Valid questionnaire - | firstName | lastName | email | phone | surveyId | buildingId | buildingQualified | userId | code | success | - | Tony | Ferguson | tony.ferguson@ufc.com | 347-123-4567 | 1 | 152699 | True | 1594 | 200 | True | - | Tony | Ferguson | tony.ferguson@ufc.com | '' | 1 | 152699 | True | 1594 | 200 | True | + | firstName | lastName | email | phone | surveyId | buildingQualified | go | + | Tony | Ferguson | tony.ferguson@ufc.com | 347-123-4567 | 1 | True | True | + | Tony | Ferguson | tony.ferguson@ufc.com | '' | 1 | True | True | - Examples: Building not qualified - | firstName | lastName | email | phone | surveyId | buildingId | buildingQualified | userId | code | success | - | Tony | Ferguson | tony.ferguson@ufc.com | 347-123-4567 | 1 | 152699 | False | 1594 | 400 | False | - - Examples: Building not exist - | firstName | lastName | email | phone | surveyId | buildingId | buildingQualified | userId | code | success | - | Tony | Ferguson | tony.ferguson@ufc.com | 347-123-4567 | 1 | 0 | False | 1594 | 400 | False | + Examples: Invalid questionnaire + | firstName | lastName | email | phone | surveyId | buildingQualified | go | + | Tony | Ferguson | tony.ferguson@ufc.com | 347-123-4567 | 1 | False | False | + | Tony | Ferguson | tony.ferguson@ufc.com | 347-123-4567 | 1 | False | False |