diff --git a/.coveragerc b/.coveragerc
deleted file mode 100644
index ac1e31e7..00000000
--- a/.coveragerc
+++ /dev/null
@@ -1,8 +0,0 @@
-[run]
-omit =
- */site-packages/*
- */migrations/*
- */survey/tests/*
- */survey/features/*
- */survey/fixtures/*
- */ussd*
diff --git a/.gitignore b/.gitignore
index 9b5f184f..739ca77f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,3 +52,4 @@ tags
submissions/*
answerFiles/*
survey/static/admin/*
+
diff --git a/.travis.yml b/.travis.yml
index 2d29de94..564ed30d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,8 @@
+branches:
+ only:
+ - master
+ - uSurvey
+
language: python
python:
diff --git a/config/database.yml b/config/database.yml
deleted file mode 100644
index 28e2dfe5..00000000
--- a/config/database.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-test:
- adapter: postgresql
- encoding: utf8
- database: app_test
- username: go
- password: go
- host: localhost
\ No newline at end of file
diff --git a/docs/Add_Groups.png b/docs/Add_Groups.png
new file mode 100644
index 00000000..1f8f2577
Binary files /dev/null and b/docs/Add_Groups.png differ
diff --git a/docs/Add_Variable.png b/docs/Add_Variable.png
new file mode 100644
index 00000000..e0eb8f3b
Binary files /dev/null and b/docs/Add_Variable.png differ
diff --git a/docs/Batch1.png b/docs/Batch1.png
new file mode 100644
index 00000000..7ca86967
Binary files /dev/null and b/docs/Batch1.png differ
diff --git a/docs/Batch10.png b/docs/Batch10.png
new file mode 100644
index 00000000..befef0cf
Binary files /dev/null and b/docs/Batch10.png differ
diff --git a/docs/Batch11.png b/docs/Batch11.png
new file mode 100644
index 00000000..8896ee68
Binary files /dev/null and b/docs/Batch11.png differ
diff --git a/docs/Batch12.png b/docs/Batch12.png
new file mode 100644
index 00000000..e744d74a
Binary files /dev/null and b/docs/Batch12.png differ
diff --git a/docs/Batch13.png b/docs/Batch13.png
new file mode 100644
index 00000000..001d0acf
Binary files /dev/null and b/docs/Batch13.png differ
diff --git a/docs/Batch14.png b/docs/Batch14.png
new file mode 100644
index 00000000..dcf296fe
Binary files /dev/null and b/docs/Batch14.png differ
diff --git a/docs/Batch15.png b/docs/Batch15.png
new file mode 100644
index 00000000..483b154d
Binary files /dev/null and b/docs/Batch15.png differ
diff --git a/docs/Batch16.png b/docs/Batch16.png
new file mode 100644
index 00000000..5061ce7a
Binary files /dev/null and b/docs/Batch16.png differ
diff --git a/docs/Batch17.png b/docs/Batch17.png
new file mode 100644
index 00000000..f2642729
Binary files /dev/null and b/docs/Batch17.png differ
diff --git a/docs/Batch18.png b/docs/Batch18.png
new file mode 100644
index 00000000..d241d35e
Binary files /dev/null and b/docs/Batch18.png differ
diff --git a/docs/Batch2.png b/docs/Batch2.png
new file mode 100644
index 00000000..619e9dd3
Binary files /dev/null and b/docs/Batch2.png differ
diff --git a/docs/Batch3.png b/docs/Batch3.png
new file mode 100644
index 00000000..7bc73bf3
Binary files /dev/null and b/docs/Batch3.png differ
diff --git a/docs/Batch4.png b/docs/Batch4.png
new file mode 100644
index 00000000..1238504f
Binary files /dev/null and b/docs/Batch4.png differ
diff --git a/docs/Batch5.png b/docs/Batch5.png
new file mode 100644
index 00000000..b40b8557
Binary files /dev/null and b/docs/Batch5.png differ
diff --git a/docs/Batch6.png b/docs/Batch6.png
new file mode 100644
index 00000000..3b059d37
Binary files /dev/null and b/docs/Batch6.png differ
diff --git a/docs/Batch7.png b/docs/Batch7.png
new file mode 100644
index 00000000..648224d2
Binary files /dev/null and b/docs/Batch7.png differ
diff --git a/docs/Batch8.png b/docs/Batch8.png
new file mode 100644
index 00000000..22e39fa2
Binary files /dev/null and b/docs/Batch8.png differ
diff --git a/docs/Batch9.png b/docs/Batch9.png
new file mode 100644
index 00000000..040cbf85
Binary files /dev/null and b/docs/Batch9.png differ
diff --git a/docs/Edit_group.png b/docs/Edit_group.png
new file mode 100644
index 00000000..59d04d74
Binary files /dev/null and b/docs/Edit_group.png differ
diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md
new file mode 100644
index 00000000..efe24890
--- /dev/null
+++ b/docs/GettingStarted.md
@@ -0,0 +1,69 @@
+
+###Getting Started
+
+**The General flow for the uSurvey is as follows**:
+
+* Admin creates uSurvey Users and assigns them Roles
+* User ‘Data Researcher’ defines Modules, Groups, Listing, Surveys, Batches and creates questionnaires for Listing & Batches in application
+* Data Researcher also defines ‘Interviewers’ and assigns them to an Enumeration area to conduct a Listing or Survey
+* In the field, Interviewer conducts the actual survey in the designated Enumeration area
+* Data collection is done using a hand-held mobile device like Android Smart Phone or Featured Phone via ODK and USSD channels respectively.
+* Captured data is sent to uSurvey portal
+* Data collected by Interviewers is then viewed on the uSurvey portal for reporting and analysis
+
+**A Quick step by step uSurvey process flow**
+
+**Step -1**
+
+Create [New Module](./Modules.md) or skip this step, if you want to use existing Modules
+
+**Step -2**
+
+Create [New Group](./Groups.md) or skip this step, if you want to use existing Groups
+
+**Step -3**
+
+Create [New Listing](./Listing.md) or skip this step, if you want to use existing Listing or you can Clone existing Listing and rename it. Here we have to observe two things;
+
+1. Use existing Listing: This option benefits by providing data collected earlier
+2. Clone existing Listing: Duplicates Listing questions only
+
+ 3.0. Once Listing is created, next
+ 3.1. Create Questions in Listing
+ 3.2. If necessary,
+ 3.3. Create Looping in questions and
+ 3.4. Add Logic to questions.
+
+**Step -4**
+
+Create [New Survey](./Survey.md) or you can Clone existing Survey and rename it,
+**Clone existing Survey**: This option duplicates the survey along with the Listing data, and ready to use.
+
+4.0. Once a new Survey is created, next
+4.1. Create Batch or Batches
+4.3. then Create Questions in Batch
+ If necessary,
+4.4. Create Looping in questions and
+4.5. Add Logic to questions.
+4.6. Finally, don’t forget to change the status to Open, via Action Item ‘Open/Close’ for Batch
+
+**Step -5**
+
+Enroll [an Interviewer](./Interviewer.md)
+To conduct a Survey in the field, define an Interviewer as follows:
+5.0. Provide basic Interviewer details,
+5.1. Assign a Survey,
+5.2. Allocate Enumeration Areas,
+5.3. Create ODK Access ID,
+5.4. Provide Mobile Number to access via USSD channel
+5.5. Finally, finish enrollment
+
+**Step -6**
+
+**Conduct Survey**:
+Data collection and submission is done in two ways:
+
+1. Android channel - [Using uSurvey App](./ODK_App.md)
+2. USSD channel - [Featured Phone](./ussd-integration.md)
+
+At any point on the uSurvey portal, use breadcrumbs on top of each page for easy navigation.
diff --git a/docs/Group1.png b/docs/Group1.png
new file mode 100644
index 00000000..631478d8
Binary files /dev/null and b/docs/Group1.png differ
diff --git a/docs/Group10.png b/docs/Group10.png
new file mode 100644
index 00000000..485e9349
Binary files /dev/null and b/docs/Group10.png differ
diff --git a/docs/Group2.png b/docs/Group2.png
new file mode 100644
index 00000000..f754cce5
Binary files /dev/null and b/docs/Group2.png differ
diff --git a/docs/Group2_1.png b/docs/Group2_1.png
new file mode 100644
index 00000000..aa022bdb
Binary files /dev/null and b/docs/Group2_1.png differ
diff --git a/docs/Group2_2.png b/docs/Group2_2.png
new file mode 100644
index 00000000..183f2676
Binary files /dev/null and b/docs/Group2_2.png differ
diff --git a/docs/Group3.png b/docs/Group3.png
new file mode 100644
index 00000000..3dbae42f
Binary files /dev/null and b/docs/Group3.png differ
diff --git a/docs/Group4.png b/docs/Group4.png
new file mode 100644
index 00000000..39aa11e6
Binary files /dev/null and b/docs/Group4.png differ
diff --git a/docs/Group5.png b/docs/Group5.png
new file mode 100644
index 00000000..b1830c57
Binary files /dev/null and b/docs/Group5.png differ
diff --git a/docs/Group6.png b/docs/Group6.png
new file mode 100644
index 00000000..4c10f21f
Binary files /dev/null and b/docs/Group6.png differ
diff --git a/docs/Group7.png b/docs/Group7.png
new file mode 100644
index 00000000..ffde7930
Binary files /dev/null and b/docs/Group7.png differ
diff --git a/docs/Group8.png b/docs/Group8.png
new file mode 100644
index 00000000..7032fddb
Binary files /dev/null and b/docs/Group8.png differ
diff --git a/docs/Group9.png b/docs/Group9.png
new file mode 100644
index 00000000..034a0834
Binary files /dev/null and b/docs/Group9.png differ
diff --git a/docs/Groups.md b/docs/Groups.md
new file mode 100644
index 00000000..adee52b1
--- /dev/null
+++ b/docs/Groups.md
@@ -0,0 +1,84 @@
+
+###Groups
+
+Groups are Survey dependent classification of people/respondents based on their Age, Gender and combination of both into one or more survey- respondents categories called Groups.
+Population has to be segment into Groups / multiple groups and our system allows us to create as many as needed.
+
+From this above Groups page, Groups are managed, i.e. to Create a New Group, Edit existing Group, Delete Groups and Manage Parameters
+
+###Create a New Group
+Groups are available from main menu under, Design >> Groups
+
+![Group](./Group1.png)
+
+To create a new Group, click on ‘Add Group’ button at top right of the Groups page, that opens a form to create a new Group.
+
+![Group](./Group2_1.png)
+
+###Elements of Group
+
+Name: Is Group Name, which is a unique identity to a Group and is a mandatory field.
+
+Description: A short description about Group
+
+Parameter: Need to select a parameter, based on which Group is created. Like Age, Gender
+
+Operator: Also need to select an Operator based on the Parameter value, like value starts with, equals to and between, etc.
+
+![Group](./Group3.png)
+
+A Group is created by providing above all field, such that a Group can be created using a single or combination of Parameters, finally click on ‘Save’ button to Create Group.
+
+Existing Criteria
+This table shows list of parameters used in creating a Group and can be altered by Deleting the existing one and assigning a different parameter to the same Group Name, by changing the ‘Parameter’ and ‘Operator’ values, then click ‘Save’ button.
+
+Edit and Delete Groups
+From the Groups Table each of the Group has Action items to ‘Edit’ and ‘Delete’ Group.
+
+![Group](./Group4.png)
+
+![Group](./Group5.png)
+
+To Edit a Group – In the table under column name ‘Actions’ select ‘Edit’ to modify existing the criteria, name, description, then click ‘Save’ button.
+
+To Delete a Group – In the table under column name ‘Actions’ select ‘Delete’ to remove from list, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently.
+
+###Available Parameters
+
+Parameters plays a major portion in creating a Group, to check what are the Parameters available, Add, Edit and Delete Parameters are managed.
+
+![Group](./Group6.png)
+
+Add Parameters
+
+To Add Parameter, click on ‘Add Parameter’ button at top right of the Parameter page, that opens a form to create a new Parameter, which has following elements;
+
+![Group](./Group7.png)
+
+Elements of Parameter
+
+Variables Name: Is an identifier for Parameter, Enter the name of the Parameter
+
+Text: A short description about Parameter
+
+Answer Type: Select an Answer Type for Parameter from dropdown list, such that Parameter is of type Text, Numeric and Multi choice.
+
+![Group](./Group8.png)
+
+A Parameter is created by providing above all field, finally click on ‘Save’ button to Create Parameter or click on ‘Save and Add More’ button to continue adding more Parameters to the list.
+
+Edit and Delete Parameter
+From the Parameter Table each of the Parameter has Action items to ‘Edit’ and ‘Delete’ Parameter.
+
+![Group](./Group9.png)
+
+![Group](./Group10.png)
+
+To Edit a Parameter – In the table under column name ‘Actions’ select ‘Edit’ to modify existing the Variable name, Text and Answer Type, then click ‘Save’ button.
+
+To Delete a Parameter – In the table under column name ‘Actions’ select ‘Delete’ to remove from list, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently.
+
+View Options: This Action item is visible only for the Questions that has Answer Type “Multi choice”, to view Answer Choices.
+
+Export Parameter
+Click on ‘Export Parameter’ to download available list of Parameter in ‘.CSV’ file format.
diff --git a/docs/Home.png b/docs/Home.png
new file mode 100644
index 00000000..7699c59f
Binary files /dev/null and b/docs/Home.png differ
diff --git a/docs/Ind1.png b/docs/Ind1.png
new file mode 100644
index 00000000..8f6ac145
Binary files /dev/null and b/docs/Ind1.png differ
diff --git a/docs/Ind10.png b/docs/Ind10.png
new file mode 100644
index 00000000..fbac590c
Binary files /dev/null and b/docs/Ind10.png differ
diff --git a/docs/Ind11.png b/docs/Ind11.png
new file mode 100644
index 00000000..1d96bd4c
Binary files /dev/null and b/docs/Ind11.png differ
diff --git a/docs/Ind12.png b/docs/Ind12.png
new file mode 100644
index 00000000..405aee83
Binary files /dev/null and b/docs/Ind12.png differ
diff --git a/docs/Ind13.png b/docs/Ind13.png
new file mode 100644
index 00000000..7a7a73c7
Binary files /dev/null and b/docs/Ind13.png differ
diff --git a/docs/Ind2.png b/docs/Ind2.png
new file mode 100644
index 00000000..9f753972
Binary files /dev/null and b/docs/Ind2.png differ
diff --git a/docs/Ind3.png b/docs/Ind3.png
new file mode 100644
index 00000000..d589e02f
Binary files /dev/null and b/docs/Ind3.png differ
diff --git a/docs/Ind4.png b/docs/Ind4.png
new file mode 100644
index 00000000..4f0abdbf
Binary files /dev/null and b/docs/Ind4.png differ
diff --git a/docs/Ind5.png b/docs/Ind5.png
new file mode 100644
index 00000000..e2659184
Binary files /dev/null and b/docs/Ind5.png differ
diff --git a/docs/Ind6.png b/docs/Ind6.png
new file mode 100644
index 00000000..047dc06f
Binary files /dev/null and b/docs/Ind6.png differ
diff --git a/docs/Ind7.png b/docs/Ind7.png
new file mode 100644
index 00000000..b0deea21
Binary files /dev/null and b/docs/Ind7.png differ
diff --git a/docs/Ind8.png b/docs/Ind8.png
new file mode 100644
index 00000000..15a77ae7
Binary files /dev/null and b/docs/Ind8.png differ
diff --git a/docs/Ind9.png b/docs/Ind9.png
new file mode 100644
index 00000000..c0537689
Binary files /dev/null and b/docs/Ind9.png differ
diff --git a/docs/Indicators.md b/docs/Indicators.md
new file mode 100644
index 00000000..2cf4563f
--- /dev/null
+++ b/docs/Indicators.md
@@ -0,0 +1,75 @@
+###Indicators
+
+A Data Researcher can choose one or more fields from their survey and create an arithmetic expression to generate metrics as per their requirement. Each such expression is called an Indicator. Any number of indicators can be created for a Survey. A limited number of these indicators can be selected to be shown on the dashboard.
+
+Our system facilitates creating customized Indicators for every survey and show an analysis report in tabular and bar chart form.
+
+**How to create an Indicator?**
+
+On the ‘Indicator’ page one can view list of all survey wise Indicators in the application and can view analysis report.
+
+To create an Indicator, click on ‘Add Indicator’ button at top right of the Indicator page, this will open a blank form with following elements;
+
+**Elements in the Indicator form**
+
+**Survey**: Select Survey from list, for which the Indicator need to be defined.
+
+**Listing**: Select respective Listing, for which the Indicator need to be defined.
+
+**Indicator**: Define a name to the Indicator
+
+**Description**: A short description about Indicator
+
+**Variables**: To create an Indicator, certain metrics are needed for calculation, which are derived from survey/ listing questions
+
+**Formulae**: compose a formula based up on available Variables,
+Auto suggestion feature is available, which will prompt with the ‘Variables’ already defined above for composing.
+i.e. just type, double curly brackets to automatically prompt with the ‘Variables’ already defined,
+Ex: type {{ , system prompts with ‘Variables’ then select any one to insert Variable,
+Like: {{hh_age}}
+
+**Display on dashboard**: This option allows the indicator to be displayed on the dashboard. A user can select a maximum of 5 indicators to be shown on the dashboard.
+
+**Add Variable**:
+
+To Add a Variable, click on respective ‘+’ icon adjacent to ‘Variables’ Text box, that opens form to define a Variable, following parameters are involved and expressed.
+
+**Name**: Define a name to the Variable
+
+**Description**: A short description about Variable
+
+**Test question**: Select respective Listing questions, for which the Variable need to be defined.
+
+**Operator**: Select respective operator based up on the value of the above ‘Test question’
+
+Once all the above fields are filled, then click on ‘Add’ button to add to below table ‘Settings for this Variable’, since you can add more Variables for combination, once all Variables are defined then, finally click on ‘Save’ button to add to Variables list.
+
+One can also ‘Edit’ and ‘Delete’ Variables using the respective icons adjacent to ‘Variables’ Text box.
+
+Once Variables are defined, now you can compose the formula in ‘Formulae’ Text box, the composed formula is validated automatically and a message is shown here as ‘Valid’ or ‘in valid’.
+
+Once Variables are defined, formula is composed and validated, finally click on ‘Save’ button to create an Indicator.
+
+On the ‘Indicator’ page one can view all the Indicator created in the application, in a tabular form with following column names:
+
+**Sts**: Represents Indicator display status on dashboard, that means status with color code indicates as:
+
+ • – Not Displayed
+ • – Displayed
+
+**Indicator**: Is the title of Indicator, which is a unique identity to represent Indicator of a Survey.
+
+**Description**: A short description about Indicator
+
+**Survey**: Name of the Survey to which this Indicator belongs
+
+**Batch**: Name of the Survey Batch to which this Indicator belongs
+
+**Actions**:
+
+* **Edit**: click on, Action Item ‘Edit’, User can Edit all fields in Indicator.
+* **Delete**: click on, Action Item ‘Delete’, the Indicator is removed, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently
+* **Formula**: click on, Action Item ‘Formula’, to edit the Indicator Formula directly
+* **Analysis**: click on, Action Item ‘Analysis’, navigates to ‘Indicator Analysis’ page, here one can view two forms of district wise reports based up on the Indicator Formula,
+ * A Bar chart report is generated and displayed
+ * A tabular report
diff --git a/docs/Interviewer.md b/docs/Interviewer.md
new file mode 100644
index 00000000..daf34252
--- /dev/null
+++ b/docs/Interviewer.md
@@ -0,0 +1,71 @@
+###Interviewer
+
+Interviewer is a role in the system, one who conducts a Survey in the field.
+These Interviewers conducts the survey in the designated Enumeration areas and data collection is done using the hand-held mobile device like Android Smart Phone or Featured Phone via ODK and USSD channels respectively.
+
+Data researcher enrolls Interviewer, assigns Survey and defines the Enumeration areas.
+
+Enrolled Interviewer are available from main menu under Administration >> Interviewers
+
+![Interviewer](./Interviewer1.png)
+
+###Interviewer Registration
+On the ‘Interviewers’ page one can view list of enrolled Interviewers in the application, Add, Manage and Edit Interviewer can be done.
+
+To register a new Interviewer, click on ‘Add Interviewer’ button at top right of the Interviewers page, this will open a registration form with following elements;
+
+![Interviewer](./Interviewer2.png)
+
+Elements in the registration form
+
+![Interviewer](./Interviewer4_1.png)
+
+Select Locations: Initially get list of Enumeration Areas (EA) by selecting respective, District, County, Sub-county and Parish from locations filters at top of this page, to allocate Enumeration areas to the Interviewer where survey has to be conducted.
+
+Name: Name of the Interviewer
+
+Date of Birth: Date of birth of the Interviewer
+
+Gender: Gender of the Interviewer
+
+Education: Education qualification of the Interviewer
+
+Preferred Language: select, Interviewer’s preferred language to write and speak
+
+Survey: Assign a Survey to the Interviewer, select a Survey from the list
+
+Enumeration Area: The places or locations where assigned Survey is supposed to be conducted by the Interviewer. Select EAs from ‘All EAs’ list by clicking on the list item, that is on listed EA.
+
+ODK Access: The process of collecting data using Android channel is known as ODK Access, to provide permissions to access this channel, an Interviewer needs following ODK Access credentials;
+
+ODK ID: It is the User Id / User Name to access ODK channel, only alphabets are accepted
+
+ODK Token: It nothing but password to access ODK channel, only numeric values are accepted
+
+Activated: Allow access or prevent access to ODK channel
+
+USSD Access: The process of collecting data using Featured Phone is known as USSD Access, to access this channel, an Interviewer needs to provide Mobile Number.
+
+Options in USSD Access:
+
+Add Mobile Number: System facilitates, accessing from multiple mobile numbers also. So one can add multiple mobile numbers or remove here using ‘Add’ and ‘Delete’ options.
+
+Activated: Allow access or prevent access to USSD channel
+
+Interviewer is enrolled by providing above all field, finally click on ‘Save’ button to complete the process.
+
+From this above Interviewers page, Interviewers are managed, i.e. to Edit Interviewer Details and block/unblock Interviewer
+
+Actions:
+
+![Interviewer](./Interviewer3.png)
+
+View Details: View Interviewer profile and Edit details, all profile details, Survey Details, ODK Access and USSD Access details are editable by click on ‘Edit’ button at the bottom of the page.
+
+Un Block/ Block: Option to make Interviewer active or in active.
+
+Search: One can find Interviewers in system by two ways:
+Sort Interviewers location wise by selecting respective, District, County, Sub-county and Parish from locations filters at top of this page. Or
+Search using the search bar at top right side of this page, by providing Interviewer’s Name.
+
+Export Interviewers: On click, ‘Export Interviewers’ button, user can download the Interviewers list in “.csv” file format.
diff --git a/docs/Interviewer1.png b/docs/Interviewer1.png
new file mode 100644
index 00000000..8ac6957a
Binary files /dev/null and b/docs/Interviewer1.png differ
diff --git a/docs/Interviewer2.png b/docs/Interviewer2.png
new file mode 100644
index 00000000..2639302c
Binary files /dev/null and b/docs/Interviewer2.png differ
diff --git a/docs/Interviewer3.png b/docs/Interviewer3.png
new file mode 100644
index 00000000..37584c18
Binary files /dev/null and b/docs/Interviewer3.png differ
diff --git a/docs/Interviewer4.png b/docs/Interviewer4.png
new file mode 100644
index 00000000..e1e4bf61
Binary files /dev/null and b/docs/Interviewer4.png differ
diff --git a/docs/Interviewer4_1.png b/docs/Interviewer4_1.png
new file mode 100644
index 00000000..d839c7ca
Binary files /dev/null and b/docs/Interviewer4_1.png differ
diff --git a/docs/Library.md b/docs/Library.md
new file mode 100644
index 00000000..be37d848
--- /dev/null
+++ b/docs/Library.md
@@ -0,0 +1,32 @@
+###Library Questions
+
+List of Questions very common in Surveys are available here which are also categorized into Module wise. This is a feature/ facility available to pick up questions from this library and add to Batch or Listing, by ‘Select Questions’ feature in respective pages.
+
+Create Library Questions
+
+To add new questions in Library can be done in 2 ways.
+
+1. Adding directly question to Library
+2. Using feature ‘Update Library’ while creating Batch or Listing Questions
+
+Adding Directly:
+On the ‘Library’ page one can view all the list of Library Questions,
+Now click on, ‘Add Question’ button at top right side of this page, this will open a form where one can create a Question, which has following elements;
+
+Elements in Library Question:
+
+Module: All Modules in the application are listed here in this dropdown, one has to select, respective Module that is related to survey.
+
+Variables Name: This is an identifier for Question, type a code for Question
+
+Text: Is the actual Question, Write a Question.
+
+Answer Type: Select an Answer Type from dropdown list, such that Question has to be answered in any one of these formats only, that is ‘Answer type’ should be: “Audio, Auto Generate, Date, Geo Point, Image, Multi choice, Multi Select, Numeric, Text and Video”
+
+A Library Question is created by filling above all fields, finally click on ‘Save’ button to Add Question to Library or click on ‘Save and Add More’ button to continue adding another Question.
+
+Search: One can find Questions in Library by two ways:
+Sort questions using ‘Answer Type’ dropdown at top left side of this page. Or
+Search using the search bar at top right side of this page, by providing text or code.
+
+Export Questions: On click, ‘Export Questions’ button, user can download the Library Questions in “.csv” file format.
diff --git a/docs/Listing.md b/docs/Listing.md
new file mode 100644
index 00000000..c0c4acf2
--- /dev/null
+++ b/docs/Listing.md
@@ -0,0 +1,243 @@
+###Listing
+
+
+The Listing is generally carried out by field staff other than interviewers, as a separate field operation conducted before the survey starts. This pre-process has the following benefits
+
+1. It creates set of common questions to be asked before any survey is captured, as a one-time effort. For instance, the demographic details of household residents is required before conducting any household survey. Such data can be captured as part of the Listing.
+
+2. By creating a separate Listing the system gives the user flexibility to use the same Listing for multiple surveys.
+
+Listing is available from main menu under **Design** >> **Listing Form**
+
+Listing is a set of Questions that can be customized/configured for any survey by reusing same Listing.
+
+![Listing](./Listing1.png)
+
+###Creating New Listing
+
+
+To create a new Listing, click on the ‘Create New Listing Form’ button at top right of the Listing page, that opens a form to create a new Listing, which has following elements;
+
+![Listing](./Listing2.png)
+
+**Elements of Listing form**:
+
+* **Name**: Is Listing Name, which is a unique identity to a Listing and is a mandatory field.
+
+* **Description**: write about the importance of the Listing in short.
+
+* **Access channels**: This will identify on which channel this survey has to be conducted and has two channel ODK and USSD
+
+![Listing](./Listing3.png)
+
+A Listing Form is created by filling above all fields, finally clicking on ‘Save’ button to create Listing.
+
+**Search**: One can find Listings in the application, using the search bar at top right side of this Listing Form page, by providing Name or description.
+
+On the ‘Listing Form’ page one can view all the Listings created in the application, in a tabular form with following column names:
+
+**Sts**: Represents Status of the Listing by color indicator, that means each of the Color code indicates as:
+
+ •– Not Started
+ •– Ongoing
+ •– Completed
+
+**Name**: Is Name of the Listing, which is a unique identity to represent Listing and is a mandatory field.
+
+**Description**: A short description about Listing
+
+**Total Respondents**: once the listing operation is completed, this column will be updated with the count of participants/ respondents.
+
+**Action**: Each of the Listing has following Actions: ‘Edit’, ‘Delete’, ‘View/Edit Questions’, ‘View Data’ and ‘Clone’
+
+**Actions in Listing Form**:
+
+![Listing](./Listing4.png)
+
+* **Edit**: click on, Action Item ‘Edit’, User can Edit only the name of the Listing, Description and selection of Access channels (OBK, USSD)
+
+* **Delete**: click on, Action Item ‘Delete, the entire Listing is removed, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently.
+This option is not available for completed listing
+
+* **View/Edit Questions**: click on, Action Item ‘View/Edit Questions’, navigates to ‘Listing Questions’ page to View or Edit Respective Questions in Listing
+
+* **Clone**: click on, Action Item ‘Clone’, an another copy of same Listing Form is created along with Listing Questions, except existing Looping and Logic
+
+* **View Data**: This Action Item is available only for the completed Listing operation in the field. click on, Action Item ‘View Data’, to view data collected for this particular Listing
+
+![Listing](./Listing18.png)
+
+**Creating Questionnaire to the Listing Form**:
+
+On the ‘Listing Form’ page you can view all the Listings created in the application.
+
+To add new questions in Listing can be done in 2 ways
+
+1. Click on the Listing Name
+2. Click on Actions Drop down and select the item ‘View/Edit Questions’
+
+One can also select the questions from ‘Questions Library’ to add into Listing, using ‘Select Questions’
+
+**Add Questions in Listing Form**:
+
+Click on, ‘Add Question’ button at top right of the particular Listing page, this will open a form where one can create a Question, which has following elements;
+
+![Listing](./Listing15.png)
+
+**Elements in Listing Question form**:
+
+**Variables Name**: This is an identifier for Question, type a code for Question
+
+**Text**: Is the actual Question, Write a Question. While typing a question, auto suggestion feature is available, which will prompt with the ‘Variable Name’ of preceding questions, that helps to include “answered text of preceding question” in framing this question.
+i.e. just type, double curly brackets to automatically prompt with the ‘Variable Name’ from preceding questions,
+Ex: type {{ , system prompts with ‘Variable Name’ then select any one to insert Variable Name,
+Like: {{structure_address}}
+
+**Answer Type**: Select an Answer Type from dropdown list, such that Question has to be answered in any one of these formats only, that is ‘Answer type’ should be: “Audio, Auto Generate, Date, Geo Point, Image, Multi choice, Multi Select, Numeric, Text and Video”
+
+**Mandatory**: To mark the Question, that has to answered compulsory.
+
+A Question in Listing is created by filling above all fields, finally click on ‘Save’ button to Add Question in Listing or click on ‘Save and Add More’ button to continue adding another Question to the same Listing or click on ‘Save and Update Library’ to add same to the ‘Questions Library’.
+
+**Select Question**: On click, ‘Select Question’ button, User navigates to ‘Select Library Questions’ page where one can Add the Library Questions into Listing.
+
+![Listing](./Listing13.png)
+
+To Add Question from Library to Listing, just Click on “Code” or “Text” to move Question between (Library Questions << / >> Listing Questions) tables, then click on ‘Save’ button at bottom of this page, to finish adding Questions to Listing.
+
+**Search**: One can find Questions in Library by two ways:
+**Sort** questions using ‘Answer Type’ dropdown at top left side of this page. Or
+**Search** using the search bar at top right side of this page, by providing text or code.
+
+**Export Questions**: On click, ‘Export Questions’ button, user can download the Listing Questions in “.csv” file format.
+
+**Update Question Order**:
+Questions in the table can be rearranged.
+To change the order of the Question in table, just select the Question then drag (move up or down) and drop at new position/order you want to in the table, then click on ‘Update Question Order’ button at bottom of the Questions table.
+
+On the ‘Listing Questions’ page one can view all the Questions created in that particular Listing.
+
+**Search**: One can find Questions in Listing by two ways:
+**Sort** questions using ‘Answer Type’ dropdown at top left side of this page. Or
+**Search** using the search bar at top right side of this page, by providing text or code.
+
+**Actions for Listing Questions**:
+
+**Edit Question**: click on, Action Item ‘Edit’, User can Edit respective Question, ‘Variable Name’, ‘Text’ (Question), ‘Answer Type’ and can change ‘Mandatory’ type.
+
+**Insert Question**: click on, Action Item, ‘Insert Question’ using which User can insert a New Question below the respective Question and rest of the process is similar to ‘Add New Question’.
+
+**Delete Question**: click on, Action Item ‘Delete’, the Question is removed from list, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently.
+
+**Caution while deleting a Question**: when a user attempts to delete a question, if that particular question is assigned with Logic or Loop, then along with the question logic or entire loop is removed respectively.
+
+**View Options**: This Action item is visible only for the Questions that has Answer Type “Multi choice” and “Multi Select”, to view Answer Options.
+
+**Start/Edit Loop**:
+
+‘Start/Edit Loop’ is an Action item available only for the Questions that has Answer Type “Auto Generated”.
+
+![Listing](./Listing6.png)
+
+Looping means repeatedly asking set of questions based up the need and purpose of the base question.
+
+To define the Looping concept, first of all one has to understand about terms that are used in creating a Loop are as following:
+
+![Listing](./Listing8.png)
+
+**User Defined**: Need to choose what set of Question come into loop, starting from this particular question and has to end loop with any of the consecutive question in the Listing.
+
+![Listing](./Listing7.png)
+
+**Repeat Logic**: To apply Looping for a question there should be some base criteria to start loop, that is chosen from ‘Repeat Logic’ as “User Defined”, “Fixed number of repeats” and “Response from previous question”
+
+**Fixed number of repeats**: Is chosen, need to provide ‘Repeat count’ – any specific no of times loop to be repeated.
+
+![Listing](./Listing9.png)
+
+**Response from previous question**: Is chosen, only when a question that exists before this base question with Answer Type “Numerical Answer”. This logic is based up on numeric value provided in the previous question.
+
+![Listing](./Listing10.png)
+
+* **Loop Ends At**: When a loop starts that has to be closed, here the choice at which question the loop as to be closed is selected.
+
+![Listing](./Listing11.png)
+
+* **Loop Prompt**: This is a message prompt shown on Mobile App during the time of capturing this details. This message will help the Interviewer to proceed further.
+
+![Listing](./Listing12.png)
+
+###How to create a Loop?
+
+
+One should be very careful while creating a loop, first of all analyze how a loop has to be created, using ‘Repeat logic’ and where to ‘End Loop’, as defined above select accordingly from ‘Repeat logic’ and ‘Loop end at’ to define a loop.
+
+click on, Action Item ‘Start/Edit Loop’ which will take to ‘Start Loop’ page, now create loop as follows:
+
+* select “Logic Type” from dropdown ‘Repeat logic’,
+* select “Question at which loop should end” from dropdown ‘Loop end at’ and
+* in ‘Loop Prompt’ Text Box, write some message about, instructing the loop flow,
+* then click on ‘Save’ button to create loop
+
+Now you will be viewing a looping representation on ‘Listing Questions’ page in the ‘Code’ column of the ‘Questions’ table
+
+![Listing](./Listing5.png)
+
+**Loop Representation**:
+
+* | - icon represents Loop - START,
+
+* | - icon represents Loop - END,
+
+* | - icon represents Loop - CONTINUATION
+
+**Remove Loop**:
+
+This Action item available only for the Questions that has Answer Type “Auto Generated” and a Loop is created.
+click on, Action Item ‘Remove Loop’ which will remove the existing looping logic.
+
+**Add Logic**:
+
+‘Add Logic’ is an Action item for every question expect for the Questions that has Answer Type “Auto Generated”.
+
+![Listing](./Listing16.png)
+
+Add Logic option will convert a question to conditional one such that question will have choices to “Reconfirm”, “End Interview”, “Ask Sub-Question” and “Skip To” which is based up on value/Answer provided.
+
+one has to define the Logic here for respective question by satisfying the condition by providing ‘Eligible Criteria’, ‘Attribute’ Value, and ‘Then’ as follows:
+
+![Listing](./Listing17.png)
+
+**Eligible Criteria**: This is a condition made based up on this Question value “Starts With”, “Equals”, “Contains” and “Ends With”.
+
+**Attribute**: Provide the “Value” as per the above ‘Eligible Criteria’ selected
+
+**Then**: Based up on the ‘Eligible Criteria’ and ‘Attribute’ Value chosen, the condition for Question is applied here with following options:
+
+* ‘Reconfirm’ – Prompts with conformation Question to validate the Answer
+
+* ‘End Interview’ – Skips the intermediate Question and moves to end of the questioner.
+
+* ‘Ask Sub-Question’ – Provides an option to Create a Sub-Question based upon the ‘Attribute’ value.
+
+To do this, select option “Ask Sub-Question” than you will find a button with name ‘Add Sub-Question’ beside this,
+click on it to create a Sub-Question, same like create question, once you click on ‘Save’ button, you will find this Sub-Question in the dropdown ‘Choose Question’
+beside it, now select the “Sub-Question” and click on ‘Save’ button.
+
+* ‘Skip To’ - Provides the option to jump to any particular/ consecutive question in the list, by skipping / avoiding the intermediate Question.
+
+**How to Apply Logic to a Question?**
+
+Click on, Action Item, ‘Add Logic’ this will open a form where one can create a Logic for Question, by providing ‘Eligible Criteria’, ‘Attribute’ Value, and ‘Then’ as per the condition required, then click on ‘Save’ button to create Logic.
+
+In the same page, logic that is created can be seen in table “Existing Logic”.
+Which shows the created logic for this particular question and has option to ‘Delete’ the applied Logic
+
+**Edit Logic**:
+In the ‘Listing Form Questions Template’ page, Questions that has Logic are represented with hyperlink, click on the respective Question, that shows options to ‘View logic’, ‘Edit’ and ‘Delete’
+
+* **View Logic**: click to view the Logic that is Applied for this particular question
+
+* **Edit Logic**: click to Edit the existing Logic that is Applied for this particular question
+
+* **Delete Logic**: click to Remove the Logic that is Applied for this particular question
\ No newline at end of file
diff --git a/docs/Listing1.png b/docs/Listing1.png
new file mode 100644
index 00000000..99062556
Binary files /dev/null and b/docs/Listing1.png differ
diff --git a/docs/Listing10.png b/docs/Listing10.png
new file mode 100644
index 00000000..b20c6432
Binary files /dev/null and b/docs/Listing10.png differ
diff --git a/docs/Listing11.png b/docs/Listing11.png
new file mode 100644
index 00000000..c607f633
Binary files /dev/null and b/docs/Listing11.png differ
diff --git a/docs/Listing12.png b/docs/Listing12.png
new file mode 100644
index 00000000..71236920
Binary files /dev/null and b/docs/Listing12.png differ
diff --git a/docs/Listing13.png b/docs/Listing13.png
new file mode 100644
index 00000000..68a1d4a7
Binary files /dev/null and b/docs/Listing13.png differ
diff --git a/docs/Listing14.png b/docs/Listing14.png
new file mode 100644
index 00000000..06219051
Binary files /dev/null and b/docs/Listing14.png differ
diff --git a/docs/Listing15.png b/docs/Listing15.png
new file mode 100644
index 00000000..4ca4c6d4
Binary files /dev/null and b/docs/Listing15.png differ
diff --git a/docs/Listing16.png b/docs/Listing16.png
new file mode 100644
index 00000000..d565a657
Binary files /dev/null and b/docs/Listing16.png differ
diff --git a/docs/Listing17.png b/docs/Listing17.png
new file mode 100644
index 00000000..b2fd75ff
Binary files /dev/null and b/docs/Listing17.png differ
diff --git a/docs/Listing18.png b/docs/Listing18.png
new file mode 100644
index 00000000..dfaafded
Binary files /dev/null and b/docs/Listing18.png differ
diff --git a/docs/Listing2.png b/docs/Listing2.png
new file mode 100644
index 00000000..9b1088f0
Binary files /dev/null and b/docs/Listing2.png differ
diff --git a/docs/Listing3.png b/docs/Listing3.png
new file mode 100644
index 00000000..b48bdd19
Binary files /dev/null and b/docs/Listing3.png differ
diff --git a/docs/Listing4.png b/docs/Listing4.png
new file mode 100644
index 00000000..ece38333
Binary files /dev/null and b/docs/Listing4.png differ
diff --git a/docs/Listing5.png b/docs/Listing5.png
new file mode 100644
index 00000000..446bd56e
Binary files /dev/null and b/docs/Listing5.png differ
diff --git a/docs/Listing6.png b/docs/Listing6.png
new file mode 100644
index 00000000..ddd78e22
Binary files /dev/null and b/docs/Listing6.png differ
diff --git a/docs/Listing7.png b/docs/Listing7.png
new file mode 100644
index 00000000..8a1daa5a
Binary files /dev/null and b/docs/Listing7.png differ
diff --git a/docs/Listing8.png b/docs/Listing8.png
new file mode 100644
index 00000000..a608fb48
Binary files /dev/null and b/docs/Listing8.png differ
diff --git a/docs/Listing9.png b/docs/Listing9.png
new file mode 100644
index 00000000..9433e388
Binary files /dev/null and b/docs/Listing9.png differ
diff --git a/docs/Login.png b/docs/Login.png
new file mode 100644
index 00000000..6171788e
Binary files /dev/null and b/docs/Login.png differ
diff --git a/docs/Map1.png b/docs/Map1.png
new file mode 100644
index 00000000..342a5338
Binary files /dev/null and b/docs/Map1.png differ
diff --git a/docs/Map2.png b/docs/Map2.png
new file mode 100644
index 00000000..7d5dc4a8
Binary files /dev/null and b/docs/Map2.png differ
diff --git a/docs/Map_groupZ_selected.png b/docs/Map_groupZ_selected.png
new file mode 100644
index 00000000..2215d14b
Binary files /dev/null and b/docs/Map_groupZ_selected.png differ
diff --git a/docs/Module1.png b/docs/Module1.png
new file mode 100644
index 00000000..0a3d0712
Binary files /dev/null and b/docs/Module1.png differ
diff --git a/docs/Module2.png b/docs/Module2.png
new file mode 100644
index 00000000..5bf689d8
Binary files /dev/null and b/docs/Module2.png differ
diff --git a/docs/Module3.png b/docs/Module3.png
new file mode 100644
index 00000000..4a76eea6
Binary files /dev/null and b/docs/Module3.png differ
diff --git a/docs/Module4.png b/docs/Module4.png
new file mode 100644
index 00000000..a0c5b607
Binary files /dev/null and b/docs/Module4.png differ
diff --git a/docs/Modules.md b/docs/Modules.md
new file mode 100644
index 00000000..f9c580fa
--- /dev/null
+++ b/docs/Modules.md
@@ -0,0 +1,28 @@
+###Modules:
+Modules are Survey based classification based up on survey type and need.
+Modules are available from main menu under, Design >> Modules
+
+![Module](./Module1.png)
+
+To create a new Module, click on ‘Add Module’ button at top right of the Modules page, that opens a form to create a new Module.
+
+![Module](./Module2.png)
+
+Elements of Module:
+
+Name: Name of a Module, which is a unique identity to a Module and is a mandatory field.
+
+Description: A short description about Module
+
+![Module](./Module3.png)
+
+A Module is created by providing above field and click on ‘Create’ button to Create a Module.
+
+On the ‘Modules’ page you can view all the Modules created in the application. each of these Module has Actions to ‘Edit’ and ‘Delete’.
+
+Actions in Modules:
+
+![Module](./Module4.png)
+
+* Edit Module: click on, Action Item ‘Edit’, User can Edit Name and Description of the Module.
+* Delete Module: click on, Action Item ‘Delete, the Module is removed, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently.
\ No newline at end of file
diff --git a/docs/ODK-1.png b/docs/ODK-1.png
new file mode 100644
index 00000000..5fd4d599
Binary files /dev/null and b/docs/ODK-1.png differ
diff --git a/docs/ODK-10.png b/docs/ODK-10.png
new file mode 100644
index 00000000..c8ed8f53
Binary files /dev/null and b/docs/ODK-10.png differ
diff --git a/docs/ODK-11.png b/docs/ODK-11.png
new file mode 100644
index 00000000..ee51c259
Binary files /dev/null and b/docs/ODK-11.png differ
diff --git a/docs/ODK-12.png b/docs/ODK-12.png
new file mode 100644
index 00000000..c921a4f5
Binary files /dev/null and b/docs/ODK-12.png differ
diff --git a/docs/ODK-13.png b/docs/ODK-13.png
new file mode 100644
index 00000000..7dc7f0bf
Binary files /dev/null and b/docs/ODK-13.png differ
diff --git a/docs/ODK-14.png b/docs/ODK-14.png
new file mode 100644
index 00000000..26449fc2
Binary files /dev/null and b/docs/ODK-14.png differ
diff --git a/docs/ODK-15.png b/docs/ODK-15.png
new file mode 100644
index 00000000..def4001d
Binary files /dev/null and b/docs/ODK-15.png differ
diff --git a/docs/ODK-16.png b/docs/ODK-16.png
new file mode 100644
index 00000000..5aec2c8c
Binary files /dev/null and b/docs/ODK-16.png differ
diff --git a/docs/ODK-17.png b/docs/ODK-17.png
new file mode 100644
index 00000000..59523153
Binary files /dev/null and b/docs/ODK-17.png differ
diff --git a/docs/ODK-18.png b/docs/ODK-18.png
new file mode 100644
index 00000000..5ec6ad0e
Binary files /dev/null and b/docs/ODK-18.png differ
diff --git a/docs/ODK-19.png b/docs/ODK-19.png
new file mode 100644
index 00000000..ee95768b
Binary files /dev/null and b/docs/ODK-19.png differ
diff --git a/docs/ODK-2.png b/docs/ODK-2.png
new file mode 100644
index 00000000..4fe46cf3
Binary files /dev/null and b/docs/ODK-2.png differ
diff --git a/docs/ODK-20.png b/docs/ODK-20.png
new file mode 100644
index 00000000..aaf1a671
Binary files /dev/null and b/docs/ODK-20.png differ
diff --git a/docs/ODK-21.png b/docs/ODK-21.png
new file mode 100644
index 00000000..4ca1526e
Binary files /dev/null and b/docs/ODK-21.png differ
diff --git a/docs/ODK-22.png b/docs/ODK-22.png
new file mode 100644
index 00000000..df660e0b
Binary files /dev/null and b/docs/ODK-22.png differ
diff --git a/docs/ODK-23.png b/docs/ODK-23.png
new file mode 100644
index 00000000..1ee11756
Binary files /dev/null and b/docs/ODK-23.png differ
diff --git a/docs/ODK-24.png b/docs/ODK-24.png
new file mode 100644
index 00000000..7419530c
Binary files /dev/null and b/docs/ODK-24.png differ
diff --git a/docs/ODK-25.png b/docs/ODK-25.png
new file mode 100644
index 00000000..3260ca16
Binary files /dev/null and b/docs/ODK-25.png differ
diff --git a/docs/ODK-26.png b/docs/ODK-26.png
new file mode 100644
index 00000000..d7bd41fb
Binary files /dev/null and b/docs/ODK-26.png differ
diff --git a/docs/ODK-27.png b/docs/ODK-27.png
new file mode 100644
index 00000000..7ad0117d
Binary files /dev/null and b/docs/ODK-27.png differ
diff --git a/docs/ODK-28.png b/docs/ODK-28.png
new file mode 100644
index 00000000..3e8aefe3
Binary files /dev/null and b/docs/ODK-28.png differ
diff --git a/docs/ODK-29.png b/docs/ODK-29.png
new file mode 100644
index 00000000..79f95f4d
Binary files /dev/null and b/docs/ODK-29.png differ
diff --git a/docs/ODK-2_1.png b/docs/ODK-2_1.png
new file mode 100644
index 00000000..b0acf376
Binary files /dev/null and b/docs/ODK-2_1.png differ
diff --git a/docs/ODK-2_2.png b/docs/ODK-2_2.png
new file mode 100644
index 00000000..9e744bee
Binary files /dev/null and b/docs/ODK-2_2.png differ
diff --git a/docs/ODK-2_3.png b/docs/ODK-2_3.png
new file mode 100644
index 00000000..a64973a5
Binary files /dev/null and b/docs/ODK-2_3.png differ
diff --git a/docs/ODK-2_4.png b/docs/ODK-2_4.png
new file mode 100644
index 00000000..e7629358
Binary files /dev/null and b/docs/ODK-2_4.png differ
diff --git a/docs/ODK-2_5.png b/docs/ODK-2_5.png
new file mode 100644
index 00000000..3cb8dfef
Binary files /dev/null and b/docs/ODK-2_5.png differ
diff --git a/docs/ODK-2_6.png b/docs/ODK-2_6.png
new file mode 100644
index 00000000..b33c7414
Binary files /dev/null and b/docs/ODK-2_6.png differ
diff --git a/docs/ODK-3.png b/docs/ODK-3.png
new file mode 100644
index 00000000..a2583983
Binary files /dev/null and b/docs/ODK-3.png differ
diff --git a/docs/ODK-30.png b/docs/ODK-30.png
new file mode 100644
index 00000000..836b1bd8
Binary files /dev/null and b/docs/ODK-30.png differ
diff --git a/docs/ODK-31.png b/docs/ODK-31.png
new file mode 100644
index 00000000..b1971fc2
Binary files /dev/null and b/docs/ODK-31.png differ
diff --git a/docs/ODK-32.png b/docs/ODK-32.png
new file mode 100644
index 00000000..a6210036
Binary files /dev/null and b/docs/ODK-32.png differ
diff --git a/docs/ODK-33.png b/docs/ODK-33.png
new file mode 100644
index 00000000..b4b771ff
Binary files /dev/null and b/docs/ODK-33.png differ
diff --git a/docs/ODK-34.png b/docs/ODK-34.png
new file mode 100644
index 00000000..65cfb3a6
Binary files /dev/null and b/docs/ODK-34.png differ
diff --git a/docs/ODK-4.png b/docs/ODK-4.png
new file mode 100644
index 00000000..d0b8e5c9
Binary files /dev/null and b/docs/ODK-4.png differ
diff --git a/docs/ODK-5.png b/docs/ODK-5.png
new file mode 100644
index 00000000..b6aa7980
Binary files /dev/null and b/docs/ODK-5.png differ
diff --git a/docs/ODK-6.png b/docs/ODK-6.png
new file mode 100644
index 00000000..f0c73e40
Binary files /dev/null and b/docs/ODK-6.png differ
diff --git a/docs/ODK-7.png b/docs/ODK-7.png
new file mode 100644
index 00000000..d5305bbc
Binary files /dev/null and b/docs/ODK-7.png differ
diff --git a/docs/ODK-8.png b/docs/ODK-8.png
new file mode 100644
index 00000000..c49b4da9
Binary files /dev/null and b/docs/ODK-8.png differ
diff --git a/docs/ODK-9.png b/docs/ODK-9.png
new file mode 100644
index 00000000..30c35970
Binary files /dev/null and b/docs/ODK-9.png differ
diff --git a/docs/ODK_App.md b/docs/ODK_App.md
new file mode 100644
index 00000000..0ac51bdb
--- /dev/null
+++ b/docs/ODK_App.md
@@ -0,0 +1,301 @@
+###Introduction
+
+uSurvey portal is intended to design and define the Listings, Surveys and monitor statistical reports. On other end in the field, data collection and submission is done using hand-held mobile devices in two ways.
+
+1. Offline Data Collection - Using Smart Phone
+2. Online Data Collection - Using Featured Phone
+
+Hence to collect real time data, both offline and online methods are implemented.
+ In the locations, where there is a mobile phone network connectivity is available, data is transmitted to server instantly via USSD channel, using Featured Phone.
+ Whereas, in isolated mobile phone network connectivity locations, data collection is done offline via uSurvey App, using Smart Phones. Thus, data collected stores temporally in the hand-held device and transmits to the server later time, once reaches to a location with Internet connectivity.
+
+Ultimately uSurvey application make paperless work and carry out Survey in a digitalized process with increased ease and accuracy of data. Which results in the release of Survey reports timely.
+
+###Offline Data Collection
+------
+#####About uSurvey App
+
+**Data collection and submission using Android Smart Phone**
+
+uSurvey App is exclusively designed for survey data collection and submission using the hand-held mobile devices (Android Smart Phone/ Tablet). Thus using rich text forms, also supports media files, captures GPS location, stores data locally and works offline.
+
+**Implementing uSurvey App**
+
+Conducting Survey using uSurvey App is simple.
+
+Enrolled Interviewers, has to do data collection and submission using Android App, uSurvey App is available on Google play store.
+
+**uSurvey App Installation**
+
+ Interviewers has to download uSurvey App form Google play store, as follows
+
+* On Android device, go to Google play store
+* Search for “uSurvey” and choose uSurvey App from search results
+* Select ‘uSurvey App’ in the result and click the Install button
+* Click OK after viewing the security settings
+* Once App installation is done, now uSurvey App is available in application list and ready to launch, as shown below in Mobile Screen-1
+* Now launch uSurvey App on mobile
+
+![ODK](./ODK-1.png)
+ Mobile Screen-1
+
+App Home/landing screen has following options, as shown below in Mobile Screen-2
+
+![ODK](./ODK-2.png)
+ Mobile Screen-2
+
+**Configure uSurvey App**
+
+For first time use and when app reset is done, one has to provide, App user credentials as a part of one-time configuration settings as follows:
+
+* To configure, press the Menu button on the phone while the app is opened, then Select ‘General Settings’, takes you to a new screen to change setting
+ as shown below in Mobile Screen-3
+
+![ODK](./ODK-3.png)
+ Mobile Screen-3
+
+* Now under ‘Server Settings’ select ‘Configure platform settings’, as shown below in Mobile Screen-4
+
+![ODK](./ODK-4.png)
+ Mobile Screen-4
+
+* In ‘Configure platform settings’ under ‘ODK Aggregate Settings’, make sure that, URL should be http://usurvey.unicefuganda.org/odk/collect/forms
+
+![ODK](./ODK-5.png)
+ Mobile Screen-5
+
+* Username: enter ‘ODK ID’ of the Interviewer
+* Password: enter ‘ODK Token’ of the Interviewer (For above details, you need an interviewer defined on uSurvey portal and defined with an ODK ID)
+
+![ODK](./ODK-6.png)
+ Mobile Screen-6
+
+* Now come back to App Home screen using Mobile back key
+
+**Using uSurvey App**
+
+Follow these simple steps for survey Data collection:
+Get Blank Form, Fill Blank Form, Edit Save Form, Send Finalized Form, Download Data Forms, Search Forms and Edit Download Form
+
+######Step -1: Get Blank Form
+
+Once App is opened, in the Home screen hit on ‘Get Blank Form’ to download blank form, then you will be prompted “Please enter User name and Password for server”, then Interviewer has to conform his/her User name and Password, to proceed by clicking on ‘OK’. As shown in below Mobile Screen-7
+
+![ODK](./ODK-2_3.png)
+ Mobile Screen-7
+
+![ODK](./ODK-7.png)
+ Mobile Screen-8
+
+Now you will be navigated to this below Mobile Screen-9, Select ‘Blank Form’ from list, usually blank forms, show with ‘Survey –Listing’ names and hit on ‘Get Selected’ As shown in below Mobile Screen-9, then Hit ‘OK’
+
+![ODK](./ODK-8.png)
+ Mobile Screen-9
+
+![ODK](./ODK-9.png)
+ Mobile Screen-10
+
+![ODK](./ODK-10.png)
+ Mobile Screen-11
+
+
+######Step -2: Fill Blank Form
+
+In the Home Screen hit on ‘Fill Blank Form’ to fill questionnaire as part of data collection. Now select any of one the forms listed here. As shown in below Mobile Screen-12
+
+![ODK](./ODK-2_1.png)
+ Mobile Screen-12
+
+![ODK](./ODK-11.png)
+ Mobile Screen-13
+
+![ODK](./ODK-12.png)
+ Mobile Screen-14
+
+Now opens the actual questionnaire, to proceed filling the form - Just swipe forward and backward, then finally you will see ‘Save Survey and Exit’ hit to save.
+
+![ODK](./ODK-13.png)
+ Mobile Screen-15
+
+As part of questionnaire, the very first question is “Select Enumeration Area” where you have to select any one of the Enumeration Area, which is mandatory and proceed to answer next question.
+Be very careful while selecting the Enumeration Area, once from is submitted there is no change to edit Enumeration Area.
+
+![ODK](./ODK-14.png)
+ Mobile Screen-16
+
+Once filling the questionnaire is completed, you will be prompt with message “You are at the end of the ---- form” and select ‘Mark form as Finalized’ then hit on ‘Save Survey and Exit’.
+
+![ODK](./ODK-15.png)
+ Mobile Screen-17
+
+
+######Step -3: Edit Saved form
+
+This feature provides, option to view or edit completed questionnaire, including Enumeration Area before submission.
+
+In the Home Screen hit on ‘Edit Saved form’ to edit filled questionnaire. As shown in below Mobile Screen-18
+
+![ODK](./ODK-2_2.png)
+ Mobile Screen-18
+
+You can select any form from list to view or edit, usually filled forms, show with ‘Survey –Listing’ names, tap on the listed items to proceed view or edit filled questionnaire, once changes are done, don’t forget to hit on ‘Save Survey and Exit’.
+ At any instance of the from, one can exit the current form from undo by hitting on Mobile back key, which prompt with message to ‘Save Changes’, ‘Ignore Changes’ and ‘Cancel’ to the Form.
+
+![ODK](./ODK-16.png)
+ Mobile Screen-19
+
+![ODK](./ODK-28.png)
+ Mobile Screen-20
+
+![ODK](./ODK-29.png)
+ Mobile Screen-21
+
+![ODK](./ODK-30.png)
+ Mobile Screen-22
+
+![ODK](./ODK-31.png)
+ Mobile Screen-23
+
+
+######Step -4: Send Finalized Form
+
+The process of transmitting the completed forms to server, when there is an internet connectivity.
+
+Now in the Home Screen hit on ‘Send Finalized Form’ to submit the completed questionnaire forms, As shown in below Mobile Screen-24
+
+![ODK](./ODK-17.png)
+ Mobile Screen-24
+
+Now you will be navigated to this below shown, Mobile Screen-25, Select forms individually or hit on ‘Toggle All’ to select all forms in the list, then hit on ‘Send Selected’. As shown in below Mobile Screen-26,
+ if again you will be prompted “Please enter User name and Password for server”, then conform your credentials once again by clicking on ‘OK’. You will get success message if from is submitted or respective error message is shown.
+
+![ODK](./ODK-18.png)
+ Mobile Screen-25
+
+![ODK](./ODK-19.png)
+ Mobile Screen-26
+
+![ODK](./ODK-20.png)
+ Mobile Screen-27
+
+![ODK](./ODK-21.png)
+ Mobile Screen-28
+
+
+######Step -5: Download Data Forms
+
+The feature to download completed Listing and Survey forms from server to make any changes.
+
+In the Home Screen hit on ‘Download Data Form’ to get list of recent/current submitted forms. Now screen opens with the complete list of submitted forms, select forms individually or hit on ‘Toggle All’ to select all forms in the list, then hit on ‘Get Selected’. As shown in below Mobile Screen-29,
+
+![ODK](./ODK-2_6.png)
+ Mobile Screen-29
+
+![ODK](./ODK-22.png)
+ Mobile Screen-30
+
+![ODK](./ODK-23.png)
+ Mobile Screen-31
+
+Then download starts, which takes several minutes, depends up on your Internet speed. As shown below Mobile Screen-32
+
+![ODK](./ODK-24.png)
+ Mobile Screen-32
+
+Note: Once Forms are downloaded then these forms are available from ‘Edit Saved Form’ and ‘Search Forms’
+
+######Step -6: Search Forms
+
+The feature to find completed Listing and Survey forms, to view or edit filled questionnaire.
+
+In the Home Screen hit on ‘Search Forms’ to start searching for forms, which opens a search screen, where an Interviewer can search a beneficiary using data in the filled questionnaire and Hit on Search Icon in Key Pad, as shown in below Mobile Screen-33
+
+![ODK](./ODK-2_5.png)
+ Mobile Screen-33
+
+![ODK](./ODK-25.png)
+ Mobile Screen-34
+
+![ODK](./ODK-26.png)
+ Mobile Screen-35
+
+If the search criteria match the input data, then screen will show up with list of forms that matches entered key word, Interviewer has to Identify and select the exact beneficiary to view or edit the details.
+
+######Edit Download Form
+
+This feature provides, option to view or edit download questionnaire forms and resubmit.
+
+In the Home Screen hit on ‘Edit Saved form’ to edit filled questionnaire. As shown in below Mobile Screen-36
+
+![ODK](./ODK-2_2.png)
+ Mobile Screen-36
+
+You can select any form from list to view or edit, usually these forms, show with ‘Survey –Listing’ names, tap on the listed items or hit on ‘Go To Start’ to proceed view or edit filled questionnaire, once changes are done, don’t forget to hit on ‘Save Survey and Exit’. If any changes are done,
+ don’t forget to repeat the steps in Send Finalized Form
+
+ ![ODK](./ODK-27.png)
+ Mobile Screen-37
+
+ ![ODK](./ODK-28.png)
+ Mobile Screen-38
+
+ ![ODK](./ODK-29.png)
+ Mobile Screen-39
+
+ ![ODK](./ODK-30.png)
+ Mobile Screen-40
+
+There is an option to Exit Form by pressing the default ‘BACK’ button of the Mobile at any time while filling or using this App, which prompt with message to ‘Save Changes’, ‘Ignore Changes’ and ‘Cancel’ to the Form. As shown in below Mobile Screen-41
+
+ ![ODK](./ODK-31.png)
+ Mobile Screen-41
+
+######Delete Saved Form
+
+This feature allows user to remove the Forms from local device, to clear the local data.
+
+In the Home Screen hit on ‘Delete Saved form’ to remove Forms.
+As shown in below Mobile Screen-42
+
+ ![ODK](./ODK-2_4.png)
+ Mobile Screen-42
+
+This screen is divided into two tabs,
+**Saved Forms**: Shows list of all completed forms.
+**Blank Forms**: Shows list of all blank forms.
+
+ ![ODK](./ODK-32.png)
+ Mobile Screen-43
+
+To delete, select forms individually or hit on ‘Toggle All’ to select all forms in the list, then hit on ‘Delete Selected Survey Forms’
+
+ ![ODK](./ODK-33.png)
+ Mobile Screen-44
+
+ ![ODK](./ODK-34.png)
+ Mobile Screen-45
+
+
+
+###Online Data Collection
+------
+#####USSD Integration
+uSurvey fully supports survey participation on USSD using the interactive menu capability of the USSD platform. To begin, from uSurvey portal, interviewers are sent SMS with details of the code to dial in order to commence data collection (e.g. *256#). The interviewer dials the code and then the survey starts.
+
+![USSD Participation](./ussd-code-example.jpg)
+
+#####What do I need to conduct survey on USSD?
+
+1. Any mobile phone would do.
+2. You need a USSD Aggregator.
+3. You need to choose a mobile network which supports your chosen USSD Aggregator.
+4. You need your chosen USSD Aggregator to forward USSD messages to uSurvey as follows:
+ * Requests can be sent as a HTTP GET or a POST to uSurvey USSD end point.
+ * If you have hosted uSurvey with host IP `HOST_IP` and port `APP_PORT`, the USSD end point is `HTTP(s)://HOST_IP:APP_PORT/ussd`.
+ * At a minimum, following parameters need to be sent to uSurvey USSD API from the aggregator:
+ * `msisdn:` This parameter holds the mobile number of the responding interviewer.
+ * `ussdRequestString:` This parameter holds the input string sent by the interviewer.
+ * `transactionId:` This parameter holds the session ID of the USSD Interaction.
+5. You need to maintain connectivity to your mobile network (Since USSD participation requires an active USSD session).
+6. Now assign the interviewer to the relevant Survey and Enumeration area (for more info on this see the relevant section in the [User manual](./user_manual.md#interviewer-page "Interviewer Page"))
+
\ No newline at end of file
diff --git a/docs/Page01.png b/docs/Page01.png
new file mode 100644
index 00000000..b933f3fa
Binary files /dev/null and b/docs/Page01.png differ
diff --git a/docs/Page02.png b/docs/Page02.png
new file mode 100644
index 00000000..e3757f97
Binary files /dev/null and b/docs/Page02.png differ
diff --git a/docs/Page03.png b/docs/Page03.png
new file mode 100644
index 00000000..40cb256c
Binary files /dev/null and b/docs/Page03.png differ
diff --git a/docs/Page04.png b/docs/Page04.png
new file mode 100644
index 00000000..ece85ed5
Binary files /dev/null and b/docs/Page04.png differ
diff --git a/docs/Page1v1.png b/docs/Page1v1.png
new file mode 100644
index 00000000..f0824a6d
Binary files /dev/null and b/docs/Page1v1.png differ
diff --git a/docs/Page2v1.png b/docs/Page2v1.png
new file mode 100644
index 00000000..dd898f95
Binary files /dev/null and b/docs/Page2v1.png differ
diff --git a/docs/Page3_v1.png b/docs/Page3_v1.png
new file mode 100644
index 00000000..5e0a424c
Binary files /dev/null and b/docs/Page3_v1.png differ
diff --git a/docs/QL1.png b/docs/QL1.png
new file mode 100644
index 00000000..885318ea
Binary files /dev/null and b/docs/QL1.png differ
diff --git a/docs/QL2.png b/docs/QL2.png
new file mode 100644
index 00000000..a8b23b6b
Binary files /dev/null and b/docs/QL2.png differ
diff --git a/docs/QL3.png b/docs/QL3.png
new file mode 100644
index 00000000..11cd92e7
Binary files /dev/null and b/docs/QL3.png differ
diff --git a/docs/QL4.png b/docs/QL4.png
new file mode 100644
index 00000000..6c3c6178
Binary files /dev/null and b/docs/QL4.png differ
diff --git a/docs/Site_Map.md b/docs/Site_Map.md
new file mode 100644
index 00000000..2cfbfed1
--- /dev/null
+++ b/docs/Site_Map.md
@@ -0,0 +1,53 @@
+
+###Process flow:
+
+![uSurvey Flow](./uSurvey_flow.png)
+
+
+###Overview:
+
+![uSurvey Menu](./uSurvey_LOC.jpg)
+
+
+###Sitemap:
+-----------
+###uSurvey Home
+
+* **Dashboard**
+
+* **Design**
+ * [Survey](./Survey.md)
+ * [Listing](./Listing.md)
+ * [Modules](./Modules.md)
+ * [Groups](./Groups.md)
+ * [Question Library](./Library.md)
+
+* **Administration**
+ * [Interviewers](./Interviewer.md)
+ * [Notification](#)
+ * [Data Entry](#)
+
+* **Monitor**
+ * [Listing Data](#)
+ * [Batch Data](#)
+ * [Completion Summary](#)
+ * [ODK Submission](./ODK_App.md)
+
+* **Analyse**
+ * [Indicators](./Indicators.md)
+ * [Location Weights](#)
+
+* **Download**
+ * [Survey Data](#)
+ * [Mobile Money Sheet](#)
+
+* **Settings**
+ * [Users](#)
+ * [Locations](#)
+ * [Setup](#)
+
+* **User Profile**
+ * [User](#)
+ * [Active Power Mode](#)
+ * [Change Password](#)
+ * [Logout](#)
\ No newline at end of file
diff --git a/docs/Survey.md b/docs/Survey.md
new file mode 100644
index 00000000..e104423d
--- /dev/null
+++ b/docs/Survey.md
@@ -0,0 +1,273 @@
+###Create Survey
+
+Surveys are available from main menu under **Design** >> **Surveys**
+![Survey0](./Survey1.png)
+Screen-1
+
+A New Survey can be created and defined here, so before creating a survey first of all one has to know about the terminology used here.
+
+* **Preferred Listing**: List of existing Listing, which are already in the system.
+Is an option to choose, existing Listing for this New Survey, where already survey was conducted on these Listings, which will include total Listing questions along with the data/results.
+
+* **New Listing**: List of Newly created Listings, not previously used in any survey.
+This field will enable only if option “None, Create New” is selected, in the dropdown ‘Preferred Listing’. which contains list of Newly created Listings, which are not yet used in any survey.
+
+* **Randomly selected data label**: Is the identifier for respondents while conducting a Listing survey.
+ This field will enable only when listing in dropdown ‘New Listing’ is selected.
+
+**How to create a Survey?**
+To create a New Survey, click on ‘Create New Survey’ button at top right of the Survey page, that opens a form to create a new Survey, which has following elements;
+
+![Survey1](./Survey2.png)
+Screen-2
+
+**Elements of a Survey**:
+
+![Survey2](./Survey3.png)
+
+* **Name**: Is Survey Name, which is a unique identity to a survey and is a mandatory field
+* **Description**: write about the importance of this survey in short
+* **Survey Type**: This identifies how survey is going to take place either using Listing or not
+ If Survey Type is “Sampled”, Survey uses Sample size and Listing
+ If Survey Type is “Census”, Survey doesn’t need Sample size and Listing
+
+* **Sample size**: Provide survey sample size
+* **Preferred Listing**: select an existing Listing Or
+* **New Listing**: select Newly created Listing
+* **Randomly selected data label**: You need to include one listing response identifier in double curly brackets.
+ i.e. just type, double curly brackets to automatically insert ‘Variable Name’ in above selected Listing
+ Ex: type {{ , system prompts with ‘Variable Name’ then select any one to insert Variable Name
+ Like: {{house_number}}
+* **Email group**: select, User Emails Id to send report
+
+A New Survey is created by providing above fields and click on ‘Save’ button to Create a Survey.
+
+**Search**: One can find Surveys in the application, using the search bar at top right side of this survey page, by providing Name or description.
+
+On the ‘Survey’ page one can view all the Survey created in the application, in a tabular form with following column names:
+
+![Survey2](./Survey4.png)
+
+**Sts**: Represents Status of the Survey by color indicator, that means each of the Color code indicates as:
+ • – Not Started
+ • – Ongoing
+ • – Completed
+
+* **Name**: Is Name of a Survey, which is a unique identity to represent Survey and is a mandatory field.
+* **Description**: A short description about Listing
+* **Type**: Survey type Sampled or Census
+* **Sample size**: Provide survey sample size
+* **Total Respondents**: once the Survey is completed, this column will be updated with the count of participants/ respondents.
+* **Eas Covered**: Count of Enumeration areas covered in this particular survey.
+
+**Actions in Survey**:
+
+* **Edit Survey**: click on, Action Item ‘Edit’, User can Edit all fields in the Survey
+* **Delete Survey**: click on, Action Item ‘Delete, the entire Survey is removed, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently. This option is not available for completed Survey
+* **View Batches in Survey**: click on, Action Item ‘View Batches’, navigates to ‘Survey Batches’ page
+* **Clone a Survey**: click on, Action Item ‘Clone’, an another copy of same Survey is created along with Survey Batches and Batch Questions, except existing Looping and Logic in Batch Questions
+* **Sampling Criteria**:
+
+###Batches
+Batch is a categorization of Survey Questions, that means set of Questions categorized for a Survey convenience. We can create multiple Batches in a survey.
+
+Once the Survey is created, next step is to create ‘Batch’ and ‘Add Questions’ to Batch.
+
+**How to create a Batch?**
+
+Go to Batches Page, which can be done in two ways
+On the ‘Survey’ page you can view all the Survey created in the application
+Now click on Survey Name, or click on, Action Item ‘View Batches’ to go to ‘Batches’ Page
+
+![Batch](./Batch1.png)
+
+To create a New Batch, click on ‘Create New Batch’ button at top right of the Batch page, that opens a form to create a new Batch, which has following elements;
+
+![Batch](./Batch2.png)
+
+**Elements of a Batch**:
+
+* **Name**: Is Batch Name, which is a unique identity to a Batch and is a mandatory field
+* **Description**: write about the importance of this Batch in short
+* **Access channels**: This will identify on which channel this survey has to be conducted and has two channel ODK and USSD
+
+A New Batch is created by providing above fields and click on ‘Save’ button to Create a New Batch in Survey.
+
+**Actions in Batch**:
+
+![Batch](./Batch3.png)
+
+* **Edit**: click on, Action Item ‘Edit’, User can Edit all fields in a Batch
+* **Delete**: click on, Action Item ‘Delete, the entire Batch along with questions are removed, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently. This option is not available for completed Surveys
+* **View/Edit Questions**: click on, Action Item ‘View /Edit Questions’, takes to the Survey ‘Batch Questions’ page
+* **Open/Close**: click on, Action Item ‘Open/Close’, takes to the page where all Enumeration Areas are listed, here one can change the “status of conducting survey in a particular Enumeration Area” to Open/Close
+i.e. Open- means allow to conduct survey and Close - means it prevents to conduct survey.
+
+![Batch](./Batch8.png)
+
+![Batch](./Batch7.png)
+
+* **View Data**: click on, Action Item ‘View Data’, shows Data collected in this Survey. This option is available only for completed Surveys.
+
+**How to create Batch Questions?**
+
+Once Survey and Batches are created, next step is to ‘Add Questions’ to Batch as follows:
+
+![Batch](./Batch4.png)
+
+On the ‘Batch’ page you can view all the Batch created in a Survey
+Now click on Batch Name, or click on, Action Item ‘View /Edit Question’ to go to ‘Batch Questions’ Page
+
+![Batch](./Batch5.png)
+
+Now click on, ‘Add Question’ button at top right side of this page, this will open a form where one can create a Question, which has following elements;
+
+**Elements in Batch Question form**:
+
+* **Module**: All Modules in the application are listed here in this dropdown, one has to select, respective Module that is related to survey
+* **Group**: All available Groups are listed in this dropdown, select relevant group name for the question
+* **Variables Name**: This is an identifier for Question, type a code for Question
+* **Text**: Is the actual Question, Write a Question. While typing a question, auto suggestion feature is available, which will prompt with the ‘Variable Name’ of preceding questions, that helps to include “Answered text of preceding question” in framing this question.
+i.e. just type, double curly brackets to automatically prompt with the ‘Variable Name’ from preceding questions,
+Ex: type {{ , system prompts with ‘Variable Name’ then select any one to insert Variable Name,
+Like: {{structure_address}}
+* **Answer Type**: Select an Answer Type from dropdown list, such that Question has to be answered in any one of these formats only, that is ‘Answer type’ should be: “Audio, Auto Generate, Date, Geo Point, Image, Multi choice, Multi Select, Numeric, Text and Video”
+* **Mandatory**: To mark the Question, that has to answered compulsory
+
+A Question in Batch is created by filling above all fields, finally click on ‘Save’ button to Add Question in Batch or click on ‘Save and Add More’ button to continue adding another Question to the same Batch or click on ‘Save and Update Library’ to add same to the ‘Questions Library’.
+
+**Select Question**: On click, ‘Select Question’ button, User navigates to ‘Select Library Questions’ page where one can Add the Library Questions into Batch.
+
+![Batch](./Batch6.png)
+
+To Add Question from Library to Batch, just Click on “Code” or “Text” to move Question between (Library Questions << / >> Batch Questions) tables, then click on ‘Save’ button at bottom of the page, to finish adding Questions to Batch.
+
+**Search**: One can find Questions in Library by two ways:
+**Sort** questions using ‘Answer Type’ dropdown at top left side of this page Or
+**Search** using the search bar at top right side of this page, by providing text or code
+
+**Export Questions**: On click, ‘Export Questions’ button, user can download the Batch Questions in “.csv” file format.
+
+**Update Question Order**:
+Questions in the table can be rearranged.
+To change the order of the Question in table, just select the Question then drag (move up or down) and drop at new position/order you want to in the table, then click on ‘Update Question Order’ button at bottom of the Questions table.
+
+On the ‘Batch Questions’ page one can view all the Questions created in that particular Batch,
+
+**Search**: One can find Questions in Batch by two ways:
+**Sort** questions using ‘Answer Type’ dropdown at top left side of this page Or
+**Search** using the search bar at top right side of this page, by providing text or code.
+
+**Actions for Batch Questions**:
+
+* **Edit Question**: click on, Action Item ‘Edit’, User can edit respective Question, ‘Variable Name’, ‘Text’ (Question), ‘Answer Type’ and can change ‘Mandatory’ type. This option is not available and cannot be performed for completed survey.
+
+* **Insert Question**: click on, Action Item, ‘Insert Question’ using which User can insert a New Question below the respective Question and rest of the process is similar to ‘Add New Question’.
+
+* **Delete Question**: click on, Action Item ‘Delete’, the Question is removed from list, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently.
+
+Caution, while deleting a Question: when a user attempts to delete a question, if that particular question is assigned with Logic or Loop, then along with the question logic or entire loop is removed respectively.
+
+**View Options**: This Action item is visible only for the Questions that has Answer Type “Multi choice” and “Multi Select”, to view Answer Options.
+
+![Batch](./Batch9.png)
+
+**Start/Edit Loop**:
+‘Start/Edit Loop’ is an Action item available only for the Questions that has Answer Type “Auto Generated”.
+
+Looping means repeatedly asking set of questions based up the need and purpose of the base question.
+
+To define the Looping concept, first of all one has to understand about terms that are used in creating a Loop are as following:
+
+![Batch](./Batch10.png)
+
+**Repeat Logic**: To apply Looping for a question there should be some base criteria to start loop, that is chosen from ‘Repeat Logic’ as “User Defined”, “Fixed number of repeats” and “Response from previous question”
+
+![Batch](./Batch11.png)
+
+**User Defined**: Need to choose what set of Question come into loop, starting from this particular question and has to end loop with any of the consecutive question in the Batch.
+
+**Fixed number of repeats**: Is chosen, need to provide ‘Repeat count’ – any specific no of times loop to be repeated.
+
+![Batch](./Batch12.png)
+
+**Response from previous question**: Is chosen, only when a question that exists before this base question with Answer Type “Numerical Answer”. This logic is based up on numeric value provided in the previous question.
+
+![Batch](./Batch13.png)
+
+**Loop Ends At**: When a loop starts that has to be closed, here the choice at which question the loop as to be closed is selected.
+
+![Batch](./Batch14.png)
+
+**Loop Prompt**: This is a message prompt shown on Mobile App during the time of capturing this details. This message will help the Interviewer to proceed further.
+Ex: “Do you what to Add one more”, “Do you what to Add another Household”, etc
+
+###How to create a Loop?
+
+
+One should be very careful while creating a loop, first of all analyze how a loop has to be created, using ‘Repeat logic’ and where to ‘End Loop’, as defined above select accordingly from ‘Repeat logic’ and ‘Loop end at’ to define a loop.
+
+* click on, Action Item ‘Start/Edit Loop’ which will take to ‘Start Loop’ page, now create loop as follows:
+* select “Logic Type” from dropdown ‘Repeat logic’,
+* select “Question at which loop should end” from dropdown ‘Loop end at’ and
+* in ‘Loop Prompt’ Text Box, write some message about, instructing the loop flow,
+* then click on ‘Save’ button to create loop.
+* Now you will be viewing a looping representation on ‘Batch Questions’ page in the ‘Code’ column of the ‘Questions’ table,
+
+**Loop Representation**:
+
+* | - icon represents Loop - START,
+
+* | - icon represents Loop - END,
+
+* | - icon represents Loop - CONTINUATION
+
+![Batch](./Batch18.png)
+
+**Remove Loop**:
+
+This Action item available only for the Questions that has Answer Type “Auto Generated” and a Loop is created.
+click on, Action Item ‘Remove Loop’ which will remove the existing looping logic.
+
+**Add Logic**:
+
+‘Add Logic’ is an Action item for every question expect for the Questions that has Answer Type “Auto Generated”.
+
+Add Logic option will convert a question to conditional one such that question will have choices to “Reconfirm”, “End Interview”, “Ask Sub-Question” and “Skip To” which is based up on value/Answer provided.
+
+![Batch](./Batch17.png)
+
+One has to define the Logic here for respective question by satisfying the condition by providing ‘Eligible Criteria’, ‘Attribute’ Value, and ‘Then’ as follows:
+
+![Batch](./Batch15.png)
+
+**Eligible Criteria**: This is a condition made based up on this Question value “Starts With”, “Equals”, “Contains” and “Ends With”.
+
+**Attribute**: Provide the “Value” as per the above ‘Eligible Criteria’ selected
+
+**Then**: Based up on the ‘Eligible Criteria’ and ‘Attribute’ Value chosen, the condition for Question is applied here with following options:
+
+**Reconfirm** – Prompts with conformation Question to validate the Answer
+
+**End Interview** – Skips the intermediate Question and moves to end of the questioner
+
+**Ask Sub-Question** – Provides an option to Create a Sub-Question based upon the ‘Attribute’ value.
+To do this, select option “Ask Sub-Question” than you will find a button with name ‘Add Sub-Question’ beside this,
+click on it to create a Sub-Question, same like create question, once you click on ‘Save’ button, you will find this Sub-Question in the dropdown ‘Choose Question’
+beside it, now select the “Sub-Question” and click on ‘Save’ button.
+
+**Skip To** - Provides the option to jump to any particular/ consecutive question in the list, by skipping / avoiding the intermediate Question.
+
+**How to Apply Logic to a Question?**
+
+Click on, Action Item, ‘Add Logic’ this will open a form where one can create a Logic for Question, by providing ‘Eligible Criteria’, ‘Attribute’ Value, and ‘Then’ as per the condition required, then click on ‘Save’ button to create Logic.
+
+In the same page, logic that is created can be seen in table “Existing Logic”.
+Which shows the created logic for this particular question and has option to ‘Delete’ the applied Logic
+
+**Edit Logic**:
+In the ‘Batch Questions’ page, Questions that has Logic are represented with hyperlink, click on the respective Question, that shows options like ‘View logic’, ‘Edit’ and ‘Delete’
+
+* **View Logic**: click to view the Logic that is Applied for this particular question
+* **Edit Logic**: click to Edit the existing Logic that is Applied for this particular question
+* **Delete Logic**: click to Remove the Logic that is Applied for this particular question
\ No newline at end of file
diff --git a/docs/Survey1.png b/docs/Survey1.png
new file mode 100644
index 00000000..89f97df0
Binary files /dev/null and b/docs/Survey1.png differ
diff --git a/docs/Survey2.png b/docs/Survey2.png
new file mode 100644
index 00000000..d536b1c0
Binary files /dev/null and b/docs/Survey2.png differ
diff --git a/docs/Survey3.png b/docs/Survey3.png
new file mode 100644
index 00000000..cdfca41c
Binary files /dev/null and b/docs/Survey3.png differ
diff --git a/docs/Survey4.png b/docs/Survey4.png
new file mode 100644
index 00000000..319803b8
Binary files /dev/null and b/docs/Survey4.png differ
diff --git a/docs/Survey4_1.png b/docs/Survey4_1.png
new file mode 100644
index 00000000..569fef47
Binary files /dev/null and b/docs/Survey4_1.png differ
diff --git a/docs/Survey5.png b/docs/Survey5.png
new file mode 100644
index 00000000..a2d34e6c
Binary files /dev/null and b/docs/Survey5.png differ
diff --git a/docs/Survey6.png b/docs/Survey6.png
new file mode 100644
index 00000000..b9f50c64
Binary files /dev/null and b/docs/Survey6.png differ
diff --git a/docs/User_Guides.md b/docs/User_Guides.md
new file mode 100644
index 00000000..4be2b771
--- /dev/null
+++ b/docs/User_Guides.md
@@ -0,0 +1,972 @@
+###Login
+------
+Welcome to uSurvey portal, enrolled users can access the portal by their Login credentials provided by Administrator.
+
+To login, click on ‘Login’ at top right of the Home page
+
+![Home](./Home.png)
+
+Now Sign in to the portal using your Username and Password, after successful login you will be navigated to uSurvey Dashboard, which shows Uganda Map.
+
+![Login](./Login.png)
+
+###Dashboard
+------
+The Dashboard, contains Survey Map, which is used to display survey report on a country map as per primary Administrative divisions.
+E.g. In current map of Uganda, every District correspond to primary administrative division for Survey.
+
+Dashboard is basically divided into two Tabs
+1. **Locations**
+2. **Indicators**
+
+On Map Dashboard, a drop down at top left contains Surveys, District wise completion rates with respect to its legend and respective Survey Indicators are display adjacent to the map.
+Legend at bottom left, shows with color codes used to indicate completion status on map.
+
+In the ‘Locations’ tab,
+select a Survey and point on relevant District on the map you wish to examine, then the report is loaded into the map and shows District wise Survey report with completion rates and completion status.
+
+![Map](./Map1.png)
+
+In the ‘Indicators’ tab,
+Shows maximum five Indicators that defined for each Survey. select a Survey and point on relevant District on the map you wish to examine respective Indicators.
+
+![Map](./Map2.png)
+
+###Modules
+------
+Modules are Survey based classification based up on survey type and need.
+ Modules are accessible from main menu under **Design** >> **Modules**
+
+![Module](./Module1.png)
+
+To create a new Module, click on ‘Add Module’ button at top right of the Modules page, that opens a form to create a new Module.
+
+![Module](./Module2.png)
+
+**Elements of Module**:
+
+**Name**: Name of a Module, which is a unique identity to a Module and is a mandatory field.
+
+**Description**: A short description about Module
+
+![Module](./Module3.png)
+
+A Module is created by providing above field and click on ‘Create’ button to Create a Module.
+
+On the ‘Modules’ page you can view all the Modules created in the application. each of these Module has Actions to ‘Edit’ and ‘Delete’.
+
+**Actions in Modules**:
+
+![Module](./Module4.png)
+
+* Edit Module: click on, Action Item ‘Edit’, User can Edit Name and Description of the Module.
+* Delete Module: click on, Action Item ‘Delete, the Module is removed, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently.
+
+###Groups
+------
+Groups are Survey dependent classification of people/respondents based on their Age, Gender and combination of both into one or more survey- respondents categories called Groups.
+Population has to be segment into Groups / multiple groups and our system allows us to create as many as needed.
+
+**Create a New Group**
+
+Groups are accessible from main menu under **Design** >> **Groups**
+
+![Group](./Group1.png)
+
+To create a new Group, click on ‘Add Group’ button at top right of the Groups page, that opens a form to create a new Group.
+
+![Group](./Group2_1.png)
+
+From this above Groups page, Groups are managed, i.e. to Create a New Group, Edit existing Group, Delete Groups and Manage Parameters.
+
+**Elements of Group**
+
+**Name**: Is Group Name, which is a unique identity to a Group.
+
+**Description**: A short description about Group
+
+**Parameter**: Need to select a parameter, based on which Group is created. Like: Age, Gender.
+
+**Operator**: Also need to select an Operator based on the Parameter value. Like: between, equals, grater_than, and less_than.
+
+![Group](./Group3.png)
+
+A Group is created by providing above all field, such that a Group can be created using a single or combination of Parameters, finally click on ‘Save’ button to Create Group.
+
+**Existing Criteria**
+This table shows list of parameters used in creating a Group and can be altered by Deleting the existing one and assigning a different parameter to the same Group Name, by changing the ‘Parameter’ and ‘Operator’ values, then click ‘Save’ button.
+
+**Edit and Delete Groups**
+From the Groups Table each of the Group has Action items to ‘Edit’ and ‘Delete’ Group.
+
+![Group](./Group4.png)
+
+![Group](./Group5.png)
+
+To Edit a Group – In the table under column name ‘Actions’ select ‘Edit’ to modify existing the criteria, name, description, then click ‘Save’ button.
+
+To Delete a Group – In the table under column name ‘Actions’ select ‘Delete’ to remove from list, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently.
+
+**Available Parameters**
+
+Parameters plays a major portion in creating a Group, to check what are the Parameters available, Add, Edit and Delete Parameters are managed.
+
+![Group](./Group6.png)
+
+**Add Parameters**
+
+To Add Parameter, click on ‘Add Parameter’ button at top right of the Parameter page, that opens a form to create a new Parameter, which has following elements;
+
+![Group](./Group7.png)
+
+**Elements of Parameter**
+
+**Variables Name**: Is an identifier for Parameter, Enter the name of the Parameter
+
+**Text**: A short description about Parameter
+
+**Answer Type**: Select an Answer Type for Parameter from dropdown list, such that Parameter is of type Text, Numeric and Multi choice.
+
+![Group](./Group8.png)
+
+A Parameter is created by providing above all field, finally click on ‘Save’ button to Create Parameter or click on ‘Save and Add More’ button to continue adding more Parameters to the list.
+
+**Edit and Delete Parameter**
+From the Parameter Table each of the Parameter has Action items to ‘Edit’ and ‘Delete’ Parameter.
+
+![Group](./Group9.png)
+
+![Group](./Group10.png)
+
+To Edit a Parameter – In the table under column name ‘Actions’ select ‘Edit’ to modify existing the Variable name, Text and Answer Type, then click ‘Save’ button.
+
+To Delete a Parameter – In the table under column name ‘Actions’ select ‘Delete’ to remove from list, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently.
+
+**View Options**: This Action item is visible only for the Questions that has Answer Type “Multi choice”, to view Answer Choices.
+
+**Export Parameter**
+Click on ‘Export Parameter’ to download available list of Parameter in ‘.CSV’ file format.
+
+###Listing
+------
+The Listing is generally carried out by field staff other than interviewers, as a separate field operation conducted before the survey starts. This pre-process has the following benefits
+
+1. It creates set of common questions to be asked before any survey is captured, as a one-time effort. For instance, the demographic details of household residents is required before conducting any household survey. Such data can be captured as part of the Listing.
+
+2. By creating a separate Listing the system gives the user flexibility to use the same Listing for multiple surveys.
+
+Listings are accessible from main menu under **Design** >> **Listing Form**
+
+Listing is a set of Questions that can be customized/configured for any survey by reusing same Listing.
+
+![Listing](./Listing1.png)
+
+**Creating New Listing**
+
+To create a new Listing, click on the ‘Create New Listing Form’ button at top right of the Listing page, that opens a form to create a new Listing, which has following elements;
+
+![Listing](./Listing2.png)
+
+**Elements of Listing form**:
+
+* **Name**: Is Listing Name, which is a unique identity to a Listing and is a mandatory field.
+
+* **Description**: write about the importance of the Listing in short.
+
+* **Access channels**: This will identify on which channel this survey has to be conducted and has two channel ODK and USSD
+
+![Listing](./Listing3.png)
+
+A Listing Form is created by filling above all fields, finally clicking on ‘Save’ button to create Listing.
+
+**Search**: One can find Listings in the application, using the search bar at top right side of this Listing Form page, by providing Name or description.
+
+On the ‘Listing Form’ page one can view all the Listings created in the application, in a tabular form with following column names:
+
+**Sts**: Represents Status of the Listing by color indicator, that means each of the Color code indicates as:
+
+ •– Not Started
+ •– Ongoing
+ •– Completed
+
+**Name**: Is Name of the Listing, which is a unique identity to represent Listing and is a mandatory field.
+
+**Description**: A short description about Listing
+
+**Total Respondents**: once the listing operation is completed, this column will be updated with the count of participants/ respondents.
+
+**Action**: Each of the Listing has following Actions: ‘Edit’, ‘Delete’, ‘View/Edit Questions’, ‘View Data’ and ‘Clone’
+
+**Actions in Listing Form**:
+
+![Listing](./Listing4.png)
+
+* **Edit**: click on, Action Item ‘Edit’, User can Edit only the name of the Listing, Description and selection of Access channels (OBK, USSD)
+
+* **Delete**: click on, Action Item ‘Delete, the entire Listing is removed, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently.
+This option is not available for completed listing
+
+* **View/Edit Questions**: click on, Action Item ‘View/Edit Questions’, navigates to ‘Listing Questions’ page to View or Edit Respective Questions in Listing
+
+* **Clone**: click on, Action Item ‘Clone’, an another copy of same Listing Form is created along with Listing Questions, except existing Looping and Logic
+
+* **View Data**: This Action Item is available only for the completed Listing operation in the field. click on, Action Item ‘View Data’, to view data collected for this particular Listing
+
+![Listing](./Listing18.png)
+
+**Creating Questionnaire to the Listing Form**:
+
+On the ‘Listing Form’ page you can view all the Listings created in the application.
+
+To add new questions in Listing can be done in 2 ways
+
+1. Click on the Listing Name
+2. Click on Actions Drop down and select the item ‘View/Edit Questions’
+
+One can also select the questions from ‘Questions Library’ to add into Listing, using ‘Select Questions’
+
+**Add Questions in Listing Form**:
+
+Click on, ‘Add Question’ button at top right of the particular Listing page, this will open a form where one can create a Question, which has following elements;
+
+![Listing](./Listing15.png)
+
+**Elements in Listing Question form**:
+
+**Variables Name**: This is an identifier for Question, type a code for Question
+
+**Text**: Is the actual Question, Write a Question.
+ While writing a question, system prompts with the “Variable Names” of the preceding questions, that helps to include “answer of the preceding question” in composing succeeding questions.
+ i.e. just type, double curly brackets ( {{ ), to get list of Variable Names of the preceding questions.
+ Ex: type {{ , to get Variable Names, then select any 'Variable Name' to insert; *{{NAME}}, {{HH_head}}*
+ **Example Question**: *Gender of the {{HH_head}}*
+
+**Answer Type**: Select an Answer Type from dropdown list, such that Question has to be answered in any one of these formats only, that is ‘Answer type’ should be: “Audio, Auto Generate, Date, Geo Point, Image, Multi choice, Multi Select, Numeric, Text and Video”
+
+**Mandatory**: To mark the Question, that has to answered compulsory.
+
+A Question in Listing is created by filling above all fields, finally click on ‘Save’ button to Add Question in Listing or click on ‘Save and Add More’ button to continue adding another Question to the same Listing or click on ‘Save and Update Library’ to add same to the ‘Questions Library’.
+
+**Select Question**: On click, ‘Select Question’ button, User navigates to ‘Select Library Questions’ page where one can Add the Library Questions into Listing.
+
+![Listing](./Listing13.png)
+
+To Add Question from Library to Listing, just Click on “Code” or “Text” to move Question between (Library Questions << / >> Listing Questions) tables, then click on ‘Save’ button at bottom of this page, to finish adding Questions to Listing.
+
+**Search**: One can find Questions in Library by two ways:
+ **Sort** questions using ‘Answer Type’ dropdown at top left side of this page. Or
+ **Search** using the search bar at top right side of this page, by providing text or code.
+
+**Export Questions**: On click, ‘Export Questions’ button, user can download the Listing Questions in “.csv” file format.
+
+**Update Question Order**:
+Questions in the table can be rearranged.
+ To change the order of the Question in table, just select the Question then drag (move up or down) and drop at new position/order you want to in the table, then click on ‘Update Question Order’ button at bottom of the Questions table.
+
+On the ‘Listing Questions’ page one can view all the Questions created in that particular Listing.
+
+**Search**: One can find Questions in Listing by two ways:
+ **Sort** questions using ‘Answer Type’ dropdown at top left side of this page. Or
+ **Search** using the search bar at top right side of this page, by providing text or code.
+
+**Actions for Listing Questions**:
+
+**Edit Question**: click on, Action Item ‘Edit’, User can Edit respective Question, ‘Variable Name’, ‘Text’ (Question), ‘Answer Type’ and can change ‘Mandatory’ type.
+
+**Insert Question**: click on, Action Item, ‘Insert Question’ using which User can insert a New Question below the respective Question and rest of the process is similar to ‘Add New Question’.
+
+**Delete Question**: click on, Action Item ‘Delete’, the Question is removed from list, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently.
+
+**Caution while deleting a Question**: when a user attempts to delete a question, if that particular question is assigned with Logic or Loop, then along with the question logic or entire loop is removed respectively.
+
+**View Options**: This Action item is visible only for the Questions that has Answer Type “Multi choice” and “Multi Select”, to view Answer Options.
+
+**Start/Edit Loop**:
+
+‘Start/Edit Loop’ is an Action item available only for the Questions that has Answer Type “Auto Generated”.
+
+![Listing](./Listing6.png)
+
+Looping means repeatedly asking set of questions based up the need and purpose of the base question.
+
+To define the Looping concept, first of all one has to understand about terms that are used in creating a Loop are as following:
+
+![Listing](./Listing8.png)
+
+**User Defined**: Need to choose what set of Question come into loop, starting from this particular question and has to end loop with any of the consecutive question in the Listing.
+
+![Listing](./Listing7.png)
+
+**Repeat Logic**: To apply Looping for a question there should be some base criteria to start loop, that is chosen from ‘Repeat Logic’ as “User Defined”, “Fixed number of repeats” and “Response from previous question”
+
+**Fixed number of repeats**: Is chosen, need to provide ‘Repeat count’ – any specific no of times loop to be repeated.
+
+![Listing](./Listing9.png)
+
+**Response from previous question**: Is chosen, only when a question that exists before this base question with Answer Type “Numerical Answer”. This logic is based up on numeric value provided in the previous question.
+
+![Listing](./Listing10.png)
+
+* **Loop Ends At**: When a loop starts that has to be closed, here the choice at which question the loop as to be closed is selected.
+
+![Listing](./Listing11.png)
+
+* **Loop Prompt**: This is a message prompt shown on Mobile App during the time of capturing this details. This message will help the Interviewer to proceed further.
+
+![Listing](./Listing12.png)
+
+**How to create a Loop?**
+
+One should be very careful while creating a loop, first of all analyze how a loop has to be created, using ‘Repeat logic’ and where to ‘End Loop’, as defined above select accordingly from ‘Repeat logic’ and ‘Loop end at’ to define a loop.
+
+click on, Action Item ‘Start/Edit Loop’ which will take to ‘Start Loop’ page, now create loop as follows:
+
+* select “Logic Type” from dropdown ‘Repeat logic’,
+* select “Question at which loop should end” from dropdown ‘Loop end at’ and
+* in ‘Loop Prompt’ Text Box, write some message about, instructing the loop flow,
+* then click on ‘Save’ button to create loop
+
+Now you will be viewing a looping representation on ‘Listing Questions’ page in the ‘Code’ column of the ‘Questions’ table
+
+![Listing](./Listing5.png)
+
+**Loop Representation**:
+
+* | - icon represents Loop - START,
+
+* | - icon represents Loop - END,
+
+* | - icon represents Loop - CONTINUATION
+
+**Remove Loop**:
+
+This Action item available only for the Questions that has Answer Type “Auto Generated” and a Loop is created.
+click on, Action Item ‘Remove Loop’ which will remove the existing looping logic.
+
+**Add Logic**:
+
+‘Add Logic’ is an Action item for every question expect for the Questions that has Answer Type “Auto Generated”.
+
+![Listing](./Listing16.png)
+
+Add Logic option will convert a question to conditional one such that question will have choices to “Reconfirm”, “End Interview”, “Ask Sub-Question” and “Skip To” which is based up on value/Answer provided.
+
+one has to define the Logic here for respective question by satisfying the condition by providing ‘Eligible Criteria’, ‘Attribute’ Value, and ‘Then’ as follows:
+
+![Listing](./Listing17.png)
+
+**Eligible Criteria**: This is a condition made based up on this Question value “Starts With”, “Equals”, “Contains” and “Ends With”.
+
+**Attribute**: Provide the “Value” as per the above ‘Eligible Criteria’ selected
+
+**Then**: Based up on the ‘Eligible Criteria’ and ‘Attribute’ Value chosen, the condition for Question is applied here with following options:
+
+* ‘Reconfirm’ – Prompts with conformation Question to validate the Answer
+
+* ‘End Interview’ – Skips the intermediate Question and moves to end of the questioner
+
+* ‘Ask Sub-Question’ – Provides an option to Create a Sub-Question based upon the ‘Attribute’ value
+
+To do this, select option “Ask Sub-Question” than you will find a button with name ‘Add Sub-Question’ beside this,
+ click on it to create a Sub-Question, same like create question, once you click on ‘Save’ button, you will find this Sub-Question in the dropdown ‘Choose Question’
+ beside it, now select the “Sub-Question” and click on ‘Save’ button.
+
+* ‘Skip To’ - Provides the option to jump to any particular/ consecutive question in the list, by skipping / avoiding the intermediate Question.
+
+**How to Apply Logic to a Question?**
+
+Click on, Action Item, ‘Add Logic’ this will open a form where one can create a Logic for Question, by providing ‘Eligible Criteria’, ‘Attribute’ Value, and ‘Then’ as per the condition required, then click on ‘Save’ button to create Logic.
+
+In the same page, logic that is created can be seen in table “Existing Logic”.
+Which shows the created logic for this particular question and has option to ‘Delete’ the applied Logic
+
+**Edit Logic**:
+In the ‘Listing Form Questions Template’ page, Questions that has Logic are represented with hyperlink, click on the respective Question, that shows options to ‘View logic’, ‘Edit’ and ‘Delete’
+
+* **View Logic**: click to view the Logic that is Applied for this particular question
+
+* **Edit Logic**: click to Edit the existing Logic that is Applied for this particular question
+
+* **Delete Logic**: click to Remove the Logic that is Applied for this particular question
+
+###Create Survey
+------
+Surveys are accessible from main menu under **Design** >> **Surveys**
+
+![Survey0](./Survey1.png)
+Screen-1
+
+A New Survey can be created and defined here, so before creating a survey first of all one has to know about the terminology used here.
+
+* **Preferred Listing**: List of existing Listing, which are already in the system.
+ Is an option to choose, existing Listing for this New Survey, where already survey was conducted on these Listings, which will include total Listing questions along with the data/results.
+
+* **New Listing**: List of Newly created Listings, not previously used in any survey.
+ This field will enable only if option “None, Create New” is selected, in the dropdown ‘Preferred Listing’. which contains list of Newly created Listings, which are not yet used in any survey.
+
+* **Randomly selected data label**: Is the identifier for respondents while conducting a Listing survey.
+ This field will enable only when listing in dropdown ‘New Listing’ is selected.
+
+**How to create a Survey?**
+ To create a New Survey, click on ‘Create New Survey’ button at top right of the Survey page, that opens a form to create a new Survey, which has following elements;
+
+![Survey1](./Survey2.png)
+Screen-2
+
+**Elements of a Survey**:
+
+![Survey2](./Survey3.png)
+
+* **Name**: Is Survey Name, which is a unique identity to a survey and is a mandatory field
+* **Description**: write about the importance of this survey in short
+* **Survey Type**: This identifies how survey is going to take place either using Listing or not
+ If Survey Type is “Sampled”, Survey uses Sample size and Listing
+ If Survey Type is “Census”, Survey doesn’t need Sample size and Listing
+
+* **Sample size**: Provide survey sample size
+* **Preferred Listing**: select an existing Listing Or
+* **New Listing**: select Newly created Listing
+* **Randomly selected data label**: You need to include at least one Listing response identifier (Variable Name) in double curly brackets.
+ i.e. just type, double curly brackets ( {{ ), to get list of “Variable Names” defined in the above selected Listing.
+ Ex: type {{ , to get Variable Names, then select any ‘Variable Name’ to insert.
+ Like: {{Srn_structure}}, {{Srn_HH}}
+ **Note**: To insert multiple identifiers, do not use any space or special characters between each of the identifier, just continue by using ‘{{’ to insert.
+
+* **Email group**: select, User Emails Id to send report
+
+A New Survey is created by providing above fields and click on ‘Save’ button to Create a Survey.
+
+**Search**: One can find Surveys in the application, using the search bar at top right side of this survey page, by providing Name or description.
+
+On the ‘Survey’ page one can view all the Survey created in the application, in a tabular form with following column names:
+
+![Survey2](./Survey4.png)
+
+**Sts**: Represents Status of the Survey by color indicator, that means each of the Color code indicates as:
+ • – Not Started
+ • – Ongoing
+ • – Completed
+
+* **Name**: Is Name of a Survey, which is a unique identity to represent Survey and is a mandatory field
+* **Description**: A short description about Listing
+* **Type**: Survey type Sampled or Census
+* **Sample size**: Provide survey sample size
+* **Total Respondents**: once the Survey is completed, this column will be updated with the count of participants/ respondents
+* **Eas Covered**: Count of Enumeration areas covered in this particular survey
+
+**Actions in Survey**:
+
+* **Edit Survey**: click on, Action Item ‘Edit’, User can Edit all fields in the Survey
+* **Delete Survey**: click on, Action Item ‘Delete, the entire Survey is removed, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently. This option is not available for completed Survey
+* **View Batches in Survey**: click on, Action Item ‘View Batches’, navigates to ‘Survey Batches’ page
+* **Clone a Survey**: click on, Action Item ‘Clone’, an another copy of same Survey is created along with Survey Batches and Batch Questions, except existing Looping and Logic in Batch Questions
+* **Sampling Criteria**:
+ This feature helps Data researcher to sort collected data for sampling according to listing data, in some cases, the Data researcher might be interested in restricting sampling, so that only listing data which meets specific criteria are sampled
+
+For example: if interviewer had collected data for houses in a particular Enumeration area, the Data researcher might be interested in sampling only those houses with at least one child. Or
+Data researcher might be interested in sampling only residential houses.
+
+Defining Sampling Criteria provides the admin user to describe how to define the rules for Sampling Criteria
+
+**Define Sampling Criteria**
+
+To define Sampling Criteria, click on, Action Item ‘Sampling Criteria’, that opens a form with the following elements;
+
+![Survey](./Survey4_1.png)
+
+![Survey](./Survey5.png)
+
+![Survey](./Survey6.png)
+
+**Listing Question**: Listing Questions with code, used for this Survey are lorded here, one can select respective question for defining the Sampling Criteria.
+
+**Validation Test**: Based on the above selected question, choose the eligible criteria to validate the collected data
+
+**Value / Options**: To sort collected data for sampling, provide valid input for above Validation Test.
+
+Sampling Criteria is created by satisfying above fields, then click on ‘Save Changes’.
+
+In the same page, Sampling Criteria that is created can be seen in table the “Existing Criteria”.
+Which shows the defined Sampling Criteria and has option to ‘Delete’.
+
+###Batches
+------
+Batch is a categorization of Survey Questions, that means set of Questions categorized for a Survey convenience. We can create multiple Batches in a survey.
+
+Once the Survey is created, next step is to create ‘Batch’ and ‘Add Questions’ to Batch.
+
+**How to create a Batch?**
+
+Go to Batches Page, which can be done in two ways
+On the ‘Survey’ page you can view all the Survey created in the application
+Now click on Survey Name, or click on, Action Item ‘View Batches’ to go to ‘Batches’ Page
+
+![Batch](./Batch1.png)
+
+To create a New Batch, click on ‘Create New Batch’ button at top right of the Batch page, that opens a form to create a new Batch, which has following elements;
+
+![Batch](./Batch2.png)
+
+**Elements of a Batch**:
+
+* **Name**: Is Batch Name, which is a unique identity to a Batch and is a mandatory field
+* **Description**: write about the importance of this Batch in short
+* **Access channels**: This will identify on which channel this survey has to be conducted and has two channel ODK and USSD
+
+A New Batch is created by providing above fields and click on ‘Save’ button to Create a New Batch in Survey.
+
+**Actions in Batch**:
+
+![Batch](./Batch3.png)
+
+* **Edit**: click on, Action Item ‘Edit’, User can Edit all fields in a Batch
+* **Delete**: click on, Action Item ‘Delete, the entire Batch along with questions are removed, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently. This option is not available for completed Surveys
+* **View/Edit Questions**: click on, Action Item ‘View /Edit Questions’, takes to the Survey ‘Batch Questions’ page
+* **View Data**: click on, Action Item ‘View Data’, shows Data collected in this Survey. This option is available only for completed Surveys.
+
+######Enable Batch
+* **Open/Close**: To enable Batch for data collection
+click on, Action Item ‘Open/Close’, takes to the page where all Enumeration Areas are listed, here one can change the “status of conducting survey in a particular Enumeration Area” to Open/Close
+i.e. **Open** - means, enable Batch for data collection and **Close** – means, disable Batch for data collection.
+
+![Batch](./Batch8.png)
+
+![Batch](./Batch7.png)
+
+**How to create Batch Questions?**
+
+Once Survey and Batches are created, next step is to ‘Add Questions’ to Batch as follows:
+
+![Batch](./Batch4.png)
+
+On the ‘Batch’ page you can view all the Batch created in a Survey
+ Now click on Batch Name, or click on, Action Item ‘View /Edit Question’ to go to ‘Batch Questions’ Page
+
+![Batch](./Batch5.png)
+
+Now click on, ‘Add Question’ button at top right side of this page, this will open a form where one can create a Question, which has following elements;
+
+**Elements in Batch Question form**:
+
+* **Module**: All Modules in the application are listed here in this dropdown, one has to select, respective Module that is related to survey
+* **Group**: All available Groups are listed in this dropdown, select relevant group name for the question
+* **Variables Name**: This is an identifier for Question, type a code for Question
+* **Text**: Is the actual Question, Write a Question.
+ While writing a question, system prompts with the “Variable Names” of the preceding questions, that helps to include “answer of the preceding question” in composing succeeding questions.
+ i.e. just type, double curly brackets ( {{ ), to get list of Variable Names of the preceding questions.
+ Ex: type {{ , to get Variable Names, then select any ‘Variable Name’ to insert; *{{FIRST_NAME}}, {{name_student}}*
+ Example Question: *What is {{FIRST_NAME}}'s Ethnicity?*
+
+* **Answer Type**: Select an Answer Type from dropdown list, such that Question has to be answered in any one of these formats only, that is ‘Answer type’ should be: “Audio, Auto Generate, Date, Geo Point, Image, Multi choice, Multi Select, Numeric, Text and Video”
+* **Mandatory**: To mark the Question, that has to answered compulsory
+
+A Question in Batch is created by filling above all fields, finally click on ‘Save’ button to Add Question in Batch or click on ‘Save and Add More’ button to continue adding another Question to the same Batch or click on ‘Save and Update Library’ to add same to the ‘Questions Library’.
+
+**Select Question**: On click, ‘Select Question’ button, User navigates to ‘Select Library Questions’ page where one can Add the Library Questions into Batch.
+
+![Batch](./Batch6.png)
+
+To Add Question from Library to Batch, just Click on “Code” or “Text” to move Question between (Library Questions << / >> Batch Questions) tables, then click on ‘Save’ button at bottom of the page, to finish adding Questions to Batch.
+
+**Search**: One can find Questions in Library by two ways:
+**Sort** questions using ‘Answer Type’ dropdown at top left side of this page Or
+**Search** using the search bar at top right side of this page, by providing text or code
+
+**Export Questions**: On click, ‘Export Questions’ button, user can download the Batch Questions in “.csv” file format.
+
+**Update Question Order**:
+ Questions in the table can be rearranged.
+ To change the order of the Question in table, just select the Question then drag (move up or down) and drop at new position/order you want to in the table, then click on ‘Update Question Order’ button at bottom of the Questions table.
+
+On the ‘Batch Questions’ page one can view all the Questions created in that particular Batch,
+
+**Search**: One can find Questions in Batch by two ways:
+**Sort** questions using ‘Answer Type’ dropdown at top left side of this page Or
+**Search** using the search bar at top right side of this page, by providing text or code.
+
+**Actions for Batch Questions**:
+
+* **Edit Question**: click on, Action Item ‘Edit’, User can edit respective Question, ‘Variable Name’, ‘Text’ (Question), ‘Answer Type’ and can change ‘Mandatory’ type. This option is not available and cannot be performed for completed survey.
+
+* **Insert Question**: click on, Action Item, ‘Insert Question’ using which User can insert a New Question below the respective Question and rest of the process is similar to ‘Add New Question’.
+
+* **Delete Question**: click on, Action Item ‘Delete’, the Question is removed from list, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently.
+
+Caution, while deleting a Question: when a user attempts to delete a question, if that particular question is assigned with Logic or Loop, then along with the question logic or entire loop is removed respectively.
+
+**View Options**: This Action item is visible only for the Questions that has Answer Type “Multi choice” and “Multi Select”, to view Answer Options.
+
+![Batch](./Batch9.png)
+
+**Start/Edit Loop**:
+ ‘Start/Edit Loop’ is an Action item available only for the Questions that has Answer Type “Auto Generated”.
+
+Looping means repeatedly asking set of questions based up the need and purpose of the base question.
+
+To define the Looping concept, first of all one has to understand about terms that are used in creating a Loop are as following:
+
+![Batch](./Batch10.png)
+
+**Repeat Logic**: To apply Looping for a question there should be some base criteria to start loop, that is chosen from ‘Repeat Logic’ as “User Defined”, “Fixed number of repeats” and “Response from previous question”
+
+![Batch](./Batch11.png)
+
+**User Defined**: Need to choose what set of Question come into loop, starting from this particular question and has to end loop with any of the consecutive question in the Batch.
+
+**Fixed number of repeats**: Is chosen, need to provide ‘Repeat count’ – any specific no of times loop to be repeated.
+
+![Batch](./Batch12.png)
+
+**Response from previous question**: Is chosen, only when a question that exists before this base question with Answer Type “Numerical Answer”. This logic is based up on numeric value provided in the previous question.
+
+![Batch](./Batch13.png)
+
+**Loop Ends At**: When a loop starts that has to be closed, here the choice at which question the loop as to be closed is selected.
+
+![Batch](./Batch14.png)
+
+**Loop Prompt**: This is a message prompt shown on Mobile App during the time of capturing this details. This message will help the Interviewer to proceed further.
+Ex: “Do you what to Add one more”, “Do you what to Add another Household”, etc
+
+**How to create a Loop?**
+
+One should be very careful while creating a loop, first of all analyze how a loop has to be created, using ‘Repeat logic’ and where to ‘End Loop’, as defined above select accordingly from ‘Repeat logic’ and ‘Loop end at’ to define a loop.
+
+* click on, Action Item ‘Start/Edit Loop’ which will take to ‘Start Loop’ page, now create loop as follows:
+* select “Logic Type” from dropdown ‘Repeat logic’,
+* select “Question at which loop should end” from dropdown ‘Loop end at’ and
+* in ‘Loop Prompt’ Text Box, write some message about, instructing the loop flow,
+* then click on ‘Save’ button to create loop.
+* Now you will be viewing a looping representation on ‘Batch Questions’ page in the ‘Code’ column of the ‘Questions’ table,
+
+**Loop Representation**:
+
+* | - icon represents Loop - START,
+
+* | - icon represents Loop - END,
+
+* | - icon represents Loop - CONTINUATION
+
+![Batch](./Batch18.png)
+
+**Remove Loop**:
+
+This Action item available only for the Questions that has Answer Type “Auto Generated” and a Loop is created.
+click on, Action Item ‘Remove Loop’ which will remove the existing looping logic.
+
+**Add Logic**:
+
+‘Add Logic’ is an Action item for every question expect for the Questions that has Answer Type “Auto Generated”.
+
+Add Logic option will convert a question to conditional one such that question will have choices to “Reconfirm”, “End Interview”, “Ask Sub-Question” and “Skip To” which is based up on value/Answer provided.
+
+![Batch](./Batch17.png)
+
+One has to define the Logic here for respective question by satisfying the condition by providing ‘Eligible Criteria’, ‘Attribute’ Value, and ‘Then’ as follows:
+
+![Batch](./Batch15.png)
+
+**Eligible Criteria**: This is a condition made based up on this Question value “Starts With”, “Equals”, “Contains” and “Ends With”.
+
+**Attribute**: Provide the “Value” as per the above ‘Eligible Criteria’ selected
+
+**Then**: Based up on the ‘Eligible Criteria’ and ‘Attribute’ Value chosen, the condition for Question is applied here with following options:
+
+**Reconfirm** – Prompts with conformation Question to validate the Answer
+
+**End Interview** – Skips the intermediate Question and moves to end of the questioner
+
+**Ask Sub-Question** – Provides an option to Create a Sub-Question based upon the ‘Attribute’ value.
+To do this, select option “Ask Sub-Question” than you will find a button with name ‘Add Sub-Question’ beside this,
+click on it to create a Sub-Question, same like create question, once you click on ‘Save’ button, you will find this Sub-Question in the dropdown ‘Choose Question’
+beside it, now select the “Sub-Question” and click on ‘Save’ button.
+
+**Skip To** - Provides the option to jump to any particular/ consecutive question in the list, by skipping / avoiding the intermediate Question.
+
+**How to Apply Logic to a Question?**
+
+Click on, Action Item, ‘Add Logic’ this will open a form where one can create a Logic for Question, by providing ‘Eligible Criteria’, ‘Attribute’ Value, and ‘Then’ as per the condition required, then click on ‘Save’ button to create Logic.
+
+In the same page, logic that is created can be seen in table “Existing Logic”.
+Which shows the created logic for this particular question and has option to ‘Delete’ the applied Logic
+
+**Edit Logic**:
+In the ‘Batch Questions’ page, Questions that has Logic are represented with hyperlink, click on the respective Question, that shows options like ‘View logic’, ‘Edit’ and ‘Delete’
+
+* **View Logic**: click to view the Logic that is Applied for this particular question
+* **Edit Logic**: click to Edit the existing Logic that is Applied for this particular question
+* **Delete Logic**: click to Remove the Logic that is Applied for this particular question
+
+###Library Questions
+------
+List of Questions very common in Surveys are available here which are also categorized into Module wise. This is a feature/ facility available to pick up questions from this library and add to Batch or Listing, by ‘Select Questions’ feature in respective pages.
+
+**Create Library Questions**
+
+To add new questions in Library can be done in 2 ways.
+
+1. Adding directly question to Library
+2. Using feature ‘Update Library’ while creating Batch or Listing Questions
+
+Library Questions are accessible from main menu under **Design** >> **Questions Library**
+
+![Library](./QL1.png)
+
+![Library](./QL4.png)
+
+**Adding Directly**:
+On the ‘Library’ page one can view all the list of Library Questions,
+Now click on, ‘Add Question’ button at top right side of this page, this will open a form where one can create a Question, which has following elements;
+
+![Library](./QL2.png)
+
+![Library](./QL3.png)
+
+**Elements in Library Question**:
+
+**Module**: All Modules in the application are listed here in this dropdown, one has to select, respective Module that is related to survey.
+
+**Variables Name**: This is an identifier for Question, type a code for Question
+
+**Text**: Is the actual Question, Write a Question.
+
+**Answer Type**: Select an Answer Type from dropdown list, such that Question has to be answered in any one of these formats only, that is ‘Answer type’ should be: “Audio, Auto Generate, Date, Geo Point, Image, Multi choice, Multi Select, Numeric, Text and Video”
+
+A Library Question is created by filling above all fields, finally click on ‘Save’ button to Add Question to Library or click on ‘Save and Add More’ button to continue adding another Question.
+
+**Search**: One can find Questions in Library by two ways:
+**Sort** questions using ‘Answer Type’ dropdown at top left side of this page. Or
+**Search** using the search bar at top right side of this page, by providing text or code.
+
+**Export Questions**: On click, ‘Export Questions’ button, user can download the Library Questions in “.csv” file format.
+
+###Interviewer
+------
+Interviewer is a role in the system, one who conducts a Survey in the field.
+These Interviewers conducts the survey in the designated Enumeration areas and data collection is done using the hand-held mobile device like Android Smart Phone or Featured Phone using uSurvey App and USSD channels respectively.
+
+Data researcher enrolls Interviewer, assigns Survey and allocates to the Enumeration areas.
+
+Enrolled Interviewer are accessible from main menu under **Administration** >> **Interviewers**
+
+![Interviewer](./Interviewer1.png)
+
+**Interviewer Registration**
+
+On the ‘Interviewers’ page one can view list of enrolled Interviewers in the application, also can Add and Manage Interviewers.
+
+To register a new Interviewer, click on ‘Add Interviewer’ button at top right of the Interviewers page, this will open a registration form with following elements;
+
+![Interviewer](./Interviewer2.png)
+
+**Elements in the registration form**
+
+![Interviewer](./Interviewer4_1.png)
+
+**Select Locations**: Initially get list of Enumeration Areas (EA) by selecting respective, District, County, Sub-county and Parish from locations filters at top of this page, to allocate Enumeration areas to the Interviewer where survey has to be conducted.
+
+**Name**: Name of the Interviewer
+
+**Date of Birth**: Date of birth of the Interviewer
+
+**Gender**: Gender of the Interviewer
+
+**Education**: Education qualification of the Interviewer
+
+**Preferred Language**: select, Interviewer’s preferred language to write and speak
+
+**Survey**: Assign a Survey to the Interviewer, select a Survey from the list
+
+**Enumeration Area**: The places or locations where assigned Survey is supposed to be conducted by the Interviewer.
+To Search/choose EAs, at least a ‘District’ has to be selected from locations filters at top of this page, then EAs are available.
+
+**ODK Access**: The process of collecting data using Android channel is known as ODK Access, to provide permissions to access this channel, an Interviewer needs following ODK Access credentials;
+
+**ODK ID**: It is the User Id / User Name to access ODK channel, only alphabets are accepted
+
+**ODK Token**: It nothing but password to access ODK channel, only numeric values are accepted
+
+**Activated**: Allow access or prevent access to ODK channel
+
+**USSD Access**: The process of collecting data using Featured Phone is known as USSD Access, to access this channel, an Interviewer needs to provide Mobile Number.
+
+**Add Mobile Number**: System facilitates, accessing from multiple mobile numbers also. So one can add multiple mobile numbers or remove here using ‘Add’ and ‘Delete’ options.
+
+**Activated**: Allow access or prevent access to USSD channel
+
+Interviewer is enrolled by providing above all field, finally click on ‘Save’ button to complete the process.
+
+In this page, Interviewers are also managed, i.e. to Edit Details and block/unblock Interviewer.
+
+**Actions**:
+
+![Interviewer](./Interviewer3.png)
+
+**View Details**: View Interviewer profile and Edit details, all profile details, Survey Details, ODK Access and USSD Access details can be modified, just click on ‘Edit’ button at the bottom of the page.
+
+**Un Block/ Block**: Option to make Interviewer Active or In-Active to retain in the system.
+
+**Search**: One can find Interviewers in system by two ways:
+**Sort** Interviewers location wise by selecting respective, District, County, Sub-county and Parish using locations filters at top of this page. Or
+**Search** using the search bar at top right side of this page, by providing Interviewer’s Name.
+
+**Export Interviewers**: On click, ‘Export Interviewers’ button, user can download the Interviewers list in “.csv” file format.
+
+###Indicators
+------
+A Data Researcher can choose one or more fields from their survey and create an arithmetic expression to generate metrics as per their requirement. Each such expression is called an Indicator. Any number of indicators can be created for a Survey. A limited number of these indicators can be selected to be shown on the dashboard.
+Our system facilitates creating customized Indicators for every survey and show an analysis report in tabular and bar chart form.
+ Indicators are accessible from main menu under **Analyse** >> **Indicators**
+
+![Indicators](./Ind1.png)
+
+**How to create an Indicator?**
+
+On the ‘Indicator’ page one can view list of all survey wise Indicators in the application and can view analysis report.
+
+To create an Indicator, click on ‘Add Indicator’ button at top right of the Indicator page, this will open a blank form with following elements;
+
+![Indicators](./Ind2.png)
+
+**Elements in the Indicator form**
+
+![Indicators](./Ind3.png)
+
+**Survey**: Select Survey from list, for which the Indicator need to be defined
+ **Listing**: Select respective Listing, for which the Indicator need to be defined
+ **Indicator**: Give a name to the Indicator
+ **Description**: A short description about Indicator
+ **Variables**: To create an Indicator, certain metrics are needed for calculation, which are derived from survey/ listing questions
+ **Formulae**: Compose a formula using/based up on available Variables,
+ While composing formula, auto suggestion feature is available, which will prompt with the "Variables" already defined.
+ i.e. just type, double curly brackets ( {{ ), to get list of ‘Variables’ defined for an Indicator.
+ Ex: type {{ , to get “Variables”, then select any Variable to insert.
+ Like: {{hh_age}}, {{total_men}}, {{men_above_50_years}}
+ **Sample formula** for *Percentage of Male Age above 50 Years*: {{men_above_50_years}}/{{total_men}}*100
+
+![Indicators](./Ind12.png)
+
+**Display on dashboard**: This option allows the indicator to be displayed on the dashboard. A user can select a maximum of 5 indicators to be shown on the dashboard.
+
+**Add Variable**:
+
+To Add a Variable, click on respective ‘+’ icon adjacent to ‘Variables’ Text box, that opens form to define a Variable, following parameters are involved and expressed.
+
+![Indicators](./Ind5.png)
+
+![Indicators](./Ind6.png)
+
+![Indicators](./Ind7.png)
+
+**Parameters in Variable**:
+
+**Name**: Define a name to the Variable
+
+**Description**: A short description about Variable
+
+**Test question**: Select respective Listing questions, for which the Variable need to be defined.
+
+**Operator**: Select respective operator based up on the value of the above ‘Test question’
+
+Once all the above fields are filled, then click on ‘Add’ button to add to below table ‘Settings for this Variable’, since you can add more Variables for combination, once all Variables are defined then, finally click on ‘Save’ button to add to Variables list.
+
+![Indicators](./Ind8.png)
+
+![Indicators](./Ind9.png)
+
+![Indicators](./Ind10.png)
+
+ One can also ‘Edit’ and ‘Delete’ Variables using the respective icons adjacent to ‘Variables’ Text box.
+
+![Indicators](./Ind11.png)
+
+Once Variables are defined, now you can compose the formula in ‘Formulae’ Text box, the composed formula is validated automatically and a message is shown here as ‘Valid’ or ‘in valid’.
+
+![Indicators](./Ind13.png)
+
+Once Variables are defined, formula is composed and validated, finally click on ‘Save’ button to create an Indicator.
+
+On the ‘Indicator’ page one can view all the Indicator created in the application, in a tabular form with following column names:
+
+**Sts**: Represents Indicator display status on dashboard, that means status with color code indicates as:
+
+ • – Not Displayed
+ • – Displayed
+
+* **Indicator**: Is the title of Indicator, which is a unique identity to represent Indicator of a Survey.
+* **Description**: A short description about Indicator
+* **Survey**: Name of the Survey to which this Indicator belongs
+* **Batch**: Name of the Survey Batch to which this Indicator belongs
+
+* **Actions**:
+
+![Indicators](./Ind4.png)
+
+* **Edit**: click on, Action Item ‘Edit’, User can Edit all fields in Indicator.
+* **Delete**: click on, Action Item ‘Delete’, the Indicator is removed, before deleting you will be prompted with conformation to delete, click ‘Yes’ to Delete permanently
+* **Formula**: click on, Action Item ‘Formula’, to edit the Indicator Formula directly
+* **Analysis**: click on, Action Item ‘Analysis’, navigates to ‘Indicator Analysis’ page, here one can view two forms of district wise reports based up on the Indicator Formula,
+ + A Bar chart report is generated and displayed
+ + A tabular report
+
+###Manage Users
+------
+This section allows to add additional administration users to uSurvey.
+Portal Users’ enrollment is done here by Administrator, this system is developed in the model of ‘Role-based User access’, hence in the system we will find different ‘Roles’, based on application access privileges, these roles are defined. In this context, based on the ‘Roles’ of individual ‘Users’ access to perform a specific task, such as view, create or modify a form are given.
+
+#####Roles in the System
+**Administrator**: Granted full access to View, Add, Edit and Delete in entire application, including creating the users, uploading the location and also clear the data of any Survey/ Listing using ‘Power Mode’, etc.
+**Please note**: This Role is very powerful and one should be very careful while allocation
+
+**Data collector**: Have permission to View access only, but cannot create new Listing/Survey or any other new records.
+
+**Data Email Reports**: System will send daily email report of the latest data collected for the last day. who can also monitor the data on the Portal.
+
+**Researcher**: Have permission to View, Add and Edit Interviewer, Listing, Survey, Group, Module and create questionnaire.
+
+**Supervisor**: One who is superior to Interviewers, who can view the data of any Interviewer on the phone before submitting to the portal. And have permission to monitor the data on the Portal.
+
+**Viewer**: Have permission to View Dashboard and Analysis.
+
+#####Create Users
+
+Administrator enrolls portal Users and assign Roles.
+
+Enrolled Users are accessible from main menu under **Settings** >> **Users**
+
+![Users](./Users1.png)
+
+On the ‘Users’ page one can view list of enrolled Users in the application, also can Add and Manage Users.
+
+To enroll a new User, click on ‘Add User’ button at top right of the Users page, this will open a registration form with following elements;
+
+![Users](./Users2.png)
+
+![Users](./Users3.png)
+
+**Elements in the registration form**
+
+* **First Name**: First Name of the User
+* **Last Name**: Last Name of the User
+* **Email Address**: email id of the User
+* **Mobile Number**: Contact number of the User
+* **Roles**: Assign a desired Role to the User
+* **User Name**: Enter the desired username for the User, to access the portal
+* **Password**: provide password
+* **Confirm Password**: conform once again password provided
+
+A New User is enrolled by providing above all field, finally click on ‘Save Changes’ button to complete the process.
+ In this page, Users are also managed, i.e. to Edit Details and Activate/Deactivate User
+
+**Actions**:
+
+**View Details**: View User profile and Edit details, just click on ‘Edit’ button at the bottom of the page
+ **Edit**: To quickly edit User profile
+ **Activate/Deactivate**: Option to make User Active or In-Active to retain in the system.
+
+* **Search**: One can find Users in system by two ways:
+* **Sort** Users by their ‘Status’ by selecting status at top of this page. Or
+* **Search** using the search bar at top right side of this page, by providing User’s Name.
+
+**Export Users**: On click, ‘Download Users’ button, one can export the Users list in “.csv” file format.
+
diff --git a/docs/Users1.png b/docs/Users1.png
new file mode 100644
index 00000000..8fbdf75d
Binary files /dev/null and b/docs/Users1.png differ
diff --git a/docs/Users2.png b/docs/Users2.png
new file mode 100644
index 00000000..920b30dd
Binary files /dev/null and b/docs/Users2.png differ
diff --git a/docs/Users3.png b/docs/Users3.png
new file mode 100644
index 00000000..16c8b2b6
Binary files /dev/null and b/docs/Users3.png differ
diff --git a/docs/addvariable.png b/docs/addvariable.png
new file mode 100644
index 00000000..07231343
Binary files /dev/null and b/docs/addvariable.png differ
diff --git a/administrative_divisions.csv.example b/docs/administrative_divisions.csv.example
similarity index 100%
rename from administrative_divisions.csv.example
rename to docs/administrative_divisions.csv.example
diff --git a/docs/administrative_divisions_india.csv.example b/docs/administrative_divisions_india.csv.example
new file mode 100644
index 00000000..f19f961a
--- /dev/null
+++ b/docs/administrative_divisions_india.csv.example
@@ -0,0 +1,13 @@
+Country,State,District,Mandal,Village,EANAME
+INDIA,ANDHRAPRADESH,PRAKASAM,MARKAPURAM,MARKAPURAM,MARKAPURAM A
+INDIA,ANDHRAPRADESH,PRAKASAM,MARKAPURAM,MARKAPURAM,MARKAPURAM B
+INDIA,ANDHRAPRADESH,PRAKASAM,YERRRAGONDAPALEM,YERRAGONDAPALEM,YERRAGONDAPALEM
+INDIA,ANDHRAPRADESH,GUNTUR,GUNTUR,MACHERLA,MACHERLA PLACES
+INDIA,ANDHRAPRADESH,PRAKASAM,MARKAPURAM,DEVARAJUGATTU,DEVARAJUGATTU
+INDIA,TELANGANA,HYDERABAD,RANGAREDDY,KUKATPALLY,KUKATPALLY
+INDIA,TELANGANA,HYDERABAD,RANGAREDDY,NIJAMPET,NIJAMPET A
+INDIA,TELANGANA,HYDERABAD,RANGAREDDY,NIJAMPET,NIJAMPET B
+INDIA,TELANGANA,HYDERABAD,RANGAREDDY,NIJAMPET,NIJAMPET C
+INDIA,TELANGANA,HYDERABAD,RANGAREDDY,BACHEPALLY,BACHEPALLY
+INDIA,TELANGANA,HYDERABAD,RANGAREDDY,LINGAMPALLY,LINGAMPALLY
+INDIA,TELANGANA,HYDERABAD,RANGAREDDY,MADHEENAGOODA,MADHEENAGOODA
diff --git a/docs/deployment_guide.md b/docs/deployment_guide.md
index 39f50fd1..77d8416f 100644
--- a/docs/deployment_guide.md
+++ b/docs/deployment_guide.md
@@ -32,7 +32,7 @@ For development purpose, please see following considerations:
* uSurvey has been tested on Ubuntu and OS X. However it should run on most Linux machines (since there are no distribution specific dependency).
-* Minimum of 1GB RAM, 1.6GHz 1 CPU core, 20GB disk space is required for setup and testing.
+* 16GB RAM, 2.5GHz 4+ core processors and 200GB disk space should suffice for a typical setup (though actual sizing depends on projected traffic).
* Postgres and redis-server needs to be installed and should be running (all can run on same machine, but you'll get better experience with higher RAM and CPU specs in that case)
@@ -94,4 +94,4 @@ As an option, three models exist for hosting uSurvey:
1. Local instance deployed and managed on your servers.
2. Dedicated hosting deployed and managed in the cloud.
3. Shared hosting where your instance would coexist with others (although your data would be collected separately).
-
\ No newline at end of file
+
diff --git a/docs/docker_installation.md b/docs/docker_installation.md
new file mode 100644
index 00000000..c3f6d49e
--- /dev/null
+++ b/docs/docker_installation.md
@@ -0,0 +1,109 @@
+Docker Setup (Linux)
+===================
+
+* This section covers uSurvey installation from docker image.
+* For uSurvey installation from source, [check here](./installation.md)
+
+
+Prerequisites
+-------------
+
+* Linux Machine (Preferably Ubuntu 12+)
+
+* Minimum of 2GB RAM for test environment
+
+* 16GB RAM should be enough for production setups with less than 1 million survey submissions per day on a 2GHz clock speed machine.
+
+* Docker must be installed. You can find details for your Linux [here](https://docs.docker.com/engine/installation/)
+
+
+Quick Start
+-----------
+
+* Clone the uSurvey Application from Github
+
+ git clone https://github.com/unicefuganda/uSurvey.git
+
+
+* Enter the project directory
+
+ cd uSurvey
+
+* Update the database entries in ``.env`` file in the project directory
+
+* Run the setup script in the project directory and follow the instructions
+
+ chmod +x docker_setup_linux.sh
+
+ ./docker_setup_linux.sh
+
+
+ * This step performs the following activities:
+ 1. Creates path where database files are stored on host machine
+ 2. Loads the necessary Permissions categories.
+ 3. Creates a super user to enable you login to uSurvey (requires you to supply login credentials)
+ 4. Attempts to setup up the map for your country
+
+* Once done, enter the following address on your browser to be sure uSurvey is properly setup:
+
+
+ http://localhost:8071/
+
+
+
+Customizing the country data
+----------------------------
+
+###Loading Location Data
+
+* Before using the setup, you need to load data for administrative divisions of the required country.
+
+ * A sample of the required CSV file is available in the project directory ([administrative_divisions.csv.example](./administrative_divisions.csv.example) for Uganda and [administrative_divisions_india.csv.example](./administrative_divisions_india.csv.example) for India)
+
+* To load administrative divisions into the system, run the following commands from the project directory and follow the steps:
+
+
+ sh ./loaders/load_ea_locations.sh
+
+####Note
+**The first line of the csv file shall be taken as file header.**
+
+**The file header is expected to contain names as per the administrative division in a comma separated format. In addition, there can be an additional header for enumeration area. This header should be named *EAName*. Sample file for Uganda is included in the project directory as [administrative_divisions.csv.example](./administrative_divisions.csv.example).**
+
+
+###Setting Up Map Reporting
+
+**If you plan to use uSurvey in Uganda, then this step is not required!**
+
+**The recommended way to setup the map on linux is using the docker_setup_linux.sh script. However if that fails, the following steps explains how map setup can be done manually**
+
+To enable uSurvey capture survey data in a specific country's map, you need to update the map settings section within the ``.env`` file. This file is available in the project directory.
+
+This is required because uSurvey must be made aware of the shape file to use.
+
+The the map settings section holds sufficient documentation on the purpose of each settings field.
+
+The expected GeoJson files should be compatible with specification at [http://geojson.org/geojson-spec.html](http://geojson.org/geojson-spec.html)
+
+The GeoJson file for your country most likely can be downloaded from [https://mapzen.com/data/borders/](https://mapzen.com/data/borders/).
+
+Several shape files are presented there for each download so be sure to select the file which captures the administrative level map which you are interested in.
+
+
+Starting Up
+-----------
+
+* **By default uSurvey is set to run on 8071, however you can change this in the .env file**
+* **You can have uSurvey sit behind a reverse proxy server like nginx also.**
+* **With current the docker setup, you can scale up just as easily as with any docker containers.**
+
+####Note:
+ * If you have started uSurvey with the docker_setup_linux.sh, then uSurvey must already be up and running.
+
+* To startup using docker-compose, run the command below:
+
+ docker-compose up -d
+
+* To stop uSurvey using docker-compose, run the command below:
+
+ docker-compose down
diff --git a/docs/index.md b/docs/index.md
index dbdf0bcb..bec80f44 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -1,73 +1,130 @@
Welcome to uSurvey’s documentation!
-===================================
+========
uSurvey is an innovative data collection tool designed to provide statistically representative real time estimates of a given indicator. It runs on USSD (Unstructured Supplementary Service Data) interactive secured channel and on ODK (Open Data Kit), for off-line data collection in locations with intermittent mobile network connections.
The system has been designed to collect a wide range of data for the structured survey; to generate and produce descriptive statistics and graphical representation of the collected information whenever desired, as well as during the process of data collection.
-
Source code for this project is available on github [here](https://github.com/unicefuganda/uSurvey/ "github repo").
-Features
---------
+###Features
+------
* Admin management portal
-
-* Highly customizable surveys
-
-* Online data collection via USSD channel
-
-* Offline data collection via ODK collect
-
-* Dynamic generation and download of ODK forms from defined survey questions on the admin portal
-
-* Support for simple conditional question flows
-
-* Inbuilt ODK aggregator.
-
-
-User Guides
------------
-
-* **User Manual**
- * [uSurvey User Manual](./user_manual.md#usurvey-user-manual)
- * [Login](./user_manual.md#login)
- * [Map Page](./user_manual.md#map-page)
- * [Interviewer Page](./user_manual.md#interviewer-page)
- * [Managing Enumeration Area](./user_manual.md#managing-enumeration-area)
- * [Question Module](./user_manual.md#question-module)
- * [House Member Group](./user_manual.md#house-member-group)
- * [Question Library](./user_manual.md#question-library)
- * [Survey Management](./user_manual.md#survey-management)
- * [Enabling Batch For Data Collection](./user_manual.md#enabling-batch-for-data-collection)
- * [Download Data](./user_manual.md#download-data)
- * [Batch Data Collecting Interviewers](./user_manual.md#batch-data-collecting-interviewers)
- * [Analysis](./user_manual.md#analysis)
- * [Survey Completion Statistics](./user_manual.md#survey-completion-statistics)
- * [Managing Users](./user_manual.md#managing-users)
-
-* **Offline Data Collection**
- * [Offline Data Collection](./odk_guide.md#offline-data-collection)
- * [What do I need to collect data offline?](./odk_guide.md#what-do-i-need-to-collect-data-offline)
- * [How To Use ODK Collect For uSurvey?](./odk_guide.md#how-to-use-odk-collect-for-usurvey)
- * [Download ODK collect from Google Play](./odk_guide.md#download-odk-collect-from-google-play)
- * [Using the ODK collect](./odk_guide.md#using-the-odk-collect)
-
-* **USSD Integration**
- * [USSD Integration](./ussd-integration.md#ussd-integration)
- * [What do I need to conduct survey on USSD?](./ussd-integration.md#what-do-i-need-to-conduct-survey-on-ussd)
-
-* **Set up Guide**
- * [Prerequisites](./installation.md#prerequisites)
- * [Installation Instructions](./installation.md#installation-instructions)
- * [Before Using The System](./installation.md#before-using-the-system)
- * [Starting Up](./installation.md#starting-up)
-
-* **Deployment Guide**
- * [uSurvey Deployment](./deployment_guide.md#usurvey-deployment)
- * [Application Architecture](./deployment_guide.md#application-architecture)
- * [Components](./deployment_guide.md#components)
- * [Deployment Considerations](./deployment_guide.md#deployment-considerations)
- * [uSurvey Hosting](./deployment_guide.md#usurvey-hosting)
-
-* **Tests**
- * [Testing](./tests.md)
-
+* Classification of surveys using Modules
+* Classification of population using Groups
+* Highly customizable Listings and Surveys
+* Preview questionnaire before go-live
+* Offline data collection Using Smart Phone
+* Online data collection Using Featured Phone
+* Download, search and edit submitted forms in uSurvey App
+* Country Map is used to demonstrate district wise Completion rates and Indicators
+* Customizable Indicators to measure survey results
+* Configurable data analysis reports generation
+
+###Getting Started
+------
+**General flow of the uSurvey**:
+
+* Admin creates uSurvey Users and assigns them Roles
+* Data Researcher defines Modules, Groups, Listing, Surveys, Batches and creates questionnaires for Listing & Batch in the application
+* Data Researcher also defines ‘Interviewers’ and assigns them to an Enumeration area to conduct Listing or Survey
+* In the field, Interviewer does data collection in the designated Enumeration area
+* Data collection is done using hand-held mobile devices like Android Smart Phone or Featured Phone via uSurvey App and USSD channel respectively.
+* Captured data is sent to uSurvey portal
+* Data collected by Interviewers is then viewed on the uSurvey portal for reporting and analysis
+
+###Work Flow
+------
+Following are the simple steps to be executed in the given sequence, to ensure a Survey is completed.
+
+######Step -1: Create a Module
+
+Create [New Module](./User_Guides.md#modules) or skip this step, if you want to use existing Modules
+######Step -2: Create a Group
+
+Create [New Group](./User_Guides.md#groups) or skip this step, if you want to use existing Groups
+######Step -3: Create a Listing
+
+In Listing, we have 3 choices as follows:
+
+
+
3.0. Create New Listing
+                          or
+            Use existing Listing - Proceed to reuse Listing data already collected
+                          or
+            Clone existing Listing – Proceed to reuse Listing questions only
+
+
3.1. Create Questions in Listing
+
3.2. Create Looping in questions (If necessary)
+
3.3. Add Logic to questions (If necessary)
+
+
+######Step -4: Create a Survey
+
+In Survey, we have 2 choices as follows:
+
+
+
+
4.0. Create New Survey
+                          or
+          Clone existing Survey and rename: Proceed to reuse the survey along with Listing data and ready to use.
+
+
+
4.1. Create Batch
+
4.2. Create Questions in Batch (If necessary)
+
4.3. Create Looping in questions and
+
4.4. Add Logic to questions
+
4.5. Finally, enable Batch for data collection, via Action Item ‘Open/Close’ for Batch
+ Please note that Survey can not be downloaded on Mobile until this step is done
+
+
+######Step -5: Enroll Interviewer
+
+To conduct a Survey in the field, enroll an [Interviewer](./User_Guides.md#interviewer) as follows:
+
+
+
5.0. Provide basic Interviewer details,
+
5.1. Assign a Survey,
+
5.2. Allocate Enumeration Areas,
+
5.3. Create ODK Access ID,
+
5.4. Provide Mobile Number to access via USSD channel
+
5.5. Finally, finish enrollment
+
+Note: At any point on the uSurvey portal, use breadcrumbs on top of each page for easy navigation.
+
+######Step -6: Conduct Survey
+
+Data collection and submission is done in two ways:
+
+ 1. Offline Data Collection - [Using Smart Phone](./ODK_App.md#offline-data-collection)
+2. Online Data Collection - [Using Featured Phone](./ODK_App.md#online-data-collection)
+
+###Complete List of User Guides
+------
++ ######User Manual
+ - [Modules](./User_Guides.md#modules)
+ - [Groups](./User_Guides.md#groups)
+ - [Listing](./User_Guides.md#listing)
+ - [Survey](./User_Guides.md#create-survey)
+ - [Question Library](./User_Guides.md#library-questions)
+ - [Interviewers](./User_Guides.md#interviewer)
+ - [Indicators](./User_Guides.md#indicators)
+ - [Manage Users](./User_Guides.md#manage-users)
+
++ ######Data Collection
+ - [Introduction](./ODK_App.md#introduction)
+ - [Offline Data Collection](./ODK_App.md#offline-data-collection)
+ - [Online Data Collection](./ODK_App.md#online-data-collection)
+
++ ######Installation Guide
+ - [Prerequisites](./installation.md#prerequisites)
+ - [Installation (from source)](./installation.md#installation-instructions)
+ - [Installation (docker)](./docker_installation.md)
+
++ ######Deployment Guide
+ - [uSurvey Deployment](./deployment_guide.md)
+ - [Application Architecture](./deployment_guide.md#application-architecture)
+ - [Components](./deployment_guide.md#components)
+ - [Hosting](./deployment_guide.md#usurvey-hosting)
+
++ ######Testing & Coverage
+ - [Tests](./tests.md)
diff --git a/docs/installation.md b/docs/installation.md
index cb89ff95..2b6bfe00 100644
--- a/docs/installation.md
+++ b/docs/installation.md
@@ -1,9 +1,21 @@
+uSurvey Installation (From source)
+==================================
+
+* This section covers uSurvey installation from source.
+
+Installation from docker image
+------------------------------
+* **For uSurvey installation from already prepared docker image, [check here](./docker_installation.md)**
+
+
Prerequisites
--------------
+-------------
* Has been tested on Ubuntu and OS X. However it should run on most Linux machines (since there are no distribution specific dependency).
-* For development server, minimum of 1GB RAM, 1.6GHz 1 CPU core is required for setup (for production sizing requirements see the relevant section in the [Deployment guide](./deployment_guide.md#deployment-considerations "Deployment Guide")).
+* Minimum of 2GB RAM for test environment
+
+* 16GB RAM should be enough for production setups with less than 1million survey submissions per day on a 2GHz clock speed machine..
* Postgres, redis-server should be running
@@ -17,17 +29,30 @@ Prerequisites
Installation Instructions
-------------------------
-* Execute the following commands from your installation directory:
+* Clone the uSurvey Application from Github
git clone https://github.com/unicefuganda/uSurvey.git
- cd uSurvey/mics
+* Switch to dev branch (most recent changes are here. Merge with main branch is in progress)
+
+ cd uSurvey
+ git checkout dev
+
+* Go to mics folder in uSurvey
+
+ cd mics
+
+* Copy customized settings in localsettings.py
cp travis-settings.py localsettings.py
(adjust localsettings.py for db and test_db setup)
+
+* Go to survey folder in uSurvey
cd ../survey
+* Copy config file interviewer_configs.py
+
cp interviewer_configs.py.example interviewer_configs.py
cd ..
@@ -103,4 +128,4 @@ Starting Up
supervisord -c supervisord.conf
> In supervisord.conf, the configuration under [program:odk-server] is required to serve ODK requests, while the configuration under [program:django-interface-server] is for serving other requests.
-> Only the ports configured in [program:odk-server] and [program:django-interface-server] are required to handle requests. Other ports configured on supervisord.conf file are for managing supervisor
+> Only the ports configured in [program:odk-server] and [program:web-app-server] are required to handle requests. Other ports configured on supervisord.conf file are for managing supervisor
diff --git a/docs/odk_guide.md b/docs/odk_guide.md
index 17494992..75ad2498 100644
--- a/docs/odk_guide.md
+++ b/docs/odk_guide.md
@@ -1,30 +1,3 @@
-Introduction
-============
-
-Once a survey is designed on the uSurvey portal, the data can be collected online using the USSD channel or offline using ODK Collect.
-
-Offline data collection on uSurvey happens with the use of [ODK Collect](./https://play.google.com/store/apps/details?id=org.odk.collect.android&hl=en).
-
-ODK Collect provides support for richer datasets compared to USSD (for example, it supports media files and GPS location capture).
-
-Because data collection on ODK is entirely offline, it enables data collection in regions where network connectivity might be an issue. For this, data can be collected seamlessly for as many participants as possible into corresponding Android device and upon completion, all the data can be uploaded once to the server in a location with connectivity.
-
-
-###What do I need to collect data offline?
-
-1. An Android device able to run [ODK Collect](./https://play.google.com/store/apps/details?id=org.odk.collect.android&hl=en). Typically Jelly Bean and newer versions should be fine.
-2. The Android device needs to have some space to keep collected data (If your survey does not require the upload of media files, 100MB space would usually be big enough. But having 1GB dedicated for uSurvey is best).
-2. You need to configure ODK collect to use the in-built ODK aggregator in uSurvey (described below).
-3. Enter your interviewer credentials and download the survey allocated to you
-
-Once you have completed the above steps, you can collect the survey data completely offline! Upon completion, you move to a location with network connectivity to upload to uSurvey.
-
-
-
-
-How To Use ODK Collect For uSurvey?
-==================================
-
To use the ODK Collect for uSurvey is easy. Just follow the steps below and you are good to go.
###Download ODK collect from Google Play
diff --git a/docs/tests.md b/docs/tests.md
index 63c39f1b..d20aa3ec 100644
--- a/docs/tests.md
+++ b/docs/tests.md
@@ -18,5 +18,4 @@ Travis builds are a pass only when the the project builds without errors and all
coverage report
-[![Build Status](https://travis-ci.org/unicefuganda/uSurvey.svg)](https://travis-ci.org/unicefuganda/uSurvey)
-[![Coverage Status](https://coveralls.io/repos/unicefuganda/uSurvey/badge.png)](https://coveralls.io/r/unicefuganda/uSurvey)
\ No newline at end of file
+[![Build Status](https://travis-ci.org/unicefuganda/uSurvey.svg)](https://travis-ci.org/unicefuganda/uSurvey)
\ No newline at end of file
diff --git a/docs/uSurvey-Deployment-Architecture.jpg b/docs/uSurvey-Deployment-Architecture.jpg
index d43abb76..9f65c19b 100644
Binary files a/docs/uSurvey-Deployment-Architecture.jpg and b/docs/uSurvey-Deployment-Architecture.jpg differ
diff --git a/docs/uSurvey_LOC.jpg b/docs/uSurvey_LOC.jpg
new file mode 100644
index 00000000..e8c93ea1
Binary files /dev/null and b/docs/uSurvey_LOC.jpg differ
diff --git a/docs/uSurvey_flow.png b/docs/uSurvey_flow.png
new file mode 100644
index 00000000..a2d0fd53
Binary files /dev/null and b/docs/uSurvey_flow.png differ
diff --git a/docs/uSurvey_manual.md b/docs/uSurvey_manual.md
new file mode 100644
index 00000000..f2781e62
--- /dev/null
+++ b/docs/uSurvey_manual.md
@@ -0,0 +1,43 @@
+Welcome to uSurvey’s documentation!
+========
+uSurvey is an innovative data collection tool designed to provide statistically representative real time estimates of a given indicator. It runs on USSD (Unstructured Supplementary Service Data) interactive secured channel and on ODK (Open Data Kit), for off-line data collection in locations with intermittent mobile network connections.
+
+The system has been designed to collect a wide range of data for the structured survey; to generate and produce descriptive statistics and graphical representation of the collected information whenever desired, as well as during the process of data collection.
+Source code for this project is available on github [here]()
+
+User Guides
+-----------
+
+* **Dashboard**
+
+* **Design**
+ * [Survey](./Survey.md)
+ * [Listing](./Listing.md)
+ * [Modules](./Modules.md)
+ * [Groups](./Groups.md)
+ * [Question Library](./Library.md)
+
+* **Administration**
+ * [Interviewers](./Interviewer.md)
+ * [Notification](http://usurvey.unicefuganda.org/bulk_sms)
+ * [Data Entry](#)
+
+* **Monitor**
+ * [Listing Data](#)
+ * [Batch Data](#)
+ * [Completion Summary](http://usurvey.unicefuganda.org/surveys/interviewers_completion/)
+ * [ODK Submission](http://usurvey.unicefuganda.org/odk/aggregate/submission_list/)
+
+* **Analyse**
+ * [Indicators](http://usurvey.unicefuganda.org/indicators/)
+ * [Result](#)
+ * [Location Weights](http://usurvey.unicefuganda.org/locations/weights/)
+
+* **Download**
+ * [Survey Data](http://usurvey.unicefuganda.org/aggregates/download_spreadsheet)
+ * [Mobile Money Sheet](http://usurvey.unicefuganda.org/interviewer_report/)
+
+* **Settings**
+ * [Users](http://usurvey.unicefuganda.org/users/)
+ * [Locations](http://usurvey.unicefuganda.org/enumeration_area/)
+ * [Setup](#)
\ No newline at end of file
diff --git a/manage.py b/manage.py
deleted file mode 100755
index 14ae57cc..00000000
--- a/manage.py
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env python
-import os
-import sys
-
-if __name__ == "__main__":
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mics.settings")
-
- from django.core.management import execute_from_command_line
-
- execute_from_command_line(sys.argv)
diff --git a/mics/__init__.py b/mics/__init__.py
deleted file mode 100644
index 396f90fd..00000000
--- a/mics/__init__.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# # register a signal do update permissions every migration.
-# # This is based on app django_extensions update_permissions command
-# from south.signals import post_migrate
-#
-# def update_permissions_after_migration(app,**kwargs):
-# """
-# Update app permission just after every migration.
-# This is based on app django_extensions update_permissions management command.
-# """
-# import settings
-# from django.db.models import get_app, get_models
-# from django.contrib.auth.management import create_permissions
-#
-# create_permissions(get_app(app), get_models(), 2 if settings.DEBUG else 0)
-#
-# post_migrate.connect(update_permissions_after_migration)
diff --git a/mics/asgi.py b/mics/asgi.py
deleted file mode 100644
index f5e1ccfd..00000000
--- a/mics/asgi.py
+++ /dev/null
@@ -1,6 +0,0 @@
-import os
-from channels.asgi import get_channel_layer
-
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mics.settings")
-
-channel_layer = get_channel_layer()
diff --git a/mics/include/python2.7 b/mics/include/python2.7
deleted file mode 120000
index ad4ca80b..00000000
--- a/mics/include/python2.7
+++ /dev/null
@@ -1 +0,0 @@
-/usr/include/python2.7
\ No newline at end of file
diff --git a/mics/local/__init__.py b/mics/local/__init__.py
deleted file mode 120000
index fa871271..00000000
--- a/mics/local/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-/home/manish/projects/uSurvey/mics/mics/__init__.py
\ No newline at end of file
diff --git a/mics/local/include b/mics/local/include
deleted file mode 120000
index 985d4caf..00000000
--- a/mics/local/include
+++ /dev/null
@@ -1 +0,0 @@
-/home/manish/projects/uSurvey/mics/mics/include
\ No newline at end of file
diff --git a/mics/local/settings.py b/mics/local/settings.py
deleted file mode 120000
index b1ce1368..00000000
--- a/mics/local/settings.py
+++ /dev/null
@@ -1 +0,0 @@
-/home/manish/projects/uSurvey/mics/mics/settings.py
\ No newline at end of file
diff --git a/mics/local/snap-ci b/mics/local/snap-ci
deleted file mode 120000
index 74efb735..00000000
--- a/mics/local/snap-ci
+++ /dev/null
@@ -1 +0,0 @@
-/home/manish/projects/uSurvey/mics/mics/snap-ci
\ No newline at end of file
diff --git a/mics/local/testsettings.py b/mics/local/testsettings.py
deleted file mode 120000
index b51273f1..00000000
--- a/mics/local/testsettings.py
+++ /dev/null
@@ -1 +0,0 @@
-/home/manish/projects/uSurvey/mics/mics/testsettings.py
\ No newline at end of file
diff --git a/mics/local/travis-settings.py b/mics/local/travis-settings.py
deleted file mode 120000
index 6d4ed3cf..00000000
--- a/mics/local/travis-settings.py
+++ /dev/null
@@ -1 +0,0 @@
-/home/manish/projects/uSurvey/mics/mics/travis-settings.py
\ No newline at end of file
diff --git a/mics/local/urls.py b/mics/local/urls.py
deleted file mode 120000
index 332bf6d3..00000000
--- a/mics/local/urls.py
+++ /dev/null
@@ -1 +0,0 @@
-/home/manish/projects/uSurvey/mics/mics/urls.py
\ No newline at end of file
diff --git a/mics/local/wsgi.py b/mics/local/wsgi.py
deleted file mode 120000
index 19679f5c..00000000
--- a/mics/local/wsgi.py
+++ /dev/null
@@ -1 +0,0 @@
-/home/manish/projects/uSurvey/mics/mics/wsgi.py
\ No newline at end of file
diff --git a/mics/routing.py b/mics/routing.py
deleted file mode 100644
index f0c71611..00000000
--- a/mics/routing.py
+++ /dev/null
@@ -1,38 +0,0 @@
-__author__ = 'anthony'
-from django.conf import settings
-from channels.routing import route
-from channels import Channel, Group
-from channels.sessions import channel_session
-from channels.auth import http_session_user, channel_session_user, channel_session_user_from_http
-
-
-def get_group_path(user, path):
- path = path.strip("/")
- return '%s/%s' % (path, user.pk)
-
-
-@channel_session_user_from_http
-def ws_add(message):
- print 'incoming ', message.user.pk
- path = message.content['path']
- if message.user.is_authenticated():
- Group(get_group_path(message.user, path)).add(message.reply_channel)
-
-
-@channel_session_user
-def ws_message(message):
- pass
-
-
-@channel_session_user
-def ws_disconnect(message):
- path = message.content['path']
- if message.user.is_authenticated():
- Group(get_group_path(message.user, path)
- ).discard(message.reply_channel)
-
-channel_routing = [
- route("websocket.connect", ws_add, path=r"^%s$" % settings.WEBSOCKET_URL),
- route("websocket.receive", ws_message),
- route("websocket.disconnect", ws_disconnect),
-]
diff --git a/mics/settings.py b/mics/settings.py
deleted file mode 100644
index deb3c354..00000000
--- a/mics/settings.py
+++ /dev/null
@@ -1,372 +0,0 @@
-# Django settings for mics project.
-import os
-BASE_DIR = os.path.dirname(os.path.dirname(__file__))
-
-DEBUG = False
-TEMPLATE_DEBUG = DEBUG
-
-ADMINS = (
- # ('Your Name', 'your_email@example.com'),
-)
-
-PROJECT_TITLE = 'uSurvey'
-COUNTRY = 'UGANDA'
-
-MANAGERS = ADMINS
-
-DATABASES = {
- 'default': {
- # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
- 'ENGINE': 'django.db.backends.',
- # Or path to database file if using sqlite3.
- 'NAME': '',
- # The following settings are not used with sqlite3:
- 'USER': '',
- 'PASSWORD': '',
- # Empty for localhost through domain sockets or '127.0.0.1' for
- # localhost through TCP.
- 'HOST': '',
- 'PORT': '', # Set to empty string for default.
- }
-}
-
-CACHES = {
- 'default': {
- 'BACKEND': 'redis_cache.RedisCache',
- 'LOCATION': [
- '127.0.0.1:6379',
- ],
- 'OPTIONS': {
- 'DB': 1,
- 'PARSER_CLASS': 'redis.connection.HiredisParser',
- 'CONNECTION_POOL_CLASS': 'redis.BlockingConnectionPool',
- 'CONNECTION_POOL_CLASS_KWARGS': {
- 'max_connections': 50,
- 'timeout': 500,
- },
- 'MAX_CONNECTIONS': 1000,
- 'PICKLE_VERSION': -1,
- },
- },
-}
-
-# Hosts/domain names that are valid for this site; required if DEBUG is False
-# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
-ALLOWED_HOSTS = ['127.0.0.1', 'localhost']
-
-# Local time zone for this installation. Choices can be found here:
-# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
-# although not all choices may be available on all operating systems.
-# In a Windows environment this must be set to your system time zone.
-TIME_ZONE = 'Africa/Kampala'
-
-# Language code for this installation. All choices can be found here:
-# http://www.i18nguy.com/unicode/language-identifiers.html
-LANGUAGE_CODE = 'en-us'
-
-SITE_ID = 1
-
-# If you set this to False, Django will make some optimizations so as not
-# to load the internationalization machinery.
-USE_I18N = True
-
-# If you set this to False, Django will not format dates, numbers and
-# calendars according to the current locale.
-USE_L10N = True
-
-# If you set this to False, Django will not use timezone-aware datetimes.
-USE_TZ = True
-
-# Absolute filesystem path to the directory that will hold user-uploaded files.
-# Example: "/var/www/example.com/media/"
-MEDIA_ROOT = ''
-
-# URL that handles the media served from MEDIA_ROOT. Make sure to use a
-# trailing slash.
-# Examples: "http://example.com/media/", "http://media.example.com/"
-MEDIA_URL = ''
-
-# Absolute path to the directory static files should be collected to.
-# Don't put anything in this directory yourself; store your static files
-# in apps' "static/" subdirectories and in STATICFILES_DIRS.
-# Example: "/var/www/example.com/static/"
-STATIC_ROOT = ''
-
-# URL prefix for static files.
-# Example: "http://example.com/static/", "http://static.example.com/"
-STATIC_URL = '/static/'
-
-# Additional locations of static files
-STATICFILES_DIRS = (
- # Put strings here, like "/home/html/static" or "C:/www/django/static".
- # Always use forward slashes, even on Windows.
- # Don't forget to use absolute paths, not relative paths.
-)
-
-# List of finder classes that know how to find static files in
-# various locations.
-STATICFILES_FINDERS = (
- 'django.contrib.staticfiles.finders.FileSystemFinder',
- 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
- # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
-)
-
-# Make this unique, and don't share it with anybody.
-SECRET_KEY = '6-bycz-+xpv@9+u8b^)#$-l&3cheum3i4cb_6$u6s%j6uu6s91'
-
-# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
- 'django.template.loaders.filesystem.Loader',
- 'django.template.loaders.app_directories.Loader',
- # 'django.template.loaders.eggs.Loader',
-)
-
-TEMPLATE_CONTEXT_PROCESSORS = (
- "django.contrib.auth.context_processors.auth",
- "django.core.context_processors.debug",
- "django.core.context_processors.i18n",
- "django.core.context_processors.media",
- "django.core.context_processors.static",
- "django.contrib.messages.context_processors.messages",
- "survey.context_processor.context_extras",
- "django.core.context_processors.request",
-)
-
-MIDDLEWARE_CLASSES = (
- 'django.middleware.common.CommonMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.middleware.csrf.CsrfViewMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
- 'pagination_bootstrap.middleware.PaginationMiddleware',
- 'breadcrumbs.middleware.BreadcrumbsMiddleware',
- # Uncomment the next line for simple clickjacking protection:
- # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
-)
-
-ROOT_URLCONF = 'mics.urls'
-
-# Python dotted path to the WSGI application used by Django's runserver.
-WSGI_APPLICATION = 'mics.wsgi.application'
-
-TEMPLATE_DIRS = (
- # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
- # Always use forward slashes, even on Windows.
- # Don't forget to use absolute paths, not relative paths.
- os.path.join(BASE_DIR, 'survey', 'templates'),
-)
-
-INSTALLED_APPS = (
- 'django.contrib.contenttypes',
- 'django.contrib.auth',
- 'django.contrib.sessions',
- 'django.contrib.sites',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- 'django.contrib.admin',
- 'django_nose',
- 'lettuce.django',
- 'django_extensions',
- 'pagination_bootstrap',
- 'cacheops',
- 'survey',
- 'mptt',
- 'django_rq',
- 'django_rq_dashboard',
- 'channels',
- # Uncomment the next line to enable the admin:
- # 'django.contrib.admin',
- # Uncomment the next line to enable admin documentation:
- # 'django.contrib.admindocs',
-)
-
-CHANNEL_LAYERS = {
- "default": {
- "BACKEND": "asgi_redis.RedisChannelLayer",
- "CONFIG": {
- "hosts": [("localhost", 6379)],
- },
- "ROUTING": "mics.routing.channel_routing",
- },
-}
-
-
-# A sample logging configuration. The only tangible logging
-# performed by this configuration is to send an email to
-# the site admins on every HTTP 500 error when DEBUG=False.
-# See http://docs.djangoproject.com/en/dev/topics/logging for
-# more details on how to customize your logging configuration.
-LOGGING = {
- 'version': 1,
- 'disable_existing_loggers': False,
- 'filters': {
- 'require_debug_false': {
- '()': 'django.utils.log.RequireDebugFalse'
- }
- },
- 'handlers': {
- 'mail_admins': {
- 'level': 'ERROR',
- 'filters': ['require_debug_false'],
- 'class': 'django.utils.log.AdminEmailHandler'
- }
- },
- 'loggers': {
- 'django.request': {
- 'handlers': ['mail_admins'],
- 'level': 'ERROR',
- 'propagate': True,
- },
- }
-}
-
-CACHEOPS_REDIS = {
- 'host': 'localhost', # redis-server is on same machine
- 'port': 6379, # default redis port
- 'db': 1, # SELECT non-default redis database
- # using separate redis db or redis instance
- # is highly recommended
-
-}
-
-CACHE_REFRESH_DURATION = 10800
-CACHEOPS = {
- # refresh every 3 hrs
- 'survey.point': {'ops': ('all', ), 'timeout': CACHE_REFRESH_DURATION},
- # refresh every 3 hrs
- 'survey.locationtype': {'ops': ('all', ), 'timeout': CACHE_REFRESH_DURATION},
- # refresh every 3 hrs
- 'survey.location': {'ops': ('all', ), 'timeout': CACHE_REFRESH_DURATION},
- # refresh every 3 hrs
- 'survey.enumerationarea': {'ops': ('all', ), 'timeout': CACHE_REFRESH_DURATION},
- # refresh every 3 hrs,
- 'survey.batch': {'ops': (), 'timeout': CACHE_REFRESH_DURATION},
- # refresh every 3 hrs,
- 'survey.survey': {'ops': (), 'timeout': CACHE_REFRESH_DURATION},
-}
-
-# DJANGO-WS CONFIG
-WEBSOCKET_URL = '/ws/statusbar'
-WS_HEARTBEAT = 3
-UPDATE_INTERVAL = 3 # INTERVAL BETWEEN UPDATES IN SECS
-# how long downloaded results would cached in secs before discarded
-DOWNLOAD_CACHE_DURATION = 1800
-DOWNLOAD_CACHE_KEY = '/DOWNLOADS/EXPORT/BATCH/%(user_id)s/%(batch_id)s'
-
-SURVEY_REDIS_KEY = "/usurvey/completion_rates/%(survey_id)s"
-
-TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
-
-
-INSTALLED_BACKENDS = {
- # "HTTP": {
- # "ENGINE": "rapidsms.backends.database.DatabaseBackend",
- # },
-}
-
-COUNTRY_CODE = 'UG'
-COUNTRY_PHONE_CODE = '256'
-
-PRODUCTION = False
-
-# cookies settings
-SESSION_EXPIRE_AT_BROWSER_CLOSE = True
-SESSION_COOKIE_AGE = 1800
-SESSION_SAVE_EVERY_REQUEST = True
-
-# email settings
-EMAIL_USE_TLS = True
-EMAIL_HOST = 'smtp.gmail.com'
-EMAIL_PORT = 587
-EMAIL_HOST_USER = ''
-EMAIL_HOST_PASSWORD = ''
-DEFAULT_EMAIL_SENDER = ''
-
-# odk settings
-TOKEN_DEFAULT_SIZE = 5
-ODK_DEFAULT_TOKEN = '12345'
-SUBMISSION_UPLOAD_BASE = os.path.join(BASE_DIR, 'submissions')
-ANSWER_UPLOADS = os.path.join(BASE_DIR, 'answerFiles')
-TEMP_DIR = os.path.join(BASE_DIR, 'tmp')
-ODK_SUBMISSION_SUCCESS_MSG = "Successful submission. Your submission is been Processed"
-INTERVIEWER_EXPORT_HEADERS = [
- 'ea', 'name', 'age', 'level_of_education', 'language', 'mobile_numbers', 'odk_id']
-from collections import OrderedDict
-HOUSEHOLD_EXPORT_HEADERS = OrderedDict([
- ('HOUSE NUMBER', 'house_number'),
- ('PHYSICAL ADDRESS', 'physical_address'),
- ('HEAD MEMBER', 'head_desc'),
- ('SEX', 'head_sex'),
- ('ENUMERATION AREA', 'listing__ea__name'),
- ('REGISTRAR', 'last_registrar__name'),
- ('REGISTRATION_CHANNEL',
- 'registration_channel'),
- ('SURVEY_LISTING',
- 'listing__initial_survey__name')
-])
-AGGREGATORS = [('testAggregator', 'testAggregator'), ]
-DEFAULT_AGGREGATOR = 'testAggregator'
-TWITTER_URL = 'https://twitter.com/unicefuganda'
-TWITTER_TOKEN = '617036281340657664'
-
-###USSD config ##
-USSD_NEXT = '*'
-USSD_PREVIOUS = '#'
-USSD_ITEMS_PER_PAGE = 10
-USSD_RESTART = '##'
-# USSD_STARTER = 'survey.ussd.flows.Start'
-USSD_IGNORED_CHARACTERS = "*!#';&"
-MAX_DISPLAY_PER_PAGE = 50
-DEFAULT_TOTAL_HOUSEHOLDS_IN_EA = 1000
-DATE_FORMAT = "%d-%m-%Y"
-MOBILE_NUM_MIN_LENGTH = 9
-MOBILE_NUM_MAX_LENGTH = 9
-LOOP_QUESTION_REPORT_DEPT = 3 # reports up to 5 question loops
-SHAPE_FILE_URI = '/static/map_resources/uganda_districts_2011_005.json'
-SHAPE_FILE_LOC_FIELD = 'DNAME_2010'
-SHAPE_FILE_LOC_ALT_FIELD = 'DNAME_2006'
-
-RESULT_REFRESH_FREQ = 6
-MEMORIZE_TIMEOUT = 120
-
-RQ_QUEUES = {
- 'default': {
- 'HOST': 'localhost',
- 'PORT': 6379,
- 'DB': 0,
- 'DEFAULT_TIMEOUT': 360,
- },
- 'results-queue': {
- 'HOST': 'localhost',
- 'PORT': 6379,
- 'DB': 0,
- 'DEFAULT_TIMEOUT': 360,
- },
- 'email': {
- 'HOST': 'localhost',
- 'PORT': 6379,
- 'DB': 0,
- },
- 'ws-notice': {
- 'HOST': 'localhost',
- 'PORT': 6379,
- 'DB': 0,
- },
- 'upload_task': {
- 'HOST': 'localhost',
- 'PORT': 6379,
- 'DB': 0,
- },
- 'odk': {
- 'HOST': 'localhost',
- 'PORT': 6379,
- 'DB': 0,
- }
-}
-
-##end USSD config ##
-# Importing server specific settings
-try:
- from localsettings import *
-except ImportError:
- pass
diff --git a/mics/snap-ci/ft.sh b/mics/snap-ci/ft.sh
deleted file mode 100644
index cee0ac50..00000000
--- a/mics/snap-ci/ft.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-source ../mics_env/bin/activate
-cp mics/snap-ci/snap-settings.py mics/localsettings.py
-cp survey/investigator_configs.py.example survey/investigator_configs.py
-./manage.py harvest
diff --git a/mics/snap-ci/setup.sh b/mics/snap-ci/setup.sh
deleted file mode 100644
index 219e6a9d..00000000
--- a/mics/snap-ci/setup.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-wget http://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2
-tar xjf phantomjs-1.9.1-linux-x86_64.tar.bz2
-sudo rm -rf /opt/local/phantomjs
-sudo mv phantomjs-1.9.1-linux-x86_64 /opt/local/phantomjs
-
-sudo yum remove -y libmemcached libmemcached-devel
-sudo wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
-sudo wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
-sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
-sudo yum --enablerepo=remi install -y libmemcached-last libmemcached-last-devel
-sudo yum install -y memcached
-sudo service memcached restart
-
-cd ..
-virtualenv mics_env
-source mics_env/bin/activate
-cd -
-pip install -r pip-requires.txt
-cp mics/snap-ci/snap-settings.py mics/localsettings.py
-cp survey/investigator_configs.py.example survey/investigator_configs.py
-./manage.py syncdb --noinput
-./manage.py migrate
-
diff --git a/mics/snap-ci/snap-settings.py b/mics/snap-ci/snap-settings.py
deleted file mode 100644
index e7362208..00000000
--- a/mics/snap-ci/snap-settings.py
+++ /dev/null
@@ -1,40 +0,0 @@
-DATABASES = {
- "default": {
- "ENGINE": "django.db.backends.postgresql_psycopg2",
- "NAME": "app_test",
- "USER": "go",
- "PASSWORD": "go",
- "HOST": "localhost",
- }
-}
-
-CACHES = {
- 'default': {
- 'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
- 'LOCATION': 'localhost:11211',
- 'TIMEOUT': 3,
- 'BINARY': False,
- 'OPTIONS': { # Maps to pylibmc "behaviors"
- 'tcp_nodelay': True,
- 'ketama': True
- }
- }
-}
-
-INSTALLED_BACKENDS = {
- "HTTP": {
- "ENGINE": "rapidsms.backends.database.DatabaseBackend",
- },
-}
-
-LETTUCE_AVOID_APPS = (
- 'django_nose',
- 'south',
- 'django_extensions',
- 'rapidsms.contrib.locations',
- 'rapidsms.contrib.locations.nested',
- 'bootstrap_pagination',
- 'rapidsms.backends.database',
- 'rapidsms.contrib.httptester',
- 'djcelery',
-)
diff --git a/mics/snap-ci/ut.sh b/mics/snap-ci/ut.sh
deleted file mode 100644
index 1d5e31fa..00000000
--- a/mics/snap-ci/ut.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-source ../mics_env/bin/activate
-cp mics/snap-ci/snap-settings.py mics/localsettings.py
-cp survey/investigator_configs.py.example survey/investigator_configs.py
-./manage.py test
diff --git a/mics/travis-settings.py b/mics/travis-settings.py
deleted file mode 100644
index 8e83de46..00000000
--- a/mics/travis-settings.py
+++ /dev/null
@@ -1,30 +0,0 @@
-DATABASES = {
- "default": {
- "ENGINE": "django.db.backends.postgresql_psycopg2",
- "NAME": "mics_test",
- "USER": "postgres",
- "PASSWORD": "",
- "HOST": "localhost",
- }
-
-}
-
-CACHES = {
- 'default': {
- 'BACKEND': 'redis_cache.RedisCache',
- 'LOCATION': [
- '127.0.0.1:6379',
- ],
- 'OPTIONS': {
- 'DB': 1,
- 'PARSER_CLASS': 'redis.connection.HiredisParser',
- 'CONNECTION_POOL_CLASS': 'redis.BlockingConnectionPool',
- 'CONNECTION_POOL_CLASS_KWARGS': {
- 'max_connections': 50,
- 'timeout': 5000,
- },
- 'MAX_CONNECTIONS': 1000,
- 'PICKLE_VERSION': -1,
- },
- },
-}
diff --git a/mics/urls.py b/mics/urls.py
deleted file mode 100644
index d55dab66..00000000
--- a/mics/urls.py
+++ /dev/null
@@ -1,28 +0,0 @@
-from django.conf.urls import patterns, include, url
-from django.contrib import admin
-from survey.urls import urlpatterns as survey_urls
-from django.conf import settings
-
-admin.autodiscover()
-
-urlpatterns = patterns('',
- (r'^admin/', include(admin.site.urls)),
- (r'^admin/rq/', include('django_rq_dashboard.urls')),
- # Examples:
- # url(r'^$', 'mics.views.home', name='home'),
- # url(r'^mics/', include('mics.foo.urls')),
-
- # Uncomment the admin/doc line below to enable admin documentation:
- # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
-
- # Uncomment the next line to enable the admin:
- # url(r'^admin/', include(admin.site.urls)),
- ) + survey_urls
-
-# Static content serving if not handled by web server
-urlpatterns += patterns('',
- (r'^static/(?P.*)$', 'django.views.static.serve',
- {'document_root': settings.STATIC_ROOT, 'show_indexes': False}),
- (r'^media/(?P.*)$', 'django.views.static.serve',
- {'document_root': settings.MEDIA_ROOT, 'show_indexes': False}),
- )
diff --git a/mics/wsgi.py b/mics/wsgi.py
deleted file mode 100644
index bc6fe919..00000000
--- a/mics/wsgi.py
+++ /dev/null
@@ -1,32 +0,0 @@
-"""
-WSGI config for mics project.
-
-This module contains the WSGI application used by Django's development server
-and any production WSGI deployments. It should expose a module-level variable
-named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
-this application via the ``WSGI_APPLICATION`` setting.
-
-Usually you will have the standard Django WSGI application here, but it also
-might make sense to replace the whole Django WSGI application with a custom one
-that later delegates to the Django one. For example, you could introduce WSGI
-middleware here, or combine a Django application with an application of another
-framework.
-
-"""
-import os
-
-# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
-# if running multiple sites in the same mod_wsgi process. To fix this, use
-# mod_wsgi daemon mode with each site in its own daemon process, or use
-#os.environ["DJANGO_SETTINGS_MODULE"] = "mics.settings"
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mics.settings")
-
-# This application object is used by any WSGI server configured to use this
-# file. This includes Django's development server, if the WSGI_APPLICATION
-# setting points here.
-from django.core.wsgi import get_wsgi_application
-application = get_wsgi_application()
-
-# Apply WSGI middleware here.
-# from helloworld.wsgi import HelloWorldApplication
-# application = HelloWorldApplication(application)
diff --git a/mkdocs.yml b/mkdocs.yml
index 567a9416..a04e7efc 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -1,11 +1,12 @@
site_name: uSurvey
pages:
- Home: index.md
-- User Manual: user_manual.md
-- Offline Data Collection: odk_guide.md
-- USSD Integration: ussd-integration.md
-- Set up Guide: installation.md
+- User Manual: User_Guides.md
+- Data Collection: ODK_App.md
+- Installation Guide: installation.md
+- Installation Guide (Docker): docker_installation.md
- Deployment Guide: deployment_guide.md
-- Tests: tests.md
+- Testing and Coverage: tests.md
+
#theme: readthedocs
-theme: cerulean
+#theme: cerulean
diff --git a/nginx.snippet b/nginx.snippet
deleted file mode 100644
index dd0c6ce7..00000000
--- a/nginx.snippet
+++ /dev/null
@@ -1,33 +0,0 @@
- server {
- server_name example.org;
- listen 443;
-
- ssl on;
- ssl_certificate /etc/ssl/example.org.crt;
- ssl_certificate_key /etc/ssl/examples.org.key;
-
-
- location /ws/ {
- proxy_set_header Host $host;
- proxy_pass http://127.0.0.1:{APP_PORT};
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- }
-
- location /static {
- root {PATH_TO_STATIC_FILES};
- }
-
- location /odk/collect {
- proxy_set_header Host $host;
- proxy_pass http://127.0.0.1:{ODK_SERVER_PORT};
-
- }
-
- location / {
- proxy_set_header Host $host;
- proxy_pass http://127.0.0.1:{APP_PORT};
- }
-
- }
diff --git a/restart_supervisor.sh b/restart_supervisor.sh
deleted file mode 100644
index 6d1a274d..00000000
--- a/restart_supervisor.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-echo 'stoping supervisor...'
-{ # your 'try' block
- kill $(cat supervisord.pid)
-} || { # your 'catch' block
- echo 'looks like supervisor is not running!'
-}
-echo 'starting supervisor...'
-supervisord
diff --git a/snap-settings.py b/snap-settings.py
deleted file mode 100644
index fe7846fe..00000000
--- a/snap-settings.py
+++ /dev/null
@@ -1,22 +0,0 @@
-DATABASES = {
- "default": {
- "ENGINE": "django.db.backends.postgresql_psycopg2",
- "NAME": "app_test",
- "USER": "go",
- "PASSWORD": "go",
- "HOST": "localhost",
- }
-}
-
-CACHES = {
- 'default': {
- 'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
- 'LOCATION': 'localhost:11211',
- 'TIMEOUT': 500,
- 'BINARY': False,
- 'OPTIONS': { # Maps to pylibmc "behaviors"
- 'tcp_nodelay': True,
- 'ketama': True
- }
- }
-}
diff --git a/supervisord.conf b/supervisord.conf
deleted file mode 100644
index fb00e6dc..00000000
--- a/supervisord.conf
+++ /dev/null
@@ -1,44 +0,0 @@
-[inet_http_server]
-port = localhost:9001
-
-[supervisord]
-logfile = supervisord.log
-pidfile = supervisord.pid
-
-[supervisorctl]
-serverurl = http://localhost:9001
-
-[rpcinterface:supervisor]
-supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
-
-[program:odk-server]
-command=gunicorn -b 0.0.0.0:8080 --workers=3 mics.wsgi
-stdout_logfile=./odk-log.log
-stderr_logfile=./odk-log.log
-stderr_events_enabled=true
-
-[program:django-interface-server]
-command=daphne -p 8082 mics.asgi:channel_layer
-stdout_logfile=./django.log
-stderr_logfile=./django.log
-stderr_events_enabled=true
-
-[program:django-channel-worker]
-command=./manage.py runworker
-stdout_logfile=./channel-worker.log
-stderr_logfile=./channel-worker.log
-stderr_events_enabled=true
-
-[program:job-rq]
-command=./manage.py rqworker default email results-queue ws-notice odk
-stdout_logfile=./job-rq.log
-stderr_logfile=./job-rq.log
-stderr_events_enabled=true
-
-
-[program:job-scheduler]
-command=./manage.py rqscheduler ws-notice
-stdout_logfile=./job-scheduler.log
-stderr_logfile=./job-scheduler.log
-stderr_events_enabled=true
-
diff --git a/survey/__init__.py b/survey/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/survey/bootstrap.min.css b/survey/bootstrap.min.css
deleted file mode 100644
index e69de29b..00000000
diff --git a/survey/context_processor.py b/survey/context_processor.py
deleted file mode 100644
index d8424528..00000000
--- a/survey/context_processor.py
+++ /dev/null
@@ -1,19 +0,0 @@
-from django.conf import settings
-from django.core.cache import cache
-# from survey.interviewer_configs import COUNTRY_PHONE_CODE
-
-
-class CachedValue:
-
- def __getattr__(self, key):
- key = key.replace('__', '/')
- return cache.get(key)
-
-
-def context_extras(request):
- generals = {'PROJECT_TITLE': settings.PROJECT_TITLE, 'country_phone_code': settings.COUNTRY_PHONE_CODE,
- 'WEBSOCKET_URL': settings.WEBSOCKET_URL, 'WS_HEARTBEAT': settings.WS_HEARTBEAT,
- 'cached_value': CachedValue()}
- if request.GET:
- generals['q'] = request.GET.get('q', '')
- return generals
diff --git a/survey/features/Batch-steps.py b/survey/features/Batch-steps.py
deleted file mode 100644
index a3cff019..00000000
--- a/survey/features/Batch-steps.py
+++ /dev/null
@@ -1,396 +0,0 @@
-from time import sleep
-from lettuce import *
-from rapidsms.contrib.locations.models import *
-
-from survey.features.page_objects.batches import BatchListPage, AddBatchPage, EditBatchPage, AssignQuestionToBatchPage, BatchShowPage
-from survey.features.page_objects.question import BatchQuestionsListPage
-from survey.features.page_objects.root import HomePage
-from survey.investigator_configs import *
-from survey.models import HouseholdMemberGroup, Survey
-from survey.models.question import Question
-from survey.models.batch import Batch, BatchLocationStatus
-
-
-@step(u'And I have a batch')
-def and_i_have_prime_locations(step):
- world.batch = Batch.objects.create(
- order=1, name="Batch A", description='description', survey=world.survey)
-
-
-@step(u'And I have prime locations')
-def and_i_have_prime_locations(step):
- district = LocationType.objects.create(
- name=PRIME_LOCATION_TYPE, slug=PRIME_LOCATION_TYPE)
- world.districts = (
- Location.objects.create(name="Kampala", type=district),
- Location.objects.create(name="Abim", type=district),
- )
-
-
-@step(u'And I visit batches listing page')
-def and_i_visit_batches_listing_page(step):
- world.page = BatchListPage(world.browser, world.survey)
- world.page.visit()
-
-
-@step(u'And I visit the first batch listed')
-def and_i_visit_the_first_batch_listed(step):
- world.page = world.page.visit_batch(world.batch)
-
-
-@step(u'Then I should see all the prime locations with open close toggles')
-def then_i_should_see_all_the_prime_locations_with_open_close_toggles(step):
- world.page.batch_closed_for_all_locations()
-
-
-@step(u'And I open batch for a location')
-@step(u'When I open batch for a location')
-def when_i_open_batch_for_a_location(step):
- world.page.open_batch_for(world.districts[1])
-
-
-@step(u'Then I should see it is open for that location in db')
-def then_i_should_see_it_is_open_for_that_location_in_db(step):
- assert BatchLocationStatus.objects.filter(
- location=world.districts[1]).count() == 1
- assert BatchLocationStatus.objects.filter(
- location=world.districts[0]).count() == 0
-
-
-@step(u'When I close batch for a location')
-def when_i_close_batch_for_a_location(step):
- world.page.close_batch_for(world.districts[1])
-
-
-@step(u'Then I should see it is closed for that location in db')
-def then_i_should_see_it_is_closed_for_that_location_in_db(step):
- assert BatchLocationStatus.objects.count() == 0
-
-
-@step(u'And I click add batch button')
-def and_i_click_add_batch_button(step):
- world.page.click_add_batch_button()
-
-
-@step(u'Then I should see a add batch page')
-def then_i_should_see_a_add_batch_page(step):
- world.page = AddBatchPage(world.browser, world.survey)
- world.page.validate_url()
- world.page.validate_fields_present(["New Batch", "Name", "Description"])
-
-
-@step(u'When I fill the details for add batch form')
-def when_i_fill_the_details_for_add_batch_form(step):
- data = {'name': 'hritik batch',
- 'description': 'roshan'}
-
- world.page.fill_valid_values(data)
-
-
-@step(u'Then I should go back to batches listing page')
-def then_i_should_go_back_to_batches_listing_page(step):
- world.page = BatchListPage(world.browser, world.survey)
- world.page.validate_url()
-
-
-@step(u'And I should see batch successfully added message')
-def and_i_should_see_batch_successfully_added_message(step):
- world.page.see_success_message('Batch', 'added')
-
-
-@step(u'And I visit add batch page')
-def and_i_visit_add_batch_page(step):
- world.page = AddBatchPage(world.browser, world.survey)
- world.page.visit()
-
-
-@step(u'Then I should see validation error messages')
-def then_i_should_see_validation_error_messages(step):
- world.page.validate_error_message_on_fields()
-
-
-@step(u'And I have 100 batches')
-def and_i_have_100_batches(step):
- for i in xrange(100):
- try:
- Batch.objects.create(order=i, name="Batch %d" % i,
- description='description %d' % i, survey=world.survey)
- except Exception:
- pass
-
-
-@step(u'And I should see the batches list paginated')
-def and_i_should_see_the_batches_list_paginated(step):
- world.page.validate_fields()
- world.page.validate_pagination()
- world.page.validate_fields()
-
-
-@step(u'And I click edit batch link')
-def and_i_click_edit_batch_link(step):
- world.page.click_link_by_text(' Edit')
-
-
-@step(u'Then I should see edit batch page')
-def then_i_should_see_edit_batch_page(step):
- world.page = EditBatchPage(world.browser, world.batch, world.survey)
- world.page.validate_url()
-
-
-@step(u'When I fill the details for the batch')
-def when_i_fill_the_details_for_the_batch(step):
- data = {'name': 'hritik batch',
- 'description': 'roshan'}
-
- world.page.fill_valid_values(data)
-
-
-@step(u'And I should see the batch successfully edited')
-def and_i_should_see_the_batch_successfully_edited(step):
- world.page.see_success_message('Batch', 'edited')
-
-
-@step(u'And I click delete batch link')
-def and_i_click_delete_batch_link(step):
- world.page.click_link_by_text(' Delete')
-
-
-@step(u'Then I should see confirm delete batch')
-def then_i_should_see_confirm_delete_bacth(step):
- world.page.see_confirm_modal_message(world.batch.name)
-
-
-@step(u'And if I click yes')
-def and_if_i_click_yes(step):
- world.page.click_link_by_text('Yes')
-
-
-@step(u'And I should see the batch successfully deleted')
-def and_i_should_see_the_batch_successfully_deleted(step):
- world.page.see_success_message('Batch', 'deleted')
-
-
-@step(u'And I click on batch name')
-def and_i_click_on_batch_name(step):
- world.page.click_link_by_text(world.batch.name)
-
-
-@step(u'Then I should be on the list of questions under the batch page')
-def then_i_should_be_on_the_list_of_questions_under_the_batch_page(step):
- world.page = BatchQuestionsListPage(world.browser, world.batch)
- world.page.validate_url()
-
-
-@step(u'And I click on assign question link')
-def and_i_click_on_assign_question_link(step):
- world.page.click_link_by_text("Select Question")
-
-
-@step(u'Then I should see the assign question page of that batch')
-def then_i_should_see_the_assign_question_page_of_that_batch(step):
- world.page = AssignQuestionToBatchPage(world.browser, world.batch)
- world.page.validate_url()
- world.page.is_text_present(
- "Select Questions for %s - %s" % (world.survey.name.capitalize(), world.batch.name.capitalize()))
-
-
-@step(u'When I select some questions')
-def when_i_select_some_questions(step):
- world.page.select('questions', [world.question_1.pk, world.question_2.pk])
-
-
-@step(u'Then I should see the questions successfully assigned to that batch')
-def then_i_should_see_the_questions_successfully_assigned_to_that_batch(step):
- world.page.see_success_message(
- "Questions", "assigned to batch: %s" % world.batch.name.capitalize())
-
-
-@step(u'And I have 2 questions')
-def and_i_have_2_questions(step):
- world.question_1 = Question.objects.create(
- text="question1", answer_type=Question.NUMBER, order=1)
- world.question_2 = Question.objects.create(
- text="question2", answer_type=Question.TEXT, order=2)
-
-
-@step(u'And I visit the assign question to page batch')
-def and_i_visit_the_assign_question_to_page_batch(step):
- world.page = AssignQuestionToBatchPage(world.browser, world.batch)
- world.page.visit()
-
-
-@step(u'When I select the group')
-def when_i_select_the_group(step):
- world.page.select('group', [world.household_member_group.id])
-
-
-@step(u'Then I should see the question which belong to that group')
-def then_i_should_see_the_question_which_belong_to_that_group(step):
- world.page.see_the_question(True, world.question_1.id)
- world.page.see_the_question(False, world.question_2.id)
-
-
-def create_question_for_group(group):
- return Question.objects.create(text="question-group%s" % group.name, answer_type=Question.NUMBER, group=group)
-
-
-@step(u'And I have one question belonging to that group')
-def and_i_have_one_question_belonging_to_that_group(step):
- world.question_1 = create_question_for_group(world.household_member_group)
-
-
-@step(u'And another question which does not')
-def and_another_question_which_does_not(step):
- world.question_2 = Question.objects.create(
- text="question2", answer_type=Question.TEXT)
-
-
-@step(u'And I click add batch modal button')
-def and_i_click_add_batch_modal_button(step):
- world.page.click_link_by_partial_href("#new_batch")
-
-
-@step(u'Then I should see the add batch modal')
-def then_i_should_see_the_add_batch_modal(step):
- world.page.validate_page_got_survey_id()
- world.page.validate_fields_present(["New Batch", "Name", "Description"])
-
-
-@step(u'And I have 2 member groups')
-def and_i_have_2_member_groups(step):
- world.household_member_group = HouseholdMemberGroup.objects.create(
- name='Age 4-5', order=1)
- world.member_group_2 = HouseholdMemberGroup.objects.create(
- name='Age 15-49', order=2)
-
-
-@step(u'And I have questions belonging to those groups')
-def and_i_have_questions_belonging_to_those_groups(step):
- world.question_1_with_group_1 = create_question_for_group(
- world.household_member_group)
- world.question_2_with_group_1 = create_question_for_group(
- world.household_member_group)
- world.question_1_with_group_2 = create_question_for_group(
- world.member_group_2)
- world.question_2_with_group_2 = create_question_for_group(
- world.member_group_2)
-
-
-@step(u'And I select a question from the list')
-def and_i_select_a_question_from_the_list(step):
- world.page.select_multiple("#id_questions", world.question_1_with_group_2)
-
-
-@step(u'Then I should see in selected list the question which belong to that group')
-def then_i_should_see_in_selected_list_the_question_which_belong_to_that_group(step):
- world.page.see_the_question(True, world.question_1_with_group_1.id)
- world.page.see_the_question(True, world.question_2_with_group_1.id)
- world.page.see_the_question(False, world.question_2_with_group_2.id)
-
-
-@step(u'And I should see the previously selected questions on the page')
-def and_i_should_see_the_previously_selected_questions_on_the_page(step):
- world.page.see_the_selected_question(
- True, world.question_1_with_group_2.id)
-
-
-@step(u'When I fill the same name of the batch')
-def when_i_fill_the_same_name_of_the_batch(step):
- world.page.fill('name', world.batch.name)
- world.page.fill('description', 'some description')
-
-
-@step(u'Then I should see batch name already exists error message')
-def then_i_should_see_batch_name_already_exists_error_message(step):
- world.page.is_text_present("Batch with the same name already exists.")
-
-
-@step(u'And If I have an open batch in another survey in this location')
-def and_if_i_have_an_open_batch_in_another_survey_in_this_location(step):
- world.survey1 = Survey.objects.create(name='another survey', description='another survey descrpition', type=False,
- sample_size=10)
- batch = Batch.objects.create(
- order=1, name="Batch B", description='description', survey=world.survey1)
- batch.open_for_location(world.districts[1])
-
-
-@step(u'Then I should see an error that another batch from another survey is already open')
-def then_i_should_see_an_error_that_another_batch_from_another_survey_is_already_open(step):
- open_batch_error_message = "%s has already open batches from survey %s" % (
- world.districts[1].name, world.survey1.name)
- world.page.is_text_present(open_batch_error_message)
-
-
-@step(u'And I should not be able to open this batch')
-def and_i_should_not_be_able_to_open_this_batch(step):
- world.page.is_disabled("open_close_switch_%s" % world.districts[1].id)
-
-
-@step(u'When I activate non response for batch and location')
-def when_i_activate_non_response_for_batch_and_location(step):
- world.page.activate_non_response_for_batch_and(world.districts[1])
-
-
-@step(u'Then I should see it is activated for that location in db')
-def then_i_should_see_it_is_activated_for_that_location_in_db(step):
- assert world.batch.non_response_is_activated_for(
- world.districts[0]) is True
- assert world.batch.non_response_is_activated_for(
- world.districts[1]) is False
-
-
-@step(u'When I deactivate non response for batch and location')
-def when_i_deactivate_non_response_for_batch_and_location(step):
- world.page.deactivate_non_response_for_batch_and(world.districts[0])
-
-
-@step(u'Then I should see it is deactivated for that location in db')
-def then_i_should_see_it_is_deactivated_for_that_location_in_db(step):
- assert world.batch.non_response_is_activated_for(
- world.districts[0]) is False
- assert world.batch.non_response_is_activated_for(
- world.districts[1]) is False
-
-
-@step(u'Then I should see message batch is closed that location')
-def then_i_should_see_message_batch_is_closed_that_location(step):
- world.page.is_text_present("%s is not open for %s" %
- (world.batch.name, world.districts[1]))
-
-
-@step(u'And I should not be able to activate this batch')
-def and_i_should_not_be_able_to_activate_this_batch(step):
- world.page.is_disabled("open_close_switch_%s" % world.districts[1].id)
-
-
-@step(u'When I open batch for a different location')
-def when_i_open_batch_for_a_different_location(step):
- world.batch.open_for_location(world.districts[0])
-
-
-@step(u'And I activate non response for that location')
-def and_i_activate_non_response_for_that_location(step):
- world.page.activate_non_response_for_batch_and(world.districts[0])
-
-
-@step(u'When I visit the home page')
-def when_i_visit_the_home_page(step):
- world.page = HomePage(world.browser)
- world.page.visit()
-
-
-@step(u'Then I should see that it is still activated')
-def then_i_should_see_that_it_is_still_activated_for_that_location_in_db(step):
- world.page.is_text_present("On")
-
-
-@step(u'When I close the batch of the other survey')
-def when_i_close_the_batch_of_the_other_survey(step):
- world.batch.close_for_location(world.districts[1])
-
-
-@step(u'Then the non-response switch for that location is active')
-def then_the_non_response_switch_for_that_location_is_active(step):
- world.page.is_disabled('activate_non_response_switch_%d' % world.batch.id)
- world.page.is_text_present("%s is not open for %s" % (
- world.batch.name, world.districts[1]), False)
diff --git a/survey/features/Batch.feature b/survey/features/Batch.feature
deleted file mode 100644
index 926e1f85..00000000
--- a/survey/features/Batch.feature
+++ /dev/null
@@ -1,142 +0,0 @@
-Feature: Batch related features
-
- Scenario: Open-Close and activate and deactivate non-response for batch
- Given I am logged in as researcher
- And I have prime locations
- And I have a survey
- And I have a batch
- And I visit batches listing page
- And I visit the first batch listed
- Then I should see all the prime locations with open close toggles
- When I open batch for a location
- Then I should see it is open for that location in db
- When I close batch for a location
- Then I should see it is closed for that location in db
- And If I have an open batch in another survey in this location
- When I open batch for a location
- Then I should see an error that another batch from another survey is already open
- And I should not be able to open this batch
- When I activate non response for batch and location
- Then I should see message batch is closed that location
- When I close the batch of the other survey
- And I open batch for a location
- Then the non-response switch for that location is active
- And I should not be able to activate this batch
- When I open batch for a different location
- And I activate non response for that location
- Then I should see it is activated for that location in db
- When I visit the home page
- And I visit batches listing page
- And I visit the first batch listed
- Then I should see that it is still activated
- When I deactivate non response for batch and location
- Then I should see it is deactivated for that location in db
-
-
- Scenario: Add new Batch
- Given I am logged in as researcher
- And I have a survey
- And I visit add batch page
- When I fill the details for add batch form
- And I submit the form
- Then I should go back to batches listing page
- And I should see batch successfully added message
-
- Scenario: Add new batch- Js validations
- Given I am logged in as researcher
- And I have a survey
- And I visit add batch page
- And I submit the form
- Then I should see validation error messages
-
- Scenario: List Batches
- Given I am logged in as researcher
- And I have a survey
- And I have 100 batches
- And I visit batches listing page
- And I should see the batches list paginated
-
- Scenario: Edit Batch
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I visit batches listing page
- And I click edit batch link
- Then I should see edit batch page
- When I fill the details for the batch
- And I submit the form
- Then I should go back to batches listing page
- And I should see the batch successfully edited
-
- Scenario: Delete Batch
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I visit batches listing page
- And I click delete batch link
- Then I should see confirm delete batch
- And if I click yes
- Then I should go back to batches listing page
- And I should see the batch successfully deleted
-
- Scenario: Batch Details- Listing questions under batch
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I visit batches listing page
- And I click on batch name
- Then I should be on the list of questions under the batch page
-
- Scenario: Assign questions to batch
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I have 2 questions
- And I visit batches listing page
- And I click on batch name
- And I click on assign question link
- Then I should see the assign question page of that batch
- When I select some questions
- And I submit the form
- Then I should see the questions successfully assigned to that batch
-
- Scenario: Assign question filter
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I have a member group
- And I have one question belonging to that group
- And another question which does not
- And I visit the assign question to page batch
- When I select the group
- Then I should see the question which belong to that group
-
- Scenario: Add new Batch modal
- Given I am logged in as researcher
- And I have a survey
- And I visit batches listing page
- And I click add batch modal button
- Then I should see the add batch modal
- When I fill the details for add batch form
- And I click the modal save button
- And I should see batch successfully added message
-
- Scenario: Assign questions from multiple groups to batch
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I have 2 member groups
- And I have questions belonging to those groups
- And I visit the assign question to page batch
- And I select a question from the list
- When I select the group
- Then I should see in selected list the question which belong to that group
- And I should see the previously selected questions on the page
-
- Scenario: remote validation for unique (name,survey) for batch
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I visit add batch page
- When I fill the same name of the batch
- Then I should see batch name already exists error message
diff --git a/survey/features/Layout.feature b/survey/features/Layout.feature
deleted file mode 100644
index bee9ca5e..00000000
--- a/survey/features/Layout.feature
+++ /dev/null
@@ -1,20 +0,0 @@
-Feature: Layout Page feature
- Scenario: Survey Administration Tab
- Given I am logged in as researcher
- And I click Survey Administration tab
- Then I should see survey administration dropdown list
-
- Scenario: Downloads Tab
- Given I am logged in as researcher
- And I click Downloads tab
- Then I should see downloads dropdown list
-
- Scenario: Analysis Tab
- Given I am logged in as researcher
- And I click Analysis tab
- Then I should see analysis dropdown list
-
- Scenario: Settings Tab
- Given I am logged in as admin
- And I click Settings tab
- Then I should see Settings dropdown list
diff --git a/survey/features/Question-steps.py b/survey/features/Question-steps.py
deleted file mode 100644
index 3ee39316..00000000
--- a/survey/features/Question-steps.py
+++ /dev/null
@@ -1,562 +0,0 @@
-from random import randint
-from time import sleep
-from lettuce import *
-from rapidsms.contrib.locations.models import Location
-from survey.features.page_objects.question import BatchQuestionsListPage, AddQuestionPage, ListAllQuestionsPage, CreateNewQuestionPage, CreateNewSubQuestionPage, EditQuestionPage
-from survey.models import Batch, QuestionModule, BatchQuestionOrder
-from survey.models.question import Question, QuestionOption
-from survey.models.householdgroups import HouseholdMemberGroup
-from survey.models.answer_rule import AnswerRule
-
-
-@step(u'And I have 100 questions under the batch')
-def and_i_have_100_questions_under_the_batch(step):
- for i in xrange(100):
- q = Question.objects.create(text="some questions %d" % i,
- answer_type=Question.NUMBER, identifier='ID %d' % i, order=i)
- q.batches.add(world.batch)
- BatchQuestionOrder.objects.create(
- batch=world.batch, question=q, order=i)
-
-
-@step(u'And I visit questions listing page of the batch')
-def and_i_visit_questions_listing_page_of_the_batch(step):
- world.page = BatchQuestionsListPage(world.browser, world.batch)
- world.page.visit()
-
-
-@step(u'Then I should see the questions list paginated')
-def then_i_should_see_the_questions_list_paginated(step):
- world.page.validate_fields()
- world.page.validate_pagination()
- world.page.validate_fields()
-
-
-@step(u'When I change to 100 questions per page')
-def when_i_change_to_100_questions_per_page(step):
- world.page.fill_valid_values({'number_of_questions_per_page': 100})
- world.page.click_by_css('#a-question-list')
-
-
-@step(u'Then I should not see pagination')
-def then_i_should_not_see_pagination(step):
- world.page.validate_pagination(False)
-
-
-@step(u'And I have no questions under the batch')
-def and_i_have_no_questions_under_the_batch(step):
- Question.objects.filter(batches=world.batch).delete()
-
-
-@step(u'Then I should see error message on the page')
-def then_i_should_see_error_message_on_the_page(step):
- world.page.is_text_present(
- "There are no questions associated with this batch yet.")
-
-
-@step(u'And I click add question button')
-def and_i_click_add_question_button(step):
- world.page.click_link_by_text("Select Question")
-
-
-@step(u'Then I should see a add question page')
-def then_i_should_see_a_add_question_page(step):
- world.page = AddQuestionPage(world.browser, world.batch)
- world.page.validate_url()
-
-
-@step(u'When I fill the details for add question form')
-def when_i_fill_the_details_for_add_question_form(step):
- data = {'module': world.module.id,
- 'text': 'hritik question',
- 'answer_type': Question.NUMBER,
- 'identifier': 'ID 1'}
-
- world.page.fill_valid_values(data)
-
-
-@step(u'Then I should go back to questions listing page')
-def then_i_should_go_back_to_questions_listing_page(step):
- world.page = BatchQuestionsListPage(world.browser, world.batch)
- world.page.validate_url()
-
-
-@step(u'And I should see question successfully added message')
-def and_i_should_see_question_successfully_added_message(step):
- world.page.is_text_present("Question successfully added.")
-
-
-@step(u'And I have a member group')
-def and_i_have_a_member_group(step):
- world.household_member_group = HouseholdMemberGroup.objects.create(
- name='Age 4-5', order=1)
-
-
-@step(u'And I visit add new question page of the batch')
-def and_i_visit_add_new_question_page_of_the_batch(step):
- world.page = AddQuestionPage(world.browser, world.batch)
- world.page.visit()
-
-
-@step(u'And I fill the details for question')
-def and_i_fill_the_details_for_question(step):
- world.page.fill_valid_values(
- {'identifier': 'ID 1', 'module': world.module.id, 'text': 'hritik question'})
- world.page.select('group', [world.household_member_group.pk])
-
-
-@step(u'When I select multichoice for answer type')
-def when_i_select_multichoice_for_answer_type(step):
- world.page.select('answer_type', [Question.MULTICHOICE])
-
-
-@step(u'Then I should see one option field')
-def then_i_should_see_one_option_field(step):
- world.page.see_one_option_field("Option 1")
- world.page.see_option_add_and_remove_buttons(1)
-
-
-@step(u'When I click add-option icon')
-def when_i_click_add_option_icon(step):
- world.page.click_by_css(".icon-plus")
-
-
-@step(u'Then I should see two options field')
-def then_i_should_see_two_options_field(step):
- world.page.see_one_option_field("Option 1")
- world.page.see_one_option_field("Option 2")
- world.page.see_option_add_and_remove_buttons(2)
-
-
-@step(u'When I click remove-option icon')
-def when_i_click_remove_option_icon(step):
- world.page.click_by_css(".icon-remove")
-
-
-@step(u'Then I should see only one option field')
-def then_i_should_see_only_one_option_field(step):
- world.page.see_one_option_field("Option 1")
- world.page.see_option_add_and_remove_buttons(1)
- world.page.option_not_present("Option 2")
-
-
-@step(u'And I fill an option question')
-def and_i_fill_an_option_question(step):
- world.option = {'options': 'some option question text'}
- world.page.fill_valid_values(world.option)
-
-
-@step(u'And I have more than 50 questions')
-def and_i_have_100_questions(step):
- for i in xrange(100):
- Question.objects.create(text="some questions %d" % i, answer_type=Question.NUMBER, identifier='ID %d' % i,
- order=i)
-
-
-@step(u'And I visit questions list page')
-def and_i_visit_questions_list_page(step):
- world.page = ListAllQuestionsPage(world.browser)
- world.page.visit()
-
-
-@step(u'And If I click create new question link')
-def and_if_i_click_create_new_question_link(step):
- world.page.click_link_by_text("Create New Question")
-
-
-@step(u'Then I should see create new question page')
-def then_i_should_see_create_new_question_page(step):
- world.page = CreateNewQuestionPage(world.browser)
- world.page.validate_url()
-
-
-@step(u'And I visit create new question page')
-def and_i_visit_create_new_question_page(step):
- world.page = CreateNewQuestionPage(world.browser)
- world.page.visit()
-
-
-@step(u'And I have a multichoice question')
-def and_i_have_a_multichoice_question(step):
- world.multi_choice_question = Question.objects.create(module=world.module, text="Are these insecticide?",
- answer_type=Question.MULTICHOICE, order=6,
- group=world.household_member_group, identifier='ID 1')
- world.option1 = QuestionOption.objects.create(
- question=world.multi_choice_question, text="Yes", order=1)
- world.option2 = QuestionOption.objects.create(
- question=world.multi_choice_question, text="No", order=2)
- world.option3 = QuestionOption.objects.create(
- question=world.multi_choice_question, text="Dont Know", order=3)
-
-
-@step(u'And I click on view options link')
-def and_i_click_on_view_options_link(step):
- world.page.click_link_by_partial_href(
- "#view_options_%d" % world.multi_choice_question.id)
-
-
-@step(u'Then I should see the question options in a modal')
-def then_i_should_see_the_question_options_in_a_modal(step):
- world.page.validate_fields_present(
- [world.multi_choice_question.text, "Text", "Order"])
-
-
-@step(u'And when I click the close button')
-def and_when_i_click_the_close_button(step):
- world.page.click_link_by_text("Close")
-
-
-@step(u'Then I should be back to questions list page')
-def then_i_should_see_questions_list_page(step):
- sleep(2)
- world.page.validate_fields()
-
-
-@step(u'And I click on view add subquestion link')
-def and_i_click_on_view_add_subquestion_link(step):
- world.browser.click_link_by_text("Add Subquestion")
-
-
-@step(u'Then I should go to add subquestion page')
-def then_i_should_go_to_add_subquestion_page(step):
- world.page = CreateNewSubQuestionPage(
- world.browser, question=world.multi_choice_question)
- world.page.validate_url()
-
-
-@step(u'When I fill in subquestion details')
-def when_i_fill_in_subquestion_details(step):
- world.page.fill_valid_values(
- {'module': world.module.id, 'text': 'hritik question', 'identifier': 'Q001'})
- world.page.select('group', [world.household_member_group.pk])
- world.page.select('answer_type', [Question.NUMBER])
-
-
-@step(u'And I should see subquestion successfully added message')
-def and_i_should_see_subquestion_successfully_added_message(step):
- world.page.see_success_message('Sub question', 'added')
-
-
-@step(u'And I fill the invalid details details for question')
-def and_i_fill_the_invalid_details_details_for_question(step):
- a_very_long_text = "Is there something here I'm missing? Is uni_form " \
- "overriding the setting somehow? If not, any advice as " \
- "to what I might look for in debug to see where/why this is happening?"
- world.page.fill_valid_values({'text': a_very_long_text})
-
-
-@step(u'And I should see question was not added')
-def and_i_should_see_question_was_not_added(step):
- world.page.see_message("Question was not added.")
-
-
-@step(u'And I should see that option in the form')
-def and_i_should_see_that_option_in_the_form(step):
- world.page.see_option_text(world.option['options'], 'options')
-
-
-@step(u'And I visit question listing page')
-def and_i_visit_question_listing_page(step):
- world.page = ListAllQuestionsPage(world.browser)
- world.page.visit()
-
-
-@step(u'And I click the edit question link')
-def and_i_click_the_edit_question_link(step):
- world.page.click_link_by_text(" Edit")
-
-
-@step(u'Then I should see the edit question page')
-def then_i_should_see_the_edit_question_page(step):
- world.page = EditQuestionPage(world.browser, world.multi_choice_question)
- world.page.validate_url()
-
-
-@step(u'And I see the question form with values')
-def and_i_see_the_question_form_with_values(step):
- world.form = {'module': 'Module',
- 'text': 'Text',
- 'group': 'Group',
- 'answer_type': 'Answer type'}
-
- form_values = {'module': world.module.id,
- 'text': world.multi_choice_question.text,
- 'group': world.multi_choice_question.group.id,
- 'answer_type': world.multi_choice_question.answer_type}
- world.page.validate_form_present(world.form)
- world.page.validate_form_values(form_values)
-
-
-@step(u'When I fill in edited question details')
-def when_i_fill_in_edited_question_details(step):
- world.edited_question_details = {'module': world.module.id,
- 'text': 'edited question',
- 'group': world.multi_choice_question.group.id
- }
- world.page.see_select_option(['Number'], 'answer_type')
- world.page.fill_valid_values(world.edited_question_details)
-
-
-@step(u'Then I should see the question successfully edited')
-def then_i_should_see_the_question_successfully_edited(step):
- world.page.see_success_message("Question", "edited")
-
-
-@step(u'And I click on delete question link')
-def and_i_click_on_delete_question_link(step):
- world.page.click_link_by_partial_href(
- "#delete_question_%d" % world.multi_choice_question.id)
-
-
-@step(u'Then I should see a delete question confirmation modal')
-def then_i_should_see_a_delete_question_confirmation_modal(step):
- world.page.see_confirm_modal_message(world.multi_choice_question.text)
-
-
-@step(u'Then I should see that the question was deleted successfully')
-def then_i_should_see_that_the_question_was_deleted_successfully(step):
- world.page.see_success_message("Question", "deleted")
-
-
-@step(u'And I have a sub question for that question')
-def and_i_have_a_sub_question_for_that_question(step):
- world.sub_question = Question.objects.create(module=world.module, parent=world.multi_choice_question,
- text="Sub Question 2?",
- answer_type=Question.NUMBER, subquestion=True, identifier='Q101')
-
-
-@step(u'Then I should not see the sub question')
-def then_i_should_not_see_the_sub_question(step):
- world.page.is_text_present(world.sub_question.text, False)
-
-
-@step(u'And I have a non multichoice question')
-def and_i_have_a_non_multi_choice_question(step):
- world.multi_choice_question = Question.objects.create(module=world.module, text="Are these insecticide?",
- answer_type=Question.NUMBER, order=7,
- group=world.household_member_group, identifier='Q921')
- world.multi_choice_question.batches.add(world.batch)
- BatchQuestionOrder.objects.create(
- batch=world.batch, question=world.multi_choice_question, order=1)
-
-
-@step(u'When I click on the question')
-def and_i_click_on_the_question(step):
- world.page.click_link_by_text(world.multi_choice_question.text)
-
-
-@step(u'Then I should see the sub question below the question')
-def then_i_should_see_the_sub_question_below_the_question(step):
- world.page.is_text_present("Subquestion")
- world.page.is_text_present(world.sub_question.text)
-
-
-@step(u'And I have a rule linking one option with that subquestion')
-def and_i_have_a_rule_linking_one_option_with_that_subquestion(step):
- world.answer_rule = AnswerRule.objects.create(question=world.multi_choice_question,
- action=AnswerRule.ACTIONS[
- 'ASK_SUBQUESTION'],
- condition=AnswerRule.CONDITIONS[
- 'EQUALS_OPTION'],
- validate_with_option=world.option3, next_question=world.sub_question)
-
-
-@step(u'And I have a subquestion under that question')
-def and_i_have_a_subquestion_under_that_question(step):
- world.sub_question = Question.objects.create(module=world.module, subquestion=True,
- parent=world.multi_choice_question,
- text="this is a subquestion", identifier='Q022')
-
-
-@step(u'When I fill in duplicate subquestion details')
-def when_i_fill_in_duplicate_subquestion_details(step):
- world.page.fill_valid_values(
- {'module': world.module.id, 'identifier': 'ID 1', 'text': world.sub_question.text})
- world.page.select('group', [world.household_member_group.pk])
- world.page.select('answer_type', [Question.NUMBER])
-
-
-@step(u'And I should see subquestion not added message')
-def and_i_should_see_subquestion_not_added_message(step):
- world.page.is_text_present("Sub question not saved.")
-
-
-@step(u'And I have a rule on value with that subquestion')
-def and_i_have_a_rule_on_value_with_that_subquestion(step):
- world.answer_rule = AnswerRule.objects.create(question=world.multi_choice_question, validate_with_value=1,
- condition=AnswerRule.CONDITIONS[
- 'EQUALS'],
- action=AnswerRule.ACTIONS[
- 'ASK_SUBQUESTION'],
- next_question=world.sub_question, batch=world.batch)
-
-
-@step(u'And I click on view logic link')
-def and_i_click_on_view_logic_link(step):
- world.page.click_link_by_partial_href(
- "#view_logic_%d" % world.multi_choice_question.id)
-
-
-@step(u'Then I should see the logic in a modal')
-def then_i_should_see_the_logic_in_a_modal(step):
- world.page.validate_fields_present(
- [world.multi_choice_question.text, "Eligibility Criteria", "Question/Value/Option", "Action"])
-
-
-@step(u'Then I should see delete logic icon')
-def then_i_should_delete_logic_icon(step):
- world.browser.find_by_css('.icon-trash')
-
-
-@step(u'When I click delete logic icon')
-def when_i_click_delete_logic_icon(step):
- world.page.click_by_css('#delete-icon-%s' % world.answer_rule.id)
-
-
-@step(u'And I click confirm delete')
-def and_i_click_confirm_delete(step):
- world.page.click_by_css('#delete-logic-%s' % world.answer_rule.id)
-
-
-@step(u'Then I should redirected to batch question page')
-def then_i_should_redirected_to_batch_question_page(step):
- world.page = BatchQuestionsListPage(world.browser, world.batch)
- world.page.validate_url()
-
-
-@step(u'Then I should see special characters message')
-def and_i_should_see_special_characters_message(step):
- special_characters = "Please note that the following special characters will be removed ["
- for character in Question.IGNORED_CHARACTERS:
- special_characters = special_characters + character + " "
- special_characters = special_characters.strip() + "]"
- world.page.is_text_present(special_characters)
-
-
-@step(u'And I click delete sub question link')
-def and_i_click_delete_sub_question_link(step):
- sleep(3)
- world.page.click_delete_subquestion()
-
-
-@step(u'Then I should see a confirm delete subqestion modal')
-def then_i_should_see_a_confirm_delete_subqestion_modal(step):
- world.page.see_confirm_modal_message(world.sub_question.text)
-
-
-@step(u'Then I should see the sub question deleted successfully')
-def then_i_should_see_the_sub_question_deleted_successfully(step):
- world.page.see_success_message("Sub question", "deleted")
-
-
-@step(u'When I click confirm delete')
-def when_i_click_confirm_delete(step):
- world.page.click_by_css("#delete-subquestion-%s" % world.sub_question.id)
-
-
-@step(u'And I click edit sub question link')
-def and_i_click_edit_sub_question_link(step):
- sleep(3)
- world.page.click_by_css("#edit_subquestion_%s" % world.sub_question.id)
-
-
-@step(u'Then I see the sub question form with values')
-def then_i_see_the_sub_question_form_with_values(step):
- form_values = {'module': world.module.id, 'text': world.sub_question.text,
- 'group': world.multi_choice_question.group.id,
- 'identifier': "Q101",
- 'answer_type': world.sub_question.answer_type}
- world.page.validate_form_values(form_values)
-
-
-@step(u'When I fill in edited sub question details')
-def when_i_fill_in_edited_sub_question_details(step):
- world.edited_sub_question_details = {'identifier': 'Q101', 'module': world.module.id, 'text': 'edited question',
- 'group': world.multi_choice_question.group.id
- }
- world.page.see_select_option(['Number'], 'answer_type')
- world.page.fill_valid_values(world.edited_sub_question_details)
-
-
-@step(u'Then I should see the sub question successfully edited')
-def then_i_should_see_the_sub_question_successfully_edited(step):
- world.page.see_success_message("Sub question", "edited")
-
-
-@step(u'And I click delete question rule')
-def and_i_click_delete_question_rule(step):
- sleep(2)
- world.page.click_by_css('#delete-icon-%s' % world.answer_rule.id)
-
-
-@step(u'And I should see that the logic was deleted successfully')
-def and_i_should_see_that_the_logic_was_deleted_successfully(step):
- world.page.see_success_message("Logic", "deleted")
-
-
-@step(u'And I select multichoice question in batch')
-def and_i_select_multichoice_question_in_batch(step):
- world.batch = Batch.objects.create(
- order=1, name="Batch A", description='description', survey=world.survey)
- world.multi_choice_question.batches.add(world.batch)
- BatchQuestionOrder.objects.create(
- batch=world.batch, question=world.multi_choice_question, order=1)
-
-
-@step(u'And I have a module')
-def and_i_have_a_module(step):
- world.module = QuestionModule.objects.create(name="Education")
-
-
-@step(u'And I have a location')
-def and_i_have_a_location(step):
- world.kampala = Location.objects.create(name="Kampala")
-
-
-@step(u'And I have an open batch in that location')
-def and_i_have_an_open_batch_in_that_location(step):
- world.batch = Batch.objects.create(
- order=1, name="Batch A", description='description', survey=world.survey)
- world.batch.open_for_location(world.kampala)
-
-
-@step(u'Then I should see question list with only view options action')
-def then_i_should_see_question_list_with_only_view_options_action(step):
- world.page.validate_only_view_options_action_exists()
-
-
-@step(u'And I have a multichoice and numeric questions with logics')
-def and_i_have_a_multichoice_and_numeric_questions(step):
- world.numeric_question = Question.objects.create(text="some questions", answer_type=Question.NUMBER,
- identifier='ID', order=1)
- world.multi_choice_question = Question.objects.create(text="Are these insecticide?",
- answer_type=Question.MULTICHOICE, order=6, identifier='ID 1')
- world.option3 = QuestionOption.objects.create(
- text="haha", order=1, question=world.multi_choice_question)
-
- world.numeric_question.batches.add(world.batch)
- world.multi_choice_question.batches.add(world.batch)
- BatchQuestionOrder.objects.create(
- batch=world.batch, question=world.numeric_question, order=1)
- BatchQuestionOrder.objects.create(
- batch=world.batch, question=world.multi_choice_question, order=2)
-
- AnswerRule.objects.create(batch=world.batch, question=world.multi_choice_question,
- action=AnswerRule.ACTIONS['END_INTERVIEW'],
- condition=AnswerRule.CONDITIONS['EQUALS_OPTION'],
- validate_with_option=world.option3)
-
- AnswerRule.objects.create(batch=world.batch, question=world.numeric_question,
- action=AnswerRule.ACTIONS['END_INTERVIEW'],
- condition=AnswerRule.CONDITIONS['EQUALS_OPTION'],
- validate_with_value=2)
-
-
-@step(u'Then I should see field required error message')
-def then_i_should_see_field_required_error_message(step):
- world.page.is_text_present("This field is required.")
-
-
-@step(u'And I should be able to export questions')
-def and_i_should_be_able_to_export_questions(step):
- world.page.find_by_css("#export_question", "Export Questions")
diff --git a/survey/features/Questions.feature b/survey/features/Questions.feature
deleted file mode 100644
index 9349f9e7..00000000
--- a/survey/features/Questions.feature
+++ /dev/null
@@ -1,210 +0,0 @@
-
-Feature: Question feature
- Scenario: List Questions Under a batch
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I have 100 questions under the batch
- And I visit questions listing page of the batch
- Then I should see the questions list paginated
- When I change to 100 questions per page
- Then I should not see pagination
- And I should be able to export questions
-
-
- Scenario: List Questions Under an open-batch
- Given I am logged in as researcher
- And I have a survey
- And I have a location
- And I have an open batch in that location
- And I have a multichoice and numeric questions with logics
- And I visit questions listing page of the batch
- Then I should see question list with only view options action
- And I should be able to export questions
-
- Scenario: Error Message on no question
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I have no questions under the batch
- And I visit questions listing page of the batch
- Then I should see error message on the page
-
- Scenario: Add new question to batch
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I visit questions listing page of the batch
- And I have a member group
- And I click add question button
- Then I should see the assign question page of that batch
-
- Scenario: MultiChoice question
- Given I am logged in as researcher
- And I have a member group
- And I have a module
- And I visit create new question page
- Then I should see special characters message
- And I fill the details for question
- When I select multichoice for answer type
- Then I should see one option field
- When I click add-option icon
- Then I should see two options field
- When I click remove-option icon
- Then I should see only one option field
- And I fill an option question
- And I submit the form
- And I should see question successfully added message
-
- Scenario: List All Questions
- Given I am logged in as researcher
- And I have more than 50 questions
- And I visit questions list page
- Then I should see the questions list paginated
- And I should be able to export questions
- And If I click create new question link
- Then I should see create new question page
-
-
- Scenario: View multichoice question options
- Given I am logged in as researcher
- And I have a member group
- And I have a survey
- And I have a module
- And I have a multichoice question
- And I select multichoice question in batch
- And I have a sub question for that question
- And I have a rule linking one option with that subquestion
- And I visit questions list page
- And I click on view options link
- Then I should see the question options in a modal
- And when I click the close button
- Then I should be back to questions list page
- And I visit questions listing page of the batch
- And I click on view options link again
- And I click delete question rule
- And I click confirm delete
- Then I should go back to questions listing page
- And I should see that the logic was deleted successfully
-
- Scenario: Add Subquestion
- Given I am logged in as researcher
- And I have a member group
- And I have a module
- And I have a multichoice question
- And I visit questions list page
- And I click on view add subquestion link
- Then I should go to add subquestion page
- And I submit the form
- Then I should see field required error message
- When I fill in subquestion details
- And I submit the form
- And I should see subquestion successfully added message
-
- Scenario: Edit question
- Given I am logged in as researcher
- And I have a member group
- And I have a module
- And I have a multichoice question
- And I visit question listing page
- And I click the edit question link
- Then I should see the edit question page
- And I see the question form with values
- When I fill in edited question details
- And I submit the form
- Then I should see the question successfully edited
-
- Scenario: Delete question
- Given I am logged in as researcher
- And I have a member group
- And I have a module
- And I have a multichoice question
- And I visit questions list page
- And I click on delete question link
- Then I should see a delete question confirmation modal
- When I click yes
- Then I should see that the question was deleted successfully
-
- Scenario: View sub question
- Given I am logged in as researcher
- And I have a member group
- And I have a module
- And I have a multichoice question
- And I have a sub question for that question
- And I visit questions list page
- Then I should not see the sub question
- When I click on the question
- Then I should see the sub question below the question
-
- Scenario: Duplicate sub question
- Given I am logged in as researcher
- And I have a member group
- And I have a module
- And I have a multichoice question
- And I have a subquestion under that question
- And I visit questions list page
- And I click on view add subquestion link
- Then I should go to add subquestion page
- When I fill in duplicate subquestion details
- And I submit the form
- And I should see subquestion not added message
-
- Scenario: View question logic
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I have a member group
- And I have a module
- And I have a non multichoice question
- And I have a sub question for that question
- And I have a rule on value with that subquestion
- And I visit batches question list page
- And I click on view logic link
- Then I should see the logic in a modal
- Then I should see the sub question below the question
- And when I click the close button
- Then I should be back to questions list page
-
- Scenario: Delete question logic
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I have a member group
- And I have a module
- And I have a non multichoice question
- And I have a sub question for that question
- And I have a rule on value with that subquestion
- And I visit batches question list page
- And I click on view logic link
- Then I should see the logic in a modal
- Then I should see delete logic icon
- When I click delete logic icon
- And I click confirm delete
- Then I should redirected to batch question page
-
- Scenario: Delete sub question
- Given I am logged in as researcher
- And I have a member group
- And I have a module
- And I have a multichoice question
- And I have a sub question for that question
- And I visit questions list page
- When I click on the question
- And I click delete sub question link
- Then I should see a confirm delete subqestion modal
- When I click confirm delete
- Then I should see the sub question deleted successfully
-
- Scenario: Edit sub question
- Given I am logged in as researcher
- And I have a member group
- And I have a module
- And I have a multichoice question
- And I have a sub question for that question
- And I visit questions list page
- When I click on the question
- And I click edit sub question link
- Then I see the sub question form with values
- When I fill in edited sub question details
- And I submit the form
- Then I should see the sub question successfully edited
\ No newline at end of file
diff --git a/survey/features/__init__.py b/survey/features/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/survey/features/about_page.feature b/survey/features/about_page.feature
deleted file mode 100644
index 8cdcb204..00000000
--- a/survey/features/about_page.feature
+++ /dev/null
@@ -1,19 +0,0 @@
-Feature: About page
-
- Scenario: Create about us content
- Given I am logged in as admin
- And I have about us content
- And I visit the about us page
- Then I should see the sample about us information
- When I click the edit link
- Then I should see the existing content in a text area
- When I modify about us content
- And I submit the form
- Then I should see the content was updated successfully
-
- Scenario: About us anonymous user
- Given I am an anonymous user
- And I have about us content
- And I visit the about us page
- Then I should see the sample about us information
- And I should not see the edit about us button
\ No newline at end of file
diff --git a/survey/features/about_us_steps.py b/survey/features/about_us_steps.py
deleted file mode 100644
index a26895ae..00000000
--- a/survey/features/about_us_steps.py
+++ /dev/null
@@ -1,47 +0,0 @@
-from lettuce import *
-from survey.features.page_objects.root import AboutPage, EditAboutUsPage
-from survey.models import AboutUs
-
-
-@step(u'And I visit the about us page')
-def and_i_visit_the_about_us_page(step):
- world.page = AboutPage(world.browser)
- world.page.visit()
-
-
-@step(u'And I have about us content')
-def and_i_have_about_us_content(step):
- world.about_us = AboutUs.objects.create(content="blah blah")
-
-
-@step(u'Then I should see the sample about us information')
-def then_i_should_see_the_sample_about_us_information(step):
- world.page.is_text_present(world.about_us.content)
-
-
-@step(u'When I click the edit link')
-def when_i_click_the_edit_link(step):
- world.page.click_by_css("#edit-about_us")
-
-
-@step(u'Then I should see the existing content in a text area')
-def then_i_should_see_the_existing_content_in_a_text_area(step):
- world.page = EditAboutUsPage(world.browser)
- world.form_data = {'content': world.about_us.content}
- world.page.validate_form_values(world.form_data)
-
-
-@step(u'When I modify about us content')
-def when_i_modify_about_us_content(step):
- world.form_data = {'content': "edited more blah blah blah"}
- world.page.fill_wywget_textarea(world.form_data)
-
-
-@step(u'Then I should see the content was updated successfully')
-def then_i_should_see_the_content_was_updated_successfully(step):
- world.page.see_success_message("About us content", "updated")
-
-
-@step(u'And I should not see the edit about us button')
-def and_i_should_not_see_the_edit_about_us_button(step):
- world.page.assert_edit_link_absent()
diff --git a/survey/features/aggregates-steps.py b/survey/features/aggregates-steps.py
deleted file mode 100644
index 66399353..00000000
--- a/survey/features/aggregates-steps.py
+++ /dev/null
@@ -1,353 +0,0 @@
-# -*- coding: utf-8 -*-
-import datetime
-from time import sleep
-from lettuce import *
-from django.utils.datastructures import SortedDict
-from rapidsms.contrib.locations.models import *
-
-from survey.features.page_objects.aggregates import AggregateStatusPage, DownloadExcelPage, InvestigatorReportPage
-from survey.features.page_objects.survey_completion_rates import SurveyCompletionRatesPage
-from survey.models import Survey, EnumerationArea, HouseholdMemberGroup
-from survey.models.batch import Batch
-from survey.models.households import Household, HouseholdMember
-from survey.models.investigator import Investigator
-from survey import investigator_configs
-
-
-@step(u'And I have 2 batches with one open')
-def and_i_have_2_batches_with_one_open(step):
- world.batch_1 = Batch.objects.create(
- order=1, name="Batch A", survey=world.survey_1)
- world.batch_2 = Batch.objects.create(
- order=2, name="Batch B", survey=world.survey_2)
- world.kampala_county = Location.objects.get(name="Kampala County")
- world.someother_county = Location.objects.create(
- name="Some County", tree_parent=world.kampala_county.tree_parent)
- world.batch_1.open_for_location(world.kampala_county.tree_parent)
-
-
-@step(u'And I have eas in the lowest location')
-def and_i_have_eas_in_the_lowest_location(step):
- world.ea = EnumerationArea.objects.create(name="EA", survey=world.survey_1)
- world.ea.locations.add(world.kampala_village)
-
-
-@step(u'And one household has completed that open batch')
-def and_one_household_has_completed_that_open_batch(step):
- world.household_1.completed_batches.get_or_create(batch=world.batch_1)
-
-
-@step(u'And I visit aggregate status page')
-def and_i_visit_aggregate_status_page(step):
- world.page = AggregateStatusPage(world.browser)
- world.page.visit()
-
-
-@step(u'Then I should see an option to select location hierarchically')
-def then_i_should_see_an_option_to_select_location_hierarchically(step):
- world.page.choose_location(
- {'district': 'Kampala', 'county': 'Kampala County'})
-
-
-@step(u'And I should see an option to select batch')
-def and_i_should_see_an_option_to_select_batch(step):
- world.page.check_if_batches_present([world.batch_1])
-
-
-@step(u'And I should see a get status button')
-def and_i_should_see_a_get_status_button(step):
- world.page.check_get_status_button_presence()
-
-
-@step(u'And I have 2 investigators with households')
-def and_i_have_2_investigators_with_households(step):
- investigator = Investigator.objects.create(
- name="Rajini", mobile_number="123", location=world.kampala_county)
- investigator_2 = Investigator.objects.create(
- name="Batman", mobile_number="1234", location=world.someother_county)
- uid_counter = 0
- for index in range(investigator_configs.NUMBER_OF_HOUSEHOLD_PER_INVESTIGATOR):
- Household.objects.create(
- investigator=investigator, uid=uid_counter + index)
- Household.objects.create(
- investigator=investigator_2, uid=uid_counter + 1 + index)
- uid_counter = uid_counter + 2
-
- world.investigator = investigator
- world.investigator_2 = investigator_2
-
-
-@step(u'And I choose a location and an open batch')
-def and_i_choose_a_location_and_an_open_batch(step):
- locations = SortedDict()
- locations['district'] = 'Kampala'
- locations['county'] = 'Kampala County'
- world.page.choose_location(locations)
- world.page.choose_batch(world.batch_1)
-
-
-@step(u'And I change my mind to select all districts')
-def and_i_change_my_mind_to_select_all_districts(step):
- world.page.select_all_district()
-
-
-@step(u'And I click get status button')
-def and_i_click_get_status_button(step):
- world.page.submit()
-
-
-@step(u'And I should see all districts as location selected')
-def and_i_should_see_all_districts_location_selected(step):
- world.page.see_all_districts_location_selected()
-
-
-@step(u'Then I should see number of households and clusters completed and pending')
-def then_i_should_see_number_of_households_and_clusters_completed_and_pending(step):
- world.page.assert_status_count(
- pending_households=20, completed_housesholds=0, pending_clusters=2, completed_clusters=0)
-
-
-@step(u'And I should see a list of investigators with corresponding phone numbers and pending households')
-def and_i_should_see_a_list_of_investigators_with_corresponding_phone_numbers_and_pending_households(step):
- world.page.check_presence_of_investigators(
- world.investigator, world.investigator_2)
-
-
-@step(u'And I choose a location and a closed batch')
-def and_i_choose_a_location_and_a_closed_batch(step):
- world.page.choose_location({'district': 'Kampala'})
- world.page.choose_batch(world.batch_2)
-
-
-@step(u'And I should see a message that says that this batch is currently closed')
-def and_i_should_see_a_message_that_says_that_this_batch_is_currently_closed(step):
- world.page.assert_presence_of_batch_is_closed_message()
-
-
-@step(u'And I visit download excel page')
-def and_i_visit_download_excel_page(step):
- world.page = DownloadExcelPage(world.browser)
- world.page.visit()
-
-
-@step(u'And I visit district aggregate page')
-def and_i_visit_district_aggregate_page(step):
- world.page = SurveyCompletionRatesPage(world.browser)
- world.page.visit()
-
-
-@step(u'Then I should see a table for completion rates')
-def then_i_should_see_a_table_for_completion_rates(step):
- world.page.see_completion_rates_table()
-
-
-@step(u'And I should see descendants in the table')
-def and_i_should_see_descendants_in_the_table(step):
- world.page.is_text_present(world.kampala_subcounty.name)
-
-
-@step(u'When I click on descendant name')
-def when_i_click_on_descendant_name(step):
- world.page.click_link_by_text(world.kampala_subcounty.name)
-
-
-@step(u'Then I should see status page for that location')
-def then_i_should_see_status_page_for_that_location(step):
- world.page.see_completion_rates_table()
- world.page.is_text_present(world.kampala_parish.name)
-
-
-@step(u'And I choose ea and an open batch')
-def and_i_choose_ea_and_an_open_batch(step):
- locations = SortedDict()
- locations['district'] = world.kampala_district.name
- locations['county'] = world.kampala_county.name
- locations['subcounty'] = world.kampala_subcounty.name
- locations['parish'] = world.kampala_parish.name
-
- world.page.choose_location(locations)
- world.page.choose_batch(world.batch_1)
- world.page.choose_ea(world.ea)
-
-
-@step(u'Then I should see a table for household completion rates')
-def then_i_should_see_a_table_for_household_completion_rates(step):
- world.page.see_houdehold_completion_table()
-
-
-@step(u'And I should see household details text')
-def and_i_should_see_household_details_text(step):
- world.page.is_text_present(
- "Survey Completion by household in %s EA" % world.ea.name)
- world.page.is_text_present("%s" % world.household_1.uid)
- world.page.is_text_present(
- "%s" % world.household_1.household_member.all().count())
-
-
-@step(u'And I should see investigator details text')
-def and_i_should_see_investigator_details_text(step):
- world.page.is_text_present('Investigator: %s(%s)' % (
- world.investigator.name, world.investigator.mobile_number))
-
-
-@step(u'And I have an investigator and households')
-def and_i_have_an_investigator_and_households(step):
- world.batch = Batch.objects.create(survey=world.survey_1, name="Haha")
- world.investigator = Investigator.objects.create(
- name="some_investigator", mobile_number="123456784", ea=world.ea)
- world.household_1 = Household.objects.create(
- investigator=world.investigator, uid=101, ea=world.ea, survey=world.survey_1)
- world.household_2 = Household.objects.create(
- investigator=world.investigator, uid=102, ea=world.ea, survey=world.survey_1)
- world.member_2 = HouseholdMember.objects.create(household=world.household_2,
- date_of_birth=datetime.datetime(2000, 02, 02))
-
-
-@step(u'And I should see percent completion')
-def and_i_should_see_percent_completion(step):
- world.page.is_text_present('Percent Completion: 50')
-
-
-@step(u'And I have 2 surveys with one batch each')
-def and_i_have_2_surveys_with_one_batch_each(step):
- world.batch_1 = Batch.objects.create(
- name='batch1', order=1, survey=world.survey_1)
- world.batch_2 = Batch.objects.create(
- name='batch2', order=1, survey=world.survey_2)
-
-
-@step(u'When I select survey 2 from survey list')
-def when_i_select_survey_2_from_survey_list(step):
- world.page.select('survey', [world.survey_2.id])
-
-
-@step(u'Then I should see batch2 in batch list')
-def then_i_should_see_batch2_in_batch_list(step):
- world.page.see_select_option([world.batch_2.name], 'batch')
-
-
-@step(u'And I should not see batch1 in batch list')
-def and_i_should_not_see_batch1_in_batch_list(step):
- world.page.option_not_present([world.batch_1.name], 'batch')
-
-
-@step(u'When I select survey 1 from survey list')
-def when_i_select_survey_1_from_survey_list(step):
- world.page.select('survey', [world.survey_1.id])
-
-
-@step(u'Then I should see batch1 in batch list')
-def then_i_should_see_batch1_in_batch_list(step):
- world.page.see_select_option([world.batch_1.name], 'batch')
-
-
-@step(u'And I should not see batch2 in batch list')
-def and_i_should_not_see_batch2_in_batch_list(step):
- world.page.option_not_present([world.batch_2.name], 'batch')
-
-
-@step(u'And I should see title message')
-def and_i_should_see_title_message(step):
- world.page.is_text_present('Survey Completion by Region/District')
-
-
-@step(u'When I visit investigator report page')
-def when_i_visit_investigator_report_page(step):
- world.page = InvestigatorReportPage(world.browser)
- world.page.visit()
-
-
-@step(u'Then I should see title-text message')
-def then_i_should_see_title_text_message(step):
- world.page.is_text_present(
- 'Choose survey to get investigators who completed the survey')
-
-
-@step(u'And I should see dropdown with two surveys')
-def and_i_should_see_dropdown_with_two_surveys(step):
- world.page.see_select_option(
- [world.survey_1.name, world.survey_2.name], 'survey')
-
-
-@step(u'And I should see generate report button')
-def and_i_should_see_generate_report_button(step):
- assert world.browser.find_by_css(
- "#download-investigator-form")[0].find_by_tag('button')[0].text == "Generate Report"
-
-
-@step(u'And I have 100 locations')
-def and_i_have_100_locations(step):
- country = LocationType.objects.create(name="Country", slug="country")
- district = LocationType.objects.create(name="District", slug="district")
- world.uganda = Location.objects.create(name="uganda", type=country)
-
- for i in xrange(100):
- Location.objects.create(name="name" + str(i),
- tree_parent=world.uganda, type=district)
-
-
-@step(u'Then I should see district completion table paginated')
-def then_i_should_see_district_completion_table_paginated(step):
- world.page.validate_pagination()
-
-
-@step(u'And I have one batch open in those locations')
-def and_i_have_one_batch_open_in_those_locations(step):
- world.batch_12 = Batch.objects.create(
- order=12, name="Batch A", survey=world.survey_1)
- world.batch_12.open_for_location(world.uganda)
-
-
-@step(u'When I select one of the survey')
-def when_i_select_one_of_the_survey(step):
- world.page.see_select_option(
- [world.survey_1.name, world.survey_2.name], 'survey')
-
-
-@step(u'Then I should batches in that survey')
-def then_i_should_batches_in_that_survey(step):
- world.page.validate_select_option(world.batch_1)
-
-
-@step(u'And I click generate report button')
-def and_i_click_generate_report_button(step):
- world.page.find_by_css("#generate_report", "Generate Report")
-
-
-@step(u'And I have three surveys')
-def and_i_have_three_surveys(step):
- world.survey_1 = Survey.objects.create(name="Haha Survey")
- world.survey_2 = Survey.objects.create(name="Hoho Survey")
-
-
-@step(u'And I have batches in those surveys')
-def and_i_have_batches_in_those_surveys(step):
- world.batch_1 = Batch.objects.create(
- order=1, name="Batch A haha", survey=world.survey_1)
- world.batch_2 = Batch.objects.create(
- order=2, name="Batch A hoho", survey=world.survey_2)
-
-
-@step(u'Then I should only see the batches in that survey')
-def then_i_should_only_see_the_batches_in_that_survey(step):
- world.page.see_select_option(['All', str(world.batch_2.name)], 'batch')
-
-
-@step(u'When I choose a batch in that survey')
-def when_i_choose_a_batch_in_that_survey(step):
- world.page.select('batch', [world.batch_2.id])
-
-
-@step(u'Then I should be able to export the responses for that batch')
-def then_i_should_be_able_to_export_the_responses_for_that_batch(step):
- world.page.find_by_css("#export_excel", "Export to spreadsheet")
-
-
-@step(u'When I select one of the two surveys')
-def when_i_select_one_of_the_two_surveys(step):
- world.page.select('survey', [str(world.survey_2.id)])
-
-
-@step(u'And I have general member group')
-def and_i_have_general_member_group(step):
- HouseholdMemberGroup.objects.create(order=1, name="GENERAL")
diff --git a/survey/features/aggregates.feature b/survey/features/aggregates.feature
deleted file mode 100644
index 00e48002..00000000
--- a/survey/features/aggregates.feature
+++ /dev/null
@@ -1,86 +0,0 @@
-Feature: Aggregates feature
-
- Scenario: Download Excel
- Given I am logged in as researcher
- And I have three surveys
- And I have general member group
- And I have batches in those surveys
- And I visit download excel page
- When I select one of the two surveys
- Then I should only see the batches in that survey
- When I choose a batch in that survey
- Then I should be able to export the responses for that batch
-
- Scenario: Region/district completion rates
- Given I am logged in as researcher
- And I have three surveys
- And I have locations
- And I have 2 batches with one open
- And I visit district aggregate page
- Then I should see an option to select location hierarchically
- And I should see an option to select batch
- And I should see a get status button
-
- Scenario: Region/district completion rates -- pagination
- Given I am logged in as researcher
- And I have three surveys
- And I have 100 locations
- And I have one batch open in those locations
- And I visit district aggregate page
- And I click get status button
- Then I should see district completion table paginated
-
- Scenario: Survey completion rates - with filter data
- Given I am logged in as researcher
- And I have three surveys
- And I have locations
- And I have 2 batches with one open
- And I visit district aggregate page
- And I choose a location and an open batch
- And I click get status button
- Then I should see a table for completion rates
- And I should see title message
- And I should see descendants in the table
-
- Scenario: Survey completion for Lowest level location type
- Given I am logged in as researcher
- And I have three surveys
- And I have locations
- And I have eas in the lowest location
- And I have an investigator and households
- And I have 2 batches with one open
- And one household has completed that open batch
- And I visit district aggregate page
- And I choose ea and an open batch
- And I click get status button
- Then I should see a table for household completion rates
- And I should see household details text
- And I should see investigator details text
- And I should see percent completion
-
- Scenario: Survey Completion - Javascript
- Given I am logged in as researcher
- And I have locations
- And I have three surveys
- And I have eas in the lowest location
- And I have an investigator and households
- And I have 2 batches with one open
- And I visit district aggregate page
- When I select survey 2 from survey list
- Then I should see batch2 in batch list
- And I should not see batch1 in batch list
- When I select survey 1 from survey list
- Then I should see batch1 in batch list
- And I should not see batch2 in batch list
-
- Scenario: Download Investigators Report - GET
- Given I am logged in as researcher
- And I have locations
- And I have three surveys
- And I have 2 surveys with one batch each
- When I visit investigator report page
- Then I should see title-text message
- When I select one of the survey
- Then I should batches in that survey
- When I select a batch
- And I click generate report button
\ No newline at end of file
diff --git a/survey/features/bulksms-steps.py b/survey/features/bulksms-steps.py
deleted file mode 100644
index 082460f3..00000000
--- a/survey/features/bulksms-steps.py
+++ /dev/null
@@ -1,74 +0,0 @@
-from lettuce import *
-from rapidsms.contrib.locations.models import *
-
-from survey.features.page_objects.root import BulkSMSPage
-from survey.investigator_configs import *
-from survey.models import Backend, EnumerationArea
-from survey.models.investigator import Investigator
-
-
-@step(u'And I have 2 districts with investigators')
-def and_i_have_2_districts_with_investigators(step):
- district = LocationType.objects.create(
- name=PRIME_LOCATION_TYPE, slug='district')
- world.kampala = Location.objects.create(name="Kampala", type=district)
- world.abim = Location.objects.create(name="Abim", type=district)
- backend = Backend.objects.all()[0]
-
- world.ea = EnumerationArea.objects.create(name="EA")
- world.ea.locations.add(world.kampala)
- world.ea_abim = EnumerationArea.objects.create(name="EA Abim")
- world.ea_abim.locations.add(world.abim)
-
- Investigator.objects.create(
- name="Rajni", mobile_number="123456789", ea=world.ea, backend=backend)
- Investigator.objects.create(
- name="Rajni", mobile_number="123456780", ea=world.ea_abim, backend=backend)
-
-
-@step(u'And I visit bulk SMS page')
-def and_i_visit_bulk_sms_page(step):
- world.page = BulkSMSPage(world.browser)
- world.page.visit()
-
-
-@step(u'And I compose a SMS to send')
-def and_i_compose_a_sms_to_send(step):
- world.page.compose_message("MESSAGE")
-
-
-@step(u'And I select the districts')
-def and_i_select_the_districts(step):
- world.page.select_multiple(
- '#bulk-sms-locations', world.kampala, world.abim)
-
-
-@step(u'And I click send')
-def and_i_click_send(step):
- world.page.submit()
-
-
-@step(u'Then I should see a message saying SMS has been sent')
-def then_i_should_see_a_message_saying_sms_has_been_sent(step):
- world.page.is_message_sent()
-
-
-@step(u'Then I should see error message for location')
-def then_i_should_see_error_message_for_location(step):
- world.page.error_message_for('location')
-
-
-@step(u'Then I should see error message for text')
-def then_i_should_see_error_message_for_text(step):
- world.page.error_message_for('text')
-
-
-@step(u'And I type message the message')
-def and_i_type_message_the_message(step):
- world.text_length = 10
- world.page.enter_text(length=world.text_length)
-
-
-@step(u'Then I should see the counter has changed')
-def then_i_should_see_the_counter_has_changed(step):
- world.page.counter_updated(length=world.text_length)
diff --git a/survey/features/bulksms.feature b/survey/features/bulksms.feature
deleted file mode 100644
index d160cae5..00000000
--- a/survey/features/bulksms.feature
+++ /dev/null
@@ -1,22 +0,0 @@
-Feature: Bulk SMS
-
- Scenario: Sending Bulk SMS to investigators in selected locations
- Given I am logged in as researcher
- And I have 2 districts with investigators
- And I visit bulk SMS page
- And I compose a SMS to send
- And I select the districts
- And I click send
- Then I should see a message saying SMS has been sent
-
- Scenario: Bulk SMS validations
- Given I am logged in as researcher
- And I have 2 districts with investigators
- And I visit bulk SMS page
- And I click send
- Then I should see error message for location
- And I select the districts
- And I click send
- Then I should see error message for text
- And I type message the message
- Then I should see the counter has changed
\ No newline at end of file
diff --git a/survey/features/ea.feature b/survey/features/ea.feature
deleted file mode 100644
index 75bfb399..00000000
--- a/survey/features/ea.feature
+++ /dev/null
@@ -1,17 +0,0 @@
-Feature: EA upload
-
- Scenario: Upload EA
- Given I am logged in as researcher
- And I have some locations to add EA
- And I have a survey
- When I visit upload EA page
- Then I should see EA upload form fields
- When I click on the link for input file format
- Then I should see table of EA layout
- When I click on the link for input file format
- Then said EA layout should collapse
- When I have a EA csv file
- And I input that file
- And I select a survey
- And I click the save button
- Then I should see EA upload is in progress
diff --git a/survey/features/ea_steps.py b/survey/features/ea_steps.py
deleted file mode 100644
index e55bfd7b..00000000
--- a/survey/features/ea_steps.py
+++ /dev/null
@@ -1,94 +0,0 @@
-import csv
-from time import sleep
-from lettuce import step, world
-from rapidsms.contrib.locations.models import Location, LocationType
-from survey.features.page_objects.uploads import UploadEAPage
-from survey.models import LocationTypeDetails
-
-
-@step(u'And I have some locations to add EA')
-def and_i_have_some_locations_to_add_ea(step):
- country = LocationType.objects.create(name='Country', slug='country')
- uganda = Location.objects.create(name="Uganda", type=country)
- LocationTypeDetails.objects.create(country=uganda, location_type=country)
-
- region_type = LocationType.objects.create(
- name="regiontype", slug="regiontype")
- district_type = LocationType.objects.create(
- name="districttype", slug='districttype')
- county_type = LocationType.objects.create(
- name="countytype", slug='countytype')
- parish_type = LocationType.objects.create(
- name="parishtype", slug='parishtype')
-
- region = Location.objects.create(
- name="region1", type=region_type, tree_parent=uganda)
- district = Location.objects.create(
- name="district1", tree_parent=region, type=district_type)
- county_1 = Location.objects.create(
- name="county1", tree_parent=district, type=county_type)
- parish_1 = Location.objects.create(
- name="parish_1", tree_parent=county_1, type=parish_type)
- parish_1_b = Location.objects.create(
- name="parish_1b", tree_parent=county_1, type=parish_type)
-
- region = Location.objects.create(
- name="region2", tree_parent=uganda, type=region_type)
- district = Location.objects.create(
- name="district2", tree_parent=region, type=district_type)
- county_2 = Location.objects.create(
- name="county2", tree_parent=district, type=county_type)
- parish_2 = Location.objects.create(
- name="parish_2", tree_parent=county_2, type=parish_type)
-
-
-@step(u'When I visit upload EA page')
-def when_i_visit_upload_ea_page(step):
- world.page = UploadEAPage(world.browser)
- world.page.visit()
-
-
-@step(u'Then I should see EA upload form fields')
-def then_i_should_see_ea_upload_form_fields(step):
- world.page.validate_fields_present(
- ["Upload Enumeration Areas", "Survey", "EA file"])
-
-
-@step(u'Then I should see table of EA layout')
-def then_i_should_see_table_of_ea_layout(step):
- world.type_names = [
- type.name for type in LocationType.objects.exclude(name__iexact="country")]
- world.page.validate_fields_present(world.type_names)
-
-
-@step(u'When I have a EA csv file')
-def when_i_have_a_ea_csv_file(step):
- filedata = [
- ['Regiontype', 'Districttype', 'Counttype',
- 'EA', 'Parishtype', 'EA'],
- ['region1', 'district1', 'county1',
- 'ea_containing_parish', 'parish_1', ''],
- ['region1', 'district1', 'county1',
- 'ea_containing_parish', 'parish_1b', ''],
- ['region2', 'district2', 'county2', '',
- 'parish2', 'ea_under_parish'],
- ['region2', 'district2', 'county2', '', 'parish2', 'ea_under_parish']]
-
- write_to_csv('wb', filedata, 'test.csv')
-
-
-def write_to_csv(mode, data, csvfilename):
- with open(csvfilename, mode) as fp:
- file = csv.writer(fp, delimiter=',')
- file.writerows(data)
-
-
-@step(u'Then I should see EA upload is in progress')
-def then_i_should_see_ea_upload_is_in_progress(step):
- world.page.is_text_present('Upload in progress. This could take a while.')
-
-
-@step(u'Then said EA layout should collapse')
-def then_said_ea_layout_should_collapse(step):
- sleep(3)
- world.page.validate_layout_collapsed()
diff --git a/survey/features/home_page-step.py b/survey/features/home_page-step.py
deleted file mode 100644
index e984ebba..00000000
--- a/survey/features/home_page-step.py
+++ /dev/null
@@ -1,15 +0,0 @@
-from lettuce import *
-
-from survey.features.page_objects.accounts import LogoutPage
-from survey.features.page_objects.root import AboutPage
-
-
-@step(u'Given I am not logged in')
-def given_i_am_not_logged_in(step):
- world.page = LogoutPage(world.browser)
- world.page.visit()
-
-
-@step(u'Then I should see the completion map')
-def then_i_should_see_under_construction(step):
- world.page.is_text_present("Completion rates:")
diff --git a/survey/features/home_page.feature b/survey/features/home_page.feature
deleted file mode 100644
index ad11c049..00000000
--- a/survey/features/home_page.feature
+++ /dev/null
@@ -1,6 +0,0 @@
-Feature: Homepage feature
-
- Scenario: Home page
- Given I am not logged in
- And I am in the home page
- Then I should see the completion map
\ No newline at end of file
diff --git a/survey/features/household_member-steps.py b/survey/features/household_member-steps.py
deleted file mode 100644
index 6c8ee857..00000000
--- a/survey/features/household_member-steps.py
+++ /dev/null
@@ -1,112 +0,0 @@
-from time import sleep
-from lettuce import *
-from rapidsms.contrib.locations.models import LocationType, Location
-from survey.features.page_objects.household_member import NewHouseholdMemberPage, EditHouseholdMemberPage, DeleteHouseholdMemberPage
-from survey.features.page_objects.households import HouseholdDetailsPage
-from survey.models import EnumerationArea
-from survey.models.households import HouseholdMember, HouseholdHead, Household
-from survey.models.investigator import Investigator
-
-
-@step(u'And I have a household')
-def and_i_have_a_household(step):
- district = LocationType.objects.get(slug='district')
- world.kampala = Location.objects.create(name='Kampala', type=district)
- world.ea = EnumerationArea.objects.create(name="EA")
- world.ea.locations.add(world.kampala_village)
- world.investigator = Investigator.objects.create(
- name="Investigator 1", mobile_number="1", ea=world.ea)
- world.household = Household.objects.create(
- investigator=world.investigator, ea=world.investigator.ea, uid=4)
- HouseholdHead.objects.create(household=world.household, surname="Test", first_name="User",
- date_of_birth="1980-09-01", male=True,
- occupation='Agricultural labor', level_of_education='Primary',
- resident_since_year=2013, resident_since_month=2)
-
-
-@step(u'And I visit new household member page')
-def and_i_visit_new_household_member_page(step):
- world.page = NewHouseholdMemberPage(world.browser, world.household)
- world.page.visit()
-
-
-@step(u'And I see all household member fields are present')
-def and_i_see_all_household_member_fields_are_present(step):
- world.page.validate_fields()
-
-
-@step(u'Then I should see member successfully created message')
-def then_i_should_see_member_successfully_created_message(step):
- world.page.see_success_message('Household member', 'created')
-
-
-@step(u'And I fill all member related fields')
-def and_i_fill_all_member_related_fields(step):
- data = {'surname': 'xyz',
- 'male': True
- }
-
- world.page.fill_valid_member_values(data)
- world.page.select_date("#id_date_of_birth")
- sleep(3)
-
-
-@step(u'And also I have a household member')
-def and_also_i_have_a_household_member(step):
- world.household_member = HouseholdMember.objects.create(surname='member1', date_of_birth='2013-08-30', male=True,
- household=world.household)
-
-
-@step(u'And I visit edit household member page')
-def and_i_visit_edit_household_member_page(step):
- world.page = EditHouseholdMemberPage(
- world.browser, world.household, world.household_member)
- world.page.visit()
-
-
-@step(u'And I see all details of household member are present')
-def and_i_see_all_details_of_household_member_are_present(step):
- world.page.validate_member_details(world.household_member)
-
-
-@step(u'And I edit member related fields')
-def and_i_edit_member_related_fields(step):
- data = {'male': False,
- 'surname': 'member1edited'
- }
- world.page.fill_valid_member_values(data)
- world.page.select_date("#id_date_of_birth")
- sleep(3)
-
-
-@step(u'And I submit the form')
-def and_i_submit_the_form(step):
- world.page.submit()
-
-
-@step(u'Then I should see member successfully edited message')
-def then_i_should_see_member_successfully_edited_message(step):
- world.page.is_text_present('Household member successfully edited.')
-
-
-@step(u'And I visit that household details page')
-def and_i_visit_that_household_details_page(step):
- world.page = HouseholdDetailsPage(world.browser, world.household)
- world.page.visit()
-
-
-@step(u'And I click delete member')
-def and_i_click_delete_member(step):
- world.page.click_delete_link(world.household_member.pk)
-
-
-@step(u'Then I should see a confirmation modal')
-def then_i_should_see_a_confirmation_modal(step):
- world.page = DeleteHouseholdMemberPage(
- world.browser, world.household, world.household_member)
- world.page.see_delete_confirmation_modal()
-
-
-@step(u'Then that member is successfully deleted')
-def then_that_member_is_successfully_deleted(step):
- world.page.see_success_message('Household member', 'deleted')
diff --git a/survey/features/household_member.feature b/survey/features/household_member.feature
deleted file mode 100644
index 20a277c6..00000000
--- a/survey/features/household_member.feature
+++ /dev/null
@@ -1,37 +0,0 @@
-Feature: Household Member feature
-
- Scenario: Household Member new page
- Given I am logged in as researcher
- And I have locations
- And I have an investigator in that location
- And I have a household
- And I visit new household member page
- And I see all household member fields are present
- And I fill all member related fields
- And I submit the form
- Then I should see member successfully created message
-
- Scenario: Household member edit page
- Given I am logged in as researcher
- And I have locations
- And I have an investigator in that location
- And I have a household
- And also I have a household member
- And I visit edit household member page
- And I see all details of household member are present
- And I edit member related fields
- And I submit the form
- Then I should see member successfully edited message
-
- Scenario: Delete Household Member
- Given I am logged in as researcher
- And I have locations
- And I have an investigator in that location
- And I have a household
- And also I have a household member
- And I visit that household details page
- And I click delete member
- Then I should see a confirmation modal
- And if I click yes
- Then that member is successfully deleted
-
diff --git a/survey/features/household_member_groups.feature b/survey/features/household_member_groups.feature
deleted file mode 100644
index 9a6462ab..00000000
--- a/survey/features/household_member_groups.feature
+++ /dev/null
@@ -1,120 +0,0 @@
-Feature: Group features
-
- Scenario: List Conditions Page
- Given I am logged in as researcher
- And I visit conditions listing page
- And I have 10 conditions
- And I should see the conditions list
- When I click the add button
- Then I should see the new condition form
-
- Scenario: List Groups Page
- Given I am logged in as researcher
- And I have a condition
- And I have 100 groups with that condition
- And I visit groups listing page
- Then I should see the groups list paginated
-
- Scenario: Add a group condition
- Given I am logged in as researcher
- And I visit the new condition page
- When I fill in the condition details
- And I click save button
- Then I should see that the condition was saved on the condition list page
-
- Scenario: Add household member a group
- Given I am logged in as researcher
- And I have a condition
- And I visit the new group page
- When I fill in the group details
- And I select a condition
- And I click save button
- Then I should see that the group was saved successfully
-
- Scenario: Create a condition on the group form
- Given I am logged in as researcher
- And I visit the new group page
- When I click the add new condition
- Then I should see the modal open
- When I fill in the condition details
- And I click the new condition form save button
- Then I should see the condition saved on create group page
- And I should see the new condition in the groups form
-
- Scenario: Create a condition with invalid form on the group form
- Given I am logged in as researcher
- And I visit the new group page
- When I click the add new condition
- Then I should see the modal open
- And I click the new condition form save button
- Then I should see the form errors of required fields
-
- Scenario: Create a group with multiple conditions
- Given I am logged in as researcher
- And I have 2 conditions
- And I visit the new group page
- When I fill name and order
- And I select conditions
- And I click save button
- Then I should see that the group was saved successfully
-
- Scenario: List group details
- Given I am logged in as researcher
- And I have member group with conditions
- And I visit groups listing page
- And I click view conditions link
- Then I should see a list of conditions
- When I click on add condition button
- Then I should see a new condition form for this group
- And When I fill condition details
- And I submit the form
- And I should see the newly added condition on that page
-
- Scenario: Add group from group listing page
- Given I am logged in as researcher
- And I visit groups listing page
- When I click the add group button
- Then I should go to add group page
-
- Scenario: JS validation for add group condition
- Given I am logged in as researcher
- And I visit the new condition page
- When I select gender as attribute
- Then I should see only Equals as available for condition
- And male and female for values
- When I select general as attribute
- Then I should see only Equals as available for condition
- And HEAD for values
- When I select age as attribute
- And If I add in a negative number
- And I click the new condition form save button
- Then I see error age cannot be negative
-
- Scenario: Edit a member group
- Given I am logged in as researcher
- And I have member group with conditions
- And I visit groups listing page
- And I click edit group link
- Then I should see the groups details in an edit group form
- When I fill in edited group details
- And I select new conditions
- And I submit the form
- Then I should see that the group was edited successfully
-
- Scenario: Delete a member a group
- Given I am logged in as researcher
- And I have member group with conditions
- And I visit groups listing page
- And I click delete group link
- Then I should see a delete confirmation modal
- When I click yes
- Then I should see that the group was deleted successfully
-
- Scenario: Delete a group condition
- Given I am logged in as researcher
- And I have member group with conditions
- And I visit conditions listing page
- And I click delete condition link
- Then I should see a delete condition confirmation modal
- When I click yes
- Then I should see that the condition was deleted successfully
\ No newline at end of file
diff --git a/survey/features/household_member_groups_steps.py b/survey/features/household_member_groups_steps.py
deleted file mode 100644
index 30a65382..00000000
--- a/survey/features/household_member_groups_steps.py
+++ /dev/null
@@ -1,358 +0,0 @@
-from random import randint
-
-from lettuce import *
-from survey.models.householdgroups import HouseholdMemberGroup, GroupCondition
-
-from survey.features.page_objects.household_member_groups import GroupConditionListPage, GroupsListingPage, AddConditionPage, AddGroupPage, GroupConditionModalPage, GroupDetailsPage, AddNewConditionToGroupPage, DeleteHouseholdMemberGroup
-
-
-@step(u'And I have 10 conditions')
-def and_i_have_10_conditions(step):
- for i in xrange(10):
- try:
- GroupCondition.objects.create(
- value=i, attribute='AGE', condition="EQUALS")
- except Exception:
- pass
-
-
-@step(u'And I visit conditions listing page')
-def and_i_visit_conditions_listing_page(step):
- world.page = GroupConditionListPage(world.browser)
- world.page.visit()
-
-
-@step(u'And I should see the conditions list')
-def and_i_should_see_the_conditions_list(step):
- world.page.validate_fields()
-
-
-@step(u'And I have a condition')
-def and_i_have_a_condition(step):
- world.condition = GroupCondition.objects.create(
- value=5, attribute='AGE', condition="EQUALS")
-
-
-@step(u'And I have 100 groups with that condition')
-def and_i_have_100_groups_with_that_condition(step):
- for i in xrange(100):
- try:
- HouseholdMemberGroup.objects.create(order=i, name="group %d" % i)
- except Exception:
- pass
-
-
-@step(u'And I visit groups listing page')
-def and_i_visit_groups_listing_page(step):
- world.page = GroupsListingPage(world.browser)
- world.page.visit()
-
-
-@step(u'Then I should see the groups list paginated')
-def then_i_should_see_the_groups_list_paginated(step):
- world.page.validate_fields()
- world.page.validate_pagination()
-
-
-@step(u'When I click the add button')
-def when_i_click_the_add_button(step):
- world.page.click_link_by_text(" Add Eligibility Criteria")
-
-
-@step(u'Then I should see the new condition form')
-def then_i_should_see_the_new_condition_form(step):
- world.page.is_text_present("New Criteria")
-
-
-@step(u'And I visit the new condition page')
-def and_i_visit_the_new_condition_page(step):
- world.page = AddConditionPage(world.browser)
- world.page.visit()
-
-
-@step(u'When I fill in the condition details')
-def when_i_fill_in_the_condition_details(step):
- data = {'attribute': 'AGE',
- 'value': '9'}
- world.page.fill_valid_values(data)
- world.page.fill('value', '9')
-
-
-@step(u'And I click save button')
-def and_i_click_save_button(step):
- world.page.submit()
-
-
-@step(u'Then I should see that the condition was saved on the condition list page')
-def then_i_should_see_that_the_condition_was_saved_successfully(step):
- world.page = GroupConditionListPage(world.browser)
- world.page.validate_url()
- world.page.see_success_message('Condition', 'added')
-
-
-@step(u'And I visit the new group page')
-def and_i_visit_the_new_group_page(step):
- world.page = AddGroupPage(world.browser)
- world.page.visit()
-
-
-@step(u'When I fill in the group details')
-def when_i_fill_in_the_group_details(step):
- data = {'name': 'aged between 15 and 49',
- 'order': 1,
- }
- world.page.fill_valid_values(data)
-
-
-@step(u'Then I should see that the group was saved successfully')
-def then_i_should_see_that_the_group_was_saved_successfully(step):
- world.page.see_success_message('Group', 'added')
-
-
-@step(u'When I click the add new condition')
-def when_i_click_the_add_new_condition(step):
- world.page.click_link_by_text("Add Eligibility Criteria ")
-
-
-@step(u'Then I should see the modal open')
-def then_i_should_see_the_modal_open(step):
- world.page = GroupConditionModalPage(world.browser)
- world.page.validate_contents()
-
-
-@step(u'And I click the new condition form save button')
-def and_i_click_the_save_button(step):
- world.page.click_button("save_condition_button")
-
-
-@step(u'Then I should see the condition saved on create group page')
-def then_i_should_see_the_condition_was_saved_successfully(step):
- world.page = AddGroupPage(world.browser)
- world.page.validate_url()
- world.page.see_success_message("Condition", "added")
-
-
-@step(u'And I should see the new condition in the groups form')
-def and_i_should_see_the_new_condition_in_the_groups_form(step):
- latest_condition = GroupCondition.objects.get(
- value='9', attribute="AGE", condition="EQUALS")
- world.page.validate_latest_condition(latest_condition)
-
-
-@step(u'And I have 2 conditions')
-def and_i_have_2_conditions(step):
- world.condition_1 = GroupCondition.objects.create(
- value=False, attribute="GENDER", condition="EQUALS")
- world.condition_2 = GroupCondition.objects.create(
- value=40, attribute="AGE", condition="EQUALS")
-
-
-@step(u'When I fill name and order')
-def when_i_fll_name_and_order(step):
- data = {'name': 'aged between 15 and 49',
- 'order': 1}
- world.page.fill_valid_values(data)
-
-
-@step(u'And I select conditions')
-def and_i_select_conditions(step):
- world.page.select(
- 'conditions', [world.condition_1.pk, world.condition_2.pk])
-
-
-@step(u'Then I should see the form errors of required fields')
-def then_i_should_see_the_form_errors_of_required_fields(step):
- world.page.is_text_present("This field is required.")
-
-
-@step(u'And I have member group with conditions')
-def and_i_have_member_group_with_conditions(step):
- world.condition_1 = GroupCondition.objects.create(
- value='True', attribute="GENDER", condition="EQUALS")
- world.condition_2 = GroupCondition.objects.create(
- value=35, attribute="AGE", condition="EQUALS")
- world.group = HouseholdMemberGroup.objects.create(order=1, name="group 1")
- world.condition_1.groups.add(world.group)
- world.condition_2.groups.add(world.group)
-
-
-@step(u'And I click view conditions link')
-def and_i_click_view_conditions_link(step):
- world.page.click_link_by_text(" Criteria")
-
-
-@step(u'Then I should see a list of conditions')
-def then_i_should_see_a_list_of_conditions(step):
- world.page = GroupDetailsPage(world.browser, world.group)
- world.page.validate_fields()
-
-
-@step(u'When I click Groups tab')
-def when_i_click_groups_tab(step):
- world.page.click_link_by_text("Groups")
-
-
-@step(u'Then I should see group dropdown list')
-def then_i_should_see_group_dropdown_list(step):
- reverse_url_links = ["household_member_groups_page",
- "new_household_member_groups_page"]
- world.page.see_dropdown(reverse_url_links)
-
-
-@step(u'And I select a condition')
-def and_i_select_a_condition(step):
- world.page.select("conditions", [world.condition.pk])
-
-
-@step(u'When I click the add group button')
-def when_i_click_the_add_group_button(step):
- world.page.click_link_by_text(" Add Group")
-
-
-@step(u'Then I should go to add group page')
-def then_i_should_go_to_add_group_page(step):
- world.page = AddGroupPage(world.browser)
- world.page.validate_url()
-
-
-@step(u'When I select gender as attribute')
-def when_i_select_gender_as_attribute(step):
- world.page.select('attribute', ['GENDER'])
-
-
-@step(u'Then I should see only Equals as available for condition')
-def then_i_should_see_only_equals_as_available_for_condition(step):
- world.page.see_select_option(['EQUALS'], 'condition')
-
-
-@step(u'And male and female for values')
-def and_male_and_female_for_values(step):
- world.page.see_select_option(['Male', 'Female'], 'value')
-
-
-@step(u'When I select general as attribute')
-def when_i_select_general_as_attribute(step):
- world.page.select('attribute', ['GENERAL'])
-
-
-@step(u'And HEAD for values')
-def and_head_for_values(step):
- world.page.find_by_css('input[name=value][readonly=readonly]', 'HEAD')
-
-
-@step(u'When I select age as attribute')
-def when_i_select_age_as_attribute(step):
- world.page.select('attribute', ['AGE'])
-
-
-@step(u'And If I add in a negative number')
-def and_if_i_add_in_a_negative_number(step):
- world.page.fill('value', '-8')
-
-
-@step(u'Then I see error age cannot be negative')
-def then_i_should_see_error(step):
- world.page.is_text_present('Age must be a whole non negative number.')
-
-
-@step(u'When I click on add condition button')
-def when_i_click_on_add_condition_button(step):
- world.page.click_link_by_text(" Add Eligibility Criteria")
-
-
-@step(u'Then I should see a new condition form for this group')
-def then_i_should_see_a_new_condition_form(step):
- world.page = AddNewConditionToGroupPage(world.browser, world.group)
- world.page.validate_url()
- world.page.validate_fields_present(['Attribute', 'Condition', 'Value'])
-
-
-@step(u'And When I fill condition details')
-def and_when_i_fill_condition_details(step):
- world.data = {
- 'attribute': 'AGE',
- 'condition': 'EQUALS'
- }
- world.page.fill_valid_values(world.data)
- world.page.fill('value', '9')
-
-
-@step(u'And I should see the newly added condition on that page')
-def and_i_should_see_the_newly_added_condition_on_that_page(step):
- world.page.see_success_message("Criteria", "added")
- world.page.validate_fields_present(
- [world.data['attribute'], world.data['condition'], '9'])
-
-
-@step(u'And I click edit group link')
-def and_i_click_edit_group_link(step):
- world.page.click_link_by_text(" Edit")
-
-
-@step(u'When I fill in edited group details')
-def when_i_fill_in_edited_group_details(step):
- data = {'name': 'aged between 15 and 39',
- 'order': 1,
- }
- world.page.fill_valid_values(data)
-
-
-@step(u'Then I should see that the group was edited successfully')
-def then_i_should_see_that_the_group_was_edited_successfully(step):
- world.page.see_success_message("Group", "edited")
-
-
-@step(u'Then I should see the groups details in an edit group form')
-def then_i_should_see_the_groups_details_in_an_edit_group_form(step):
- form = {'name': 'Name',
- 'order': 'Order'}
- form_values = {'name': world.group.name,
- 'order': world.group.order}
- world.page.validate_form_present(form)
- world.page.validate_form_values(form_values)
-
-
-@step(u'And I select new conditions')
-def and_i_select_new_conditions(step):
- new_condition = GroupCondition.objects.create(
- value=39, attribute='AGE', condition="LESS_THAN")
- world.page.select_multiple(
- '#id_conditions', world.condition_1, new_condition)
-
-
-@step(u'And I click delete group link')
-def and_i_click_delete_group_link(step):
- world.page.click_link_by_text(" Delete")
- world.page = DeleteHouseholdMemberGroup(world.browser, world.group)
-
-
-@step(u'Then I should see a delete confirmation modal')
-def then_i_should_see_a_delete_confirmation_modal(step):
- world.page.see_confirm_modal_message(world.group.name)
-
-
-@step(u'When I click yes')
-def when_i_click_yes(step):
- world.page.click_link_by_text("Yes")
-
-
-@step(u'Then I should see that the group was deleted successfully')
-def then_i_should_see_that_the_group_was_deleted_successfully(step):
- world.page.see_success_message("Group", "deleted")
-
-
-@step(u'And I click delete condition link')
-def and_i_click_delete_condition_link(step):
- world.page.click_link_by_text(" Delete")
-
-
-@step(u'Then I should see a delete condition confirmation modal')
-def then_i_should_see_a_delete_condition_confirmation_modal(step):
- world.page.see_confirm_modal_message(str(world.condition_1))
- world.page.is_text_present("It is attached to the following groups:")
- world.page.find_link_by_text(world.group.name)
-
-
-@step(u'Then I should see that the condition was deleted successfully')
-def then_i_should_see_that_the_condition_was_deleted_successfully(step):
- world.page.see_success_message("Criteria", "deleted")
diff --git a/survey/features/households-steps.py b/survey/features/households-steps.py
deleted file mode 100644
index 2ec04db9..00000000
--- a/survey/features/households-steps.py
+++ /dev/null
@@ -1,288 +0,0 @@
-# -*- coding: utf-8 -*-
-from random import randint
-from datetime import date
-from time import sleep
-
-from lettuce import *
-
-from rapidsms.contrib.locations.models import *
-from django.template.defaultfilters import slugify
-
-from survey.features.page_objects.households import NewHouseholdPage, HouseholdsListPage, HouseholdDetailsPage, EditHouseholdsPage
-from survey.models import EnumerationArea
-from survey.models.households import HouseholdMember, HouseholdHead, Household
-from survey.models.investigator import Investigator
-
-
-def random_text(text):
- return text + str(randint(1, 999))
-
-
-@step(u'And I visit new household page')
-def and_i_visit_new_household_page(step):
- world.page = NewHouseholdPage(world.browser)
- world.page.visit()
-
-
-@step(u'And I fill household data')
-def and_i_fill_household_data(step):
- values = {
- 'surname': random_text('house'),
- 'first_name': random_text('ayoyo'),
- 'date_of_birth': '1980-02-01',
- 'uid': '2'}
- world.page.fill_valid_values(values, world.ea)
-
-
-@step(u'And I see all households fields are present')
-def and_i_see_all_households_fields_are_present(step):
- world.page.valid_page()
-
-
-@step(u'And I have an investigator in that location')
-def and_i_have_an_investigator_in_that_location(step):
- world.investigator = Investigator.objects.create(
- name="Investigator name", ea=world.ea)
-
-
-@step(u'Then I should see that the household is created')
-def then_i_should_see_that_the_household_is_created(step):
- world.household_uid = world.page.get_household_values()['uid']
- world.page.validate_household_created()
-
-
-@step(u'And I click No to has children')
-def and_i_click_no_to_has_children(step):
- world.page.has_children('False')
-
-
-@step(u'Then I should see children number fields disabled')
-def then_i_should_see_children_number_fields_disabled(step):
- world.page.are_children_fields_disabled()
-
-
-@step(u'And No below 5 is also checked')
-def and_no_below_5_is_also_checked(step):
- world.page.is_no_below_5_checked()
-
-
-@step(u'And checking below 5 to yes does not work')
-def and_checking_below_5_to_yes_does_not_work(step):
- world.page.cannot_say_yes_to_below_5()
-
-
-@step(u'And Now If I click to Yes to has children')
-def and_now_if_i_click_to_yes_to_has_children(step):
- world.page.has_children('True')
-
-
-@step(u'Then all children number fields are enabled back')
-def then_all_children_number_fields_are_enabled_back(step):
- world.page.are_children_fields_disabled(is_disabled=False)
-
-
-@step(u'And I click No to has below 5')
-def and_i_click_no_to_has_below_5(step):
- world.page.has_children_below_5('False')
-
-
-@step(u'Then I should see below 5 number fields disabled')
-def then_i_should_see_below_5_number_fields_disabled(step):
- world.page.are_children_below_5_fields_disabled(is_disabled=True)
-
-
-@step(u'And Now If I click Yes to below 5')
-def and_now_if_i_click_yes_to_below_5(step):
- world.page.has_children_below_5('True')
-
-
-@step(u'Then below 5 number fields are enabled back')
-def then_below_5_number_fields_are_enabled_back(step):
- world.page.are_children_below_5_fields_disabled(is_disabled=False)
-
-
-@step(u'And I click No to has women')
-def and_i_click_no_to_has_women(step):
- world.page.has_women('False')
-
-
-@step(u'Then I should see has women number fields disabled')
-def then_i_should_see_has_women_number_fields_disabled(step):
- world.page.are_women_fields_disabled()
-
-
-@step(u'And Now If I click Yes to has women')
-def and_now_if_i_click_yes_to_has_women(step):
- world.page.has_women('True')
-
-
-@step(u'Then has women number fields are enabled back')
-def then_has_women_number_fields_are_enabled_back(step):
- world.page.are_women_fields_disabled(is_disabled=False)
-
-
-@step(u'And I fill in number_of_females lower than sum of 15_19 and 20_49')
-def and_i_fill_in_number_of_females_lower_than_sum_of_15_19_and_20_49(step):
- world.page.fill_in_number_of_females_lower_than_sum_of_15_19_and_20_49()
-
-
-@step(u'Then I should see an error on number_of_females')
-def then_i_should_see_an_error_on_number_of_females(step):
- world.page.see_an_error_on_number_of_females()
-
-
-@step(u'And Now If I choose Other as occupation')
-def and_now_if_i_choose_other_as_occupation(step):
- world.page.choose_occupation('Other: ')
-
-
-@step(u'Then I have to specify one')
-def then_i_have_to_specify_one(step):
- world.page.is_specify_visible(True)
-
-
-@step(u'And If I choose a different occupation')
-def and_if_i_choose_a_different_occupation(step):
- world.page.choose_occupation('Business person')
-
-
-@step(u'Then Specify disappears')
-def then_specify_disappears(step):
- world.page.is_specify_visible(False)
-
-
-@step(u'Given I have an investigator')
-def given_i_have_an_investigator(step):
- country = LocationType.objects.create(
- name="Country", slug=slugify("country"))
- uganda = Location.objects.create(name="Uganda", type=country)
- world.ea = EnumerationArea.objects.create(name="EA")
- world.ea.locations.add(uganda)
-
- world.investigator = Investigator.objects.create(name="Investigator ", mobile_number='987654321', age=20,
- level_of_education="Nursery", language="Luganda", ea=world.ea)
-
-
-@step(u'Given I have 100 households')
-def given_i_have_100_households(step):
- for i in xrange(100):
- random_number = str(randint(1, 99999))
- try:
- HouseholdHead.objects.create(surname="head" + random_number, date_of_birth='1980-06-01', male=False, household=Household.objects.create(
- investigator=world.investigator, location=world.investigator.location, uid=i, ea=world.investigator.ea))
- except Exception:
- pass
-
-
-@step(u'And I visit households listing page')
-def and_i_visit_households_listing_page(step):
- world.page = HouseholdsListPage(world.browser)
- world.page.visit()
-
-
-@step(u'And I should see the households list paginated')
-def and_i_should_see_the_households_list_paginated(step):
- world.page.validate_fields()
- world.page.validate_pagination()
-
-
-@step(u'Given I have no households')
-def given_i_have_no_households(step):
- Household.objects.all().delete()
-
-
-@step(u'And I should see no household message')
-def and_i_should_see_no_household_message(step):
- world.page.no_registered_huseholds()
-
-
-@step(u'And I select list households')
-def and_i_select_list_households(step):
- world.page.click_link_by_text("Households")
- world.page = HouseholdsListPage(world.browser)
-
-
-@step(u'When I click add household button')
-def when_i_click_add_household_button(step):
- world.page = HouseholdsListPage(world.browser)
- world.page.visit()
- world.page.click_by_css("#add-household")
-
-
-@step(u'Then I should see add household page')
-def then_i_should_see_add_household_page(step):
- world.page = NewHouseholdPage(world.browser)
- world.page.validate_url()
-
-
-@step(u'And then I click on that household ID')
-def and_when_i_click_on_that_household_id(step):
- world.page.click_link_by_text(world.household.uid)
-
-
-@step(u'And I should see that household details, its head and members')
-def and_i_should_see_that_household_details_its_head_and_members(step):
- world.page.validate_household_details()
- world.page.validate_household_member_details()
-
-
-@step(u'And I have a member for that household')
-def and_i_have_a_member_for_that_household(step):
- world.household = Household.objects.get(uid=world.household_uid)
- fields_data = dict(surname='xyz', male=True, date_of_birth=date(
- 1980, 05, 01), household=world.household)
- HouseholdMember.objects.create(**fields_data)
-
-
-@step(u'Then I should see household member title and add household member link')
-def then_i_should_see_household_member_title_and_add_household_member_link(step):
- world.page = HouseholdDetailsPage(world.browser, world.household)
- world.page.validate_household_member_title_and_add_household_member_link()
-
-
-@step(u'And I should see actions edit and delete member')
-def and_i_should_see_actions_edit_and_delete_member(step):
- world.page.validate_actions_edit_and_delete_member()
-
-
-@step(u'And I have two other investigators')
-def and_i_have_two_other_investigators(step):
- world.investigator_1 = Investigator.objects.create(
- name="Investigator name", ea=world.ea, mobile_number="123456789")
- world.investigator_2 = Investigator.objects.create(
- name="Investigator name", ea=world.ea, mobile_number="123456782")
-
-
-@step(u'And I click on that household ID')
-def and_i_click_on_that_household_id(step):
- world.page.click_link_by_text(world.household.uid)
-
-
-@step(u'Then I should be on the household details page')
-def then_i_should_be_on_the_household_details_page(step):
- world.page = HouseholdDetailsPage(world.browser, world.household)
- world.page.validate_url()
-
-
-@step(u'When I click edit household')
-def when_i_click_edit_household(step):
- world.browser.find_link_by_text(' Edit Household').first.click()
-
-
-@step(u'Then I should see edit household form')
-def then_i_should_see_edit_household_form(step):
- world.page = EditHouseholdsPage(world.browser, world.household)
- world.related_location = world.household.get_related_location()
- for key in world.related_location.keys()[:-1]:
- world.page.is_text_present(world.related_location[key])
-
-
-@step(u'When I assign a new investigator')
-def when_i_assign_a_new_investigator(step):
- world.page.fill_in_with_js(
- '$("#household-investigator")', world.investigator_1.id)
-
-
-@step(u'Then I should see the investigator was saved successfully')
-def then_i_should_see_the_investigator_was_saved_successfully(step):
- world.page.see_success_message('Household', 'edited')
diff --git a/survey/features/households.feature b/survey/features/households.feature
deleted file mode 100644
index 3837e767..00000000
--- a/survey/features/households.feature
+++ /dev/null
@@ -1,68 +0,0 @@
-Feature: Households feature
-
- Scenario: Household new page
- Given I am logged in as researcher
- And I have locations
- And I visit new household page
- And I see all households fields are present
- And I submit the form
- Then I should see the error messages
-
- Scenario: Create a household
- Given I am logged in as researcher
- And I have locations
- And I have an investigator in that location
- And I visit new household page
- And I fill household data
- And I submit the form
- Then I should see that the household is created
- And I have a member for that household
- And I visit households listing page
- And then I click on that household ID
- Then I should see household member title and add household member link
- And I should see that household details, its head and members
- And I should see actions edit and delete member
-
-
- Scenario: Create a household with other-specify occupation
- Given I am logged in as researcher
- And I have locations
- And I visit new household page
- And Now If I choose Other as occupation
- Then I have to specify one
- And If I choose a different occupation
- Then Specify disappears
-
- Scenario: List all households
- Given I have an investigator
- Given I have 100 households
- Given I am logged in as researcher
- And I have locations
- And I am in the home page
- And I click Survey Administration tab
- And I select list households
- And I should see the households list paginated
- When I click add household button
- Then I should see add household page
-
- Scenario: No households list
- Given I have no households
- Given I am logged in as researcher
- And I have locations
- And I visit households listing page
- And I should see no household message
-
- Scenario: Edit households
- Given I am logged in as researcher
- And I have locations
- And I have an investigator in that location
- And I have a household
- And I have two other investigators
- And I visit households listing page
- And then I click on that household ID
- Then I should be on the household details page
- When I click edit household
- Then I should see edit household form
- When I assign a new investigator
- And I submit the form
- Then I should see the investigator was saved successfully
\ No newline at end of file
diff --git a/survey/features/index-steps.py b/survey/features/index-steps.py
deleted file mode 100644
index 502c455f..00000000
--- a/survey/features/index-steps.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# -*- coding: utf-8 -*-
-import glob
-import os
-
-from lettuce import *
-from splinter import Browser
-from django.core.management import call_command
-from django.conf import settings
-
-from django.template.defaultfilters import slugify
-from survey.models.backend import Backend
-
-
-@before.each_scenario
-def flush_database(step):
- call_command('flush', interactive=False)
- create_backends()
-
-
-@before.all
-def clear_screenshots():
- screenshots = glob.glob('./screenshots/*.png')
- for screenshot in screenshots:
- os.remove(screenshot)
- open_browser()
-
-
-def open_browser():
- world.browser = Browser("phantomjs")
- world.browser.driver.maximize_window()
-
-
-@after.each_scenario
-def take_screenshot(scenario):
- if scenario.failed:
- world.browser.driver.save_screenshot(
- 'screenshots/%s.png' % slugify(scenario.name))
-
-
-@after.each_scenario
-def clear_cookies(scenario):
- world.browser.cookies.delete()
-
-
-@after.all
-def close_browser(total):
- world.browser.quit()
- call_command('flush', interactive=False)
-
-
-def create_backends():
- for backend in settings.INSTALLED_BACKENDS.keys():
- Backend.objects.get_or_create(name=backend)
diff --git a/survey/features/indicators-steps.py b/survey/features/indicators-steps.py
deleted file mode 100644
index b6d2a68d..00000000
--- a/survey/features/indicators-steps.py
+++ /dev/null
@@ -1,196 +0,0 @@
-from time import sleep
-from django.utils.datastructures import SortedDict
-from lettuce import step, world
-from survey.features.page_objects.indicators import NewIndicatorPage, ListIndicatorPage
-from survey.models import QuestionModule, Batch, Indicator
-
-
-@step(u'And I visit new indicator page')
-def and_i_visit_new_indicator_page(step):
- world.page = NewIndicatorPage(world.browser)
- world.page.visit()
-
-
-@step(u'And I fill in the indicator details')
-def and_i_fill_in_the_indicator_details(step):
- form_data = {'module': world.health_module.id,
- 'name': 'Health',
- 'description': 'some description',
- 'measure': '%',
- 'batch': world.batch.id}
- world.page.fill_valid_values(form_data)
-
-
-@step(u'Then I should see that the indicator was successfully added')
-def then_i_should_see_that_the_indicator_was_successfully_added(step):
- world.page.see_success_message("Indicator", "created")
-
-
-@step(u'And I have two indicators')
-def and_i_have_two_indicators(step):
- health_module = QuestionModule.objects.create(name="Health")
- batch = Batch.objects.create(name="Batch")
- world.indicator_1 = Indicator.objects.create(name="indicator name", description="rajni indicator",
- measure='Percentage',
- module=health_module, batch=batch)
- world.indicator_2 = Indicator.objects.create(name="indicator name 2", description="rajni indicator 2",
- measure='Percentage',
- module=health_module, batch=batch)
-
-
-@step(u'When I visit indicator listing page')
-def when_i_visit_indicator_listing_page(step):
- world.page = ListIndicatorPage(world.browser)
- world.page.visit()
-
-
-@step(u'Then I should see all indicators listed')
-def then_i_should_see_indicators_listed(step):
- world.page.see_indicators(
- [world.indicator_1, world.indicator_2, world.indicator_3])
-
-
-@step(u'And I have three batches')
-def and_i_have_three_batches(step):
- world.batch_1 = Batch.objects.create(
- name="New Batch 1", survey=world.survey)
- world.batch_2 = Batch.objects.create(
- name="New Batch 2", survey=world.survey)
- world.batch_3 = Batch.objects.create(name="New Batch 3")
-
-
-@step(u'And I have an indicator not in that survey')
-def and_i_have_an_indicator_not_in_that_survey(step):
- world.indicator_3 = Indicator.objects.create(name="indicator name 3", description="rajni indicator 3",
- measure='Percentage',
- module=world.health_module_1, batch=world.batch_3)
-
-
-@step(u'And I have indicator in each batch')
-def and_i_have_indicator_in_each_batch(step):
- world.indicator_1 = Indicator.objects.create(name="indicator name 1", description="rajni indicator 1",
- measure='Percentage',
- module=world.health_module_1, batch=world.batch_1)
- world.indicator_1b = Indicator.objects.create(name="indicator name with different module",
- description="rajni indicator 1", measure='Percentage',
- module=world.health_module_2, batch=world.batch_1)
- world.indicator_2 = Indicator.objects.create(name="indicator name 2", description="rajni indicator 2",
- measure='Percentage',
- module=world.health_module_2, batch=world.batch_2)
-
-
-@step(u'When I select a survey')
-def when_i_select_a_survey(step):
- world.page.select('survey', [world.survey.id])
-
-
-@step(u'And I should see action buttons')
-def and_i_should_see_action_buttons(step):
- world.page.validate_fields_present(
- ["Delete", "Edit", "Formula", "Analysis"])
-
-
-@step(u'And I click on get list')
-def and_i_click_on_get_list(step):
- world.page.click_by_css('#a-indicator-list')
-
-
-@step(u'Then I should see indicators in that survey')
-def then_i_should_see_indicators_in_that_survey(step):
- world.page.see_indicators(
- [world.indicator_1, world.indicator_1b, world.indicator_2])
- world.page.is_text_present(world.indicator_3.name, False)
-
-
-@step(u'When I select a batch')
-def when_i_select_a_batch(step):
- world.page.select('batch', [world.batch_1.id])
-
-
-@step(u'Then I should see indicators in that batch')
-def then_i_should_see_indicators_in_that_batch(step):
- world.page.see_indicators([world.indicator_1, world.indicator_1b])
- world.page.is_text_present(world.indicator_2.name, False)
- world.page.is_text_present(world.indicator_3.name, False)
-
-
-@step(u'And I have two modules')
-def and_i_have_two_modules(step):
- world.health_module_1 = QuestionModule.objects.create(name="Module")
- world.health_module_2 = QuestionModule.objects.create(name="Module 2")
-
-
-@step(u'When I select a module')
-def when_i_select_a_module(step):
- world.page.select('module', [world.health_module_1.id])
-
-
-@step(u'Then I should see indicators in that module')
-def then_i_should_see_indicators_in_that_module(step):
- world.page.see_indicators([world.indicator_1])
- world.page.is_text_present(world.indicator_1b.name, False)
- world.page.is_text_present(world.indicator_2.name, False)
- world.page.is_text_present(world.indicator_3.name, False)
-
-
-@step(u'When I click on add indicator button')
-def when_i_click_on_add_indicator_button(step):
- world.page.click_by_css('#add_indicator')
-
-
-@step(u'Then I should see add indicator page')
-def then_i_should_see_add_indicator_page(step):
- world.page = NewIndicatorPage(world.browser)
- world.page.validate_url()
-
-
-@step(u'And I click the delete indicator link')
-def and_i_click_the_delete_indicator_link(step):
- world.page.click_by_css("#delete-indicator_%s" % world.indicator_1.id)
-
-
-@step(u'Then I should see confirm indicator batch')
-def then_i_should_see_confirm_indicator_batch(step):
- world.page.see_confirm_modal_message(world.indicator_1.name)
-
-
-@step(u'Then I should go back to indicator listing page')
-def then_i_should_go_back_to_indicator_listing_page(step):
- world.page = ListIndicatorPage(world.browser)
- world.page.validate_url()
-
-
-@step(u'And I should see the indicator successfully deleted')
-def and_i_should_see_the_indicator_successfully_deleted(step):
- world.page.see_success_message("Indicator", "deleted")
-
-
-@step(u'And I click the edit indicator link')
-def and_i_click_the_edit_indicator_link(step):
- world.page.click_by_css("#edit-indicator_%s" % world.indicator_1.id)
-
-
-@step(u'Then I should see the indicator details in the form')
-def then_i_should_see_the_indicator_details_in_the_form(step):
- world.form_data = {'name': world.indicator_1.name,
- 'description': world.indicator_1.description,
- 'measure': '%'}
- world.page.validate_form_values(world.form_data)
- world.page.is_text_present(world.indicator_1.batch.name)
- world.page.is_text_present(world.indicator_1.module.name)
-
-
-@step(u'When I fill in the new values for the indicator')
-def when_i_fill_in_the_new_values_for_the_indicator(step):
- world.form_data = {'survey': world.survey.id,
- 'batch': world.batch_1.id,
- 'module': world.indicator_1.module.id,
- 'name': "Indicator new nme ",
- 'description': "Hoho description",
- 'measure': '%'}
- world.page.fill_valid_values(world.form_data)
-
-
-@step(u'Then I should see the indicator successfully edited')
-def then_i_should_see_the_indicator_successfully_edited(step):
- world.page.see_success_message("Indicator", 'edited')
diff --git a/survey/features/indicators.feature b/survey/features/indicators.feature
deleted file mode 100644
index 98c480f9..00000000
--- a/survey/features/indicators.feature
+++ /dev/null
@@ -1,57 +0,0 @@
-Feature: Indicators feature
-
- Scenario: Add indicators
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I have two question modules
- And I visit new indicator page
- And I visit new indicator page
- And I fill in the indicator details
- And I submit the form
- Then I should see that the indicator was successfully added
-
- Scenario: List indicators
- Given I am logged in as researcher
- And I have a survey
- And I have three batches
- And I have two modules
- And I have an indicator not in that survey
- And I have indicator in each batch
- When I visit indicator listing page
- Then I should see all indicators listed
- And I should see action buttons
- When I select a survey
- And I click on get list
- Then I should see indicators in that survey
- When I select a batch
- And I click on get list
- Then I should see indicators in that batch
- When I select a module
- And I click on get list
- Then I should see indicators in that module
- When I click on add indicator button
- Then I should see add indicator page
-
- Scenario: Delete Indicator
- Given I am logged in as researcher
- And I have two indicators
- When I visit indicator listing page
- And I click the delete indicator link
- Then I should see confirm indicator batch
- And if I click yes
- Then I should go back to indicator listing page
- And I should see the indicator successfully deleted
-
- Scenario: Edit Indicator
- Given I am logged in as researcher
- And I have a survey
- And I have three batches
- And I have two question modules
- And I have two indicators
- When I visit indicator listing page
- And I click the edit indicator link
- Then I should see the indicator details in the form
- When I fill in the new values for the indicator
- And I submit the form
- Then I should see the indicator successfully edited
\ No newline at end of file
diff --git a/survey/features/investigators-steps.py b/survey/features/investigators-steps.py
deleted file mode 100644
index 5c244e42..00000000
--- a/survey/features/investigators-steps.py
+++ /dev/null
@@ -1,323 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-# -*- coding: utf-8 -*-
-from random import randint
-
-from django.template.defaultfilters import slugify
-from django.contrib.auth.models import User, Group, Permission
-from django.contrib.contenttypes.models import ContentType
-from lettuce import *
-from rapidsms.contrib.locations.models import *
-
-from survey.features.page_objects.accounts import LoginPage
-
-from survey.features.page_objects.investigators import NewInvestigatorPage, InvestigatorsListPage, FilteredInvestigatorsListPage, EditInvestigatorPage, InvestigatorDetailsPage
-from survey.models import LocationTypeDetails, EnumerationArea
-from survey.models.investigator import Investigator
-
-
-def set_permissions(group, permissions_codename_list):
- auth_content = ContentType.objects.get_for_model(Permission)
- for codename in permissions_codename_list:
- permission, out = Permission.objects.get_or_create(
- codename=codename, content_type=auth_content)
- group.permissions.add(permission)
-
-
-def create_reseacher():
- researcher = Group.objects.create(name='researcher1')
- user = User.objects.create_user('Rajni', 'rajni@kant.com', 'I_Rock')
- researcher.user_set.add(user)
- set_permissions(researcher, ['can_view_aggregates', 'can_view_households', 'can_view_batches',
- 'can_view_investigators', 'can_view_locations', 'can_view_household_groups'])
-
- return user
-
-
-@step(u'Given I am logged in as researcher')
-def given_i_am_logged_in_as_researcher(step):
- user = create_reseacher()
- world.page = LoginPage(world.browser)
- world.page.visit()
- world.page.login(user)
-
-
-@step(u'And I have locations')
-def and_i_have_locations(step):
- country = LocationType.objects.get_or_create(
- name='Country', slug='country')[0]
- uganda = Location.objects.get_or_create(name="Uganda", type=country)[0]
- LocationTypeDetails.objects.create(country=uganda, location_type=country)
-
- district = LocationType.objects.create(
- name="District", slug=slugify("district"))
- county = LocationType.objects.create(name="County", slug=slugify("county"))
- subcounty = LocationType.objects.create(
- name="Subcounty", slug=slugify("subcounty"))
- parish = LocationType.objects.create(name="Parish", slug=slugify("parish"))
- world.village = LocationType.objects.create(
- name="Village", slug=slugify("village"))
- LocationTypeDetails.objects.create(country=uganda, location_type=district)
- LocationTypeDetails.objects.create(country=uganda, location_type=county)
- LocationTypeDetails.objects.create(country=uganda, location_type=subcounty)
- LocationTypeDetails.objects.create(country=uganda, location_type=parish)
- LocationTypeDetails.objects.create(
- country=uganda, location_type=world.village)
-
- world.kampala_district = Location.objects.create(
- name="Kampala", type=district, tree_parent=uganda)
- world.kampala_county = Location.objects.create(
- name="Kampala County", type=county, tree_parent=world.kampala_district)
- world.kampala_subcounty = Location.objects.create(
- name="Subcounty", type=subcounty, tree_parent=world.kampala_county)
- world.kampala_parish = Location.objects.create(
- name="Parish", type=parish, tree_parent=world.kampala_subcounty)
- world.kampala_village = Location.objects.create(
- name="Village", type=world.village, tree_parent=world.kampala_parish)
- world.kampala_county_village = Location.objects.create(
- name="Kampala County Village", type=world.village, tree_parent=world.kampala_parish)
-
- world.ea = EnumerationArea.objects.create(name="EA")
- world.ea.locations.add(world.kampala_village)
-
-
-@step(u'And I visit new investigator page')
-def and_i_visit_new_investigator_page(step):
- world.page = NewInvestigatorPage(world.browser)
- world.page.visit()
-
-
-@step(u'And I fill all necessary fields')
-def and_i_fill_all_necessary_fields(step):
- values = {
- 'name': 'Investigator Name',
- 'mobile_number': "987654321",
- 'confirm_mobile_number': "987654321",
- 'male': 't',
- 'age': '25',
- 'level_of_education': 'Primary',
- 'language': 'Luo',
- }
- world.page.fill_valid_values(values, world.ea)
-
-
-@step(u'And I submit the form')
-def and_i_submit_the_form(step):
- world.page.submit()
-
-
-@step(u'Then I should see that the investigator is created')
-def then_i_should_see_that_the_investigator_is_created(step):
- index_page = InvestigatorsListPage(world.browser)
- index_page.validate_presence_of_investigator(
- world.page.get_investigator_values())
-
-
-@step(u'Given I have 100 investigators')
-def given_i_have_100_investigators(step):
- uganda = Location.objects.create(name="Uganda")
- for _ in xrange(100):
- random_number = str(randint(1, 99999))
- try:
- Investigator.objects.create(name="Investigator " + random_number, mobile_number=random_number,
- age=12, level_of_education="Nursery", language="Luganda", location=uganda)
- except Exception:
- pass
-
-
-@step(u'And I visit investigators listing page')
-def and_i_visit_investigators_listing_page(step):
- world.page = InvestigatorsListPage(world.browser)
- world.page.visit()
-
-
-@step(u'And I should see the investigators list paginated')
-def and_i_should_see_the_investigators_list_paginated(step):
- world.page.validate_fields()
- world.page.validate_pagination()
- world.page.validate_fields()
-
-
-@step(u'And I fill in already registered mobile number')
-def and_i_fill_in_already_registered_mobile_number(step):
- world.investigator = Investigator.objects.create(
- name="investigator", mobile_number="987654321")
- world.page.fill("mobile_number", world.investigator.mobile_number)
-
-
-@step(u'Then I should see that mobile number is already taken')
-def then_i_should_see_that_mobile_number_is_already_taken(step):
- world.page.is_text_present(
- world.investigator.mobile_number + " is already registered.")
-
-
-@step(u'And I see all the fields are present')
-def and_i_see_all_the_fields_are_present(step):
- world.page.valid_page()
-
-
-@step(u'Then I should see the error messages')
-def then_i_should_see_the_error_messages(step):
- world.page.is_text_present("This field is required.")
-
-
-@step(u'Given I have no investigators')
-def given_i_have_no_investigators(step):
- Investigator.objects.all().delete()
-
-
-@step(u'And I should see no investigators registered message')
-def and_i_should_see_no_investigators_registered_message(step):
- world.page.no_registered_invesitgators()
-
-
-@step(u'And I request filter list of a County with no associated investigator')
-def and_i_request_filter_list_for_another_county_with_no_investigator(step):
- county_type = LocationType.objects.get(name='County')
- new_county = Location.objects.create(
- name="some county", type=county_type, tree_parent=world.kampala_district)
- Investigator.objects.filter(ea__locations=new_county).delete()
- world.page = FilteredInvestigatorsListPage(world.browser, new_county.id)
- world.page.visit()
-
-
-@step(u'Then I should see no investigator for this County')
-def then_i_should_see_no_investigator_for_this_county(step):
- world.page.no_registered_invesitgators()
-
-
-@step(u'And I have one investigator')
-def and_i_have_an_investigator(step):
- country = LocationType.objects.create(
- name="Country", slug=slugify("country"))
- city = LocationType.objects.create(name="City", slug=slugify("city"))
-
- uganda = Location.objects.create(name="Uganda", type=country)
- kampala = Location.objects.create(
- name="Kampala", type=city, tree_parent=uganda)
-
- LocationTypeDetails.objects.create(country=uganda, location_type=country)
- LocationTypeDetails.objects.create(country=uganda, location_type=city)
-
- world.ea = EnumerationArea.objects.get_or_create(name="EA")[0]
- world.ea.locations.add(kampala)
-
- world.investigator = Investigator.objects.create(
- name="Rajni", mobile_number="123456789", age=25, level_of_education="Nursery", language="Luganda", ea=world.ea)
-
-
-@step(u'And I visit investigators page')
-def and_i_visit_investigators_page(step):
- world.page = InvestigatorsListPage(world.browser)
- world.page.visit()
-
-
-@step(u'And I click on the investigators name')
-def and_i_click_on_the_investigators_name(step):
- world.page.visit_investigator(world.investigator)
-
-
-@step(u'Then I should see his details displayed')
-def then_i_should_see_his_details_displayed(step):
- world.page = InvestigatorDetailsPage(world.browser, world.investigator)
- world.page.validate_page_content()
-
-
-@step(u'And I should see navigation links')
-def and_i_should_see_navigation_links(step):
- world.page.validate_navigation_links()
-
-
-@step(u'Then back button should take back to Investigator Listing page')
-def then_back_button_should_take_back_to_investigator_listing_page(step):
- world.page.validate_back_link()
-
-
-@step(u'And I click on the edit button')
-def and_i_click_on_the_edit_button(step):
- world.page.click_link_by_text(" Edit")
-
-
-@step(u'Then it should be able to take me to edit form page')
-def then_it_should_be_able_to_take_me_to_edit_form_page(step):
- world.page = EditInvestigatorPage(world.browser, world.investigator)
- world.page.validate_edit_investigator_url()
- world.page.visit()
-
-
-@step(u'And I change Name of investigator')
-def and_i_change_name_of_investigator(step):
- world.page.change_name_of_investigator()
-
-
-@step(u'And I click on save')
-def and_i_click_on_save(step):
- world.page.submit()
-
-
-@step(u'Then I should go back to investigator listing page')
-def then_i_should_go_back_to_investigator_listing_page(step):
- world.page = InvestigatorsListPage(world.browser)
- world.page.validate_page_url()
-
-
-@step(u'And I should see name of investigator updated')
-def and_i_should_see_name_of_investigator_updated(step):
- world.page.validate_successful_edited_message()
-
-
-@step(u'And I click block the investigator')
-def and_i_click_block_the_investigator(step):
- world.page.click_link_by_text(" Block")
-
-
-@step(u'Then I should see block investigator confirmation modal')
-def then_i_should_see_block_investigator_confirmation_modal(step):
- world.page.see_confirm_block_message("block", world.investigator)
-
-
-@step(u'When I confirm block the investigator')
-def when_i_confirm_block_the_investigator(step):
- world.page.click_by_css("#block-investigator-%s" % world.investigator.id)
-
-
-@step(u'Then I should see the investigator blocked successfully')
-def then_i_should_see_the_investigator_blocked_successfully(step):
- world.page.see_success_message("Investigator", "blocked")
-
-
-@step(u'And I should see unblock investigator')
-def and_i_should_see_unblock_investigator(step):
- world.page.is_text_present(" Unblock")
-
-
-@step(u'And I click unblock the investigator')
-def and_i_click_unblock_the_investigator(step):
- world.page.click_link_by_text(" Unblock")
-
-
-@step(u'Then I should see unblock investigator confirmation modal')
-def then_i_should_see_unblock_investigator_confirmation_modal(step):
- world.page.see_confirm_block_message("unblock", world.investigator)
-
-
-@step(u'When I confirm unblock the investigator')
-def when_i_confirm_unblock_the_investigator(step):
- world.page.click_by_css("#unblock-investigator-%s" % world.investigator.id)
-
-
-@step(u'Then I should see the investigator unblocked successfully')
-def then_i_should_see_the_investigator_unblocked_successfully(step):
- world.page.see_success_message("Investigator", "unblocked")
-
-
-@step(u'When I click add investigator button')
-def when_i_click_add_household_button(step):
- world.page.click_by_css("#add-investigator")
-
-
-@step(u'Then I should see add investigator page')
-def then_i_should_see_add_household_page(step):
- world.page = NewInvestigatorPage(world.browser)
- world.page.validate_url()
diff --git a/survey/features/investigators.feature b/survey/features/investigators.feature
deleted file mode 100644
index 3afa5780..00000000
--- a/survey/features/investigators.feature
+++ /dev/null
@@ -1,82 +0,0 @@
-Feature: Investigators feature
-
- Scenario: Investigator new page
- Given I am logged in as researcher
- And I have locations
- And I visit new investigator page
- And I see all the fields are present
- And I submit the form
- Then I should see the error messages
-
- Scenario: Create an investigator
- Given I am logged in as researcher
- And I have locations
- And I visit new investigator page
- And I fill all necessary fields
- And I submit the form
- Then I should see that the investigator is created
-
- Scenario: List investigators
- Given I have 100 investigators
- Given I am logged in as researcher
- And I have locations
- And I visit investigators listing page
- And I should see the investigators list paginated
- When I click add investigator button
- Then I should see add investigator page
-
-
- Scenario: No investigators list
- Given I have no investigators
- Given I am logged in as researcher
- And I have locations
- And I visit investigators listing page
- And I should see no investigators registered message
-
- Scenario: No investigators filter list
- Given I am logged in as researcher
- And I have locations
- And I request filter list of a County with no associated investigator
- Then I should see no investigator for this County
-
- Scenario: Create an investigator - validation
- Given I am logged in as researcher
- And I have locations
- And I visit new investigator page
- And I fill in already registered mobile number
- And I submit the form
- Then I should see that mobile number is already taken
-
- Scenario: View investigator details
- Given I am logged in as researcher
- And I have one investigator
- And I visit investigators page
- And I click on the investigators name
- Then I should see his details displayed
- And I should see navigation links
- Then back button should take back to Investigator Listing page
-
- Scenario: Edit investigator details
- Given I am logged in as researcher
- And I have one investigator
- And I visit investigators page
- And I click on the edit button
- Then it should be able to take me to edit form page
- And I change Name of investigator
- And I click on save
- Then I should go back to investigator listing page
- And I should see name of investigator updated
-
- Scenario: Block investigators
- Given I am logged in as researcher
- And I have one investigator
- And I visit investigators listing page
- And I click block the investigator
- Then I should see block investigator confirmation modal
- When I confirm block the investigator
- Then I should see the investigator blocked successfully
- And I should see unblock investigator
- And I click unblock the investigator
- Then I should see unblock investigator confirmation modal
- When I confirm unblock the investigator
- Then I should see the investigator unblocked successfully
\ No newline at end of file
diff --git a/survey/features/layout-steps.py b/survey/features/layout-steps.py
deleted file mode 100644
index 7cae3d5e..00000000
--- a/survey/features/layout-steps.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
-from lettuce import step, world
-
-
-@step(u'And I click Survey Administration tab')
-def and_i_click_survey_administration_tab(step):
- world.page.click_tab("Survey Administration")
-
-
-@step(u'Then I should see survey administration dropdown list')
-def then_i_should_see_survey_administration_dropdown_list(step):
- reverse_url_links = ["investigators_page", "list_household_page", "list_all_questions", "survey_list_page",
- "question_module_listing_page", "household_member_groups_page", "bulk_sms", "upload_ea"]
- world.page.see_dropdown(reverse_url_links)
-
-
-@step(u'And I click Downloads Tab')
-def and_i_click_downloads_tab(step):
- world.page.click_tab("Downloads")
-
-
-@step(u'Then I should see Downloads dropdown list')
-def then_i_should_see_downloads_dropdown_list(step):
- reverse_url_links = ['download_excel', 'investigator_report_page']
- world.page.see_dropdown(reverse_url_links)
-
-
-@step(u'And I click Analysis tab')
-def and_i_click_analysis_tab(step):
- world.page.click_tab("Analysis")
-
-
-@step(u'Then I should see analysis dropdown list')
-def then_i_should_see_analysis_dropdown_list(step):
- reverse_url_links = ["simulator_page", "list_indicator_page",
- "survey_completion_rates", "list_weights_page"]
- world.page.see_dropdown(reverse_url_links)
-
-
-@step(u'And I click Settings tab')
-def and_i_click_settings_tab(step):
- world.page.click_tab("Settings")
-
-
-@step(u'Then I should see Settings dropdown list')
-def then_i_should_see_settings_dropdown_list(step):
- reverse_url_links = ["add_location_hierarchy",
- "upload_locations", "users_index"]
- world.page.see_dropdown(reverse_url_links)
diff --git a/survey/features/location_hierarchy.feature b/survey/features/location_hierarchy.feature
deleted file mode 100644
index 2d33bcb1..00000000
--- a/survey/features/location_hierarchy.feature
+++ /dev/null
@@ -1,21 +0,0 @@
-Feature: Location hierarchy
-
- Scenario: Add location hierarchy
- Given I am logged in as admin
- And I have a country
- And I visit add location hierarchy page
- Then I should see text message
- And I should see country dropdown
- And I should see country present in dropdown
- And I should see a row for level details field
- When I click add row icon
- Then I should see anther row for levels details field
- When I click remove row icon
- Then I should see row for levels details field removed
- And the code field is hidden
- When I check has_code field
- Then length of code field is shown
- When I fill details
- And I click the create hierarchy button
- Then I should see location hierarchy successfully created
-
diff --git a/survey/features/location_hierarchy_steps.py b/survey/features/location_hierarchy_steps.py
deleted file mode 100644
index 16f1ccad..00000000
--- a/survey/features/location_hierarchy_steps.py
+++ /dev/null
@@ -1,92 +0,0 @@
-from lettuce import step, world
-from rapidsms.contrib.locations.models import Location, LocationType
-from survey.features.page_objects.location_hierarchy import AddLocationHierarchyPage
-
-
-@step(u'And I have a country')
-def and_i_have_a_country(step):
- world.country = Location.objects.create(
- name='SomeCountry', type=LocationType.objects.create(name='country', slug='country'))
-
-
-@step(u'And I visit add location hierarchy page')
-def and_i_visit_add_location_hierarchy_page(step):
- world.page = AddLocationHierarchyPage(world.browser)
- world.page.visit()
-
-
-@step(u'Then I should see text message')
-def then_i_should_see_text_message(step):
- world.page.is_text_present('Create geographical location hierarchy')
-
-
-@step(u'And I should see country dropdown')
-def and_i_should_see_country_dropdown(step):
- assert world.browser.find_by_css('#id_country')
-
-
-@step(u'And I should see country present in dropdown')
-def and_i_should_see_country_present_in_dropdown(step):
- world.page.see_select_option([world.country.name], 'country')
-
-
-@step(u'And I should see a row for level details field')
-def and_i_should_see_a_row_for_level_details_field(step):
- world.page.see_field_details('Level 1', 'form-0')
-
-
-@step(u'When I click add row icon')
-def when_i_click_add_row_link(step):
- world.page.click_by_css(".icon-plus")
-
-
-@step(u'Then I should see anther row for levels details field')
-def then_i_should_see_anther_row_for_levels_details_field(step):
- world.page.see_field_details('Level 1', 'form-0')
- world.page.see_field_details('Level 2', 'form-1')
-
-
-@step(u'When I click remove row icon')
-def when_i_click_remove_row_link(step):
- world.browser.find_by_css('.icon-remove').last.click()
-
-
-@step(u'Then I should see row for levels details field removed')
-def then_i_should_see_row_for_levels_details_field_removed(step):
- world.page.see_field_details('Level 1', 'form-0')
- world.page.see_field_details('Level 2', 'form-1', False)
-
-
-@step(u'And the code field is hidden')
-def and_the_code_field_is_hidden(step):
- world.page.is_hidden('form-0-length_of_code')
-
-
-@step(u'When I check has_code field')
-def when_i_check_has_code_field(step):
- world.page.click_by_css('.has_code')
-
-
-@step(u'Then length of code field is shown')
-def then_code_field_is_shown(step):
- world.page.is_hidden('code', False)
-
-
-@step(u'When I fill details')
-def when_i_fill_details(step):
- data = {'country': world.country.id, 'form-0-levels': 'Region',
- 'form-0-levels': 'Hill', 'form-0-required': 'on',
- 'form-0-has_code': 'on', 'form-0-length_of_code': 2,
- }
- world.page.fill_valid_values(data)
- world.page.fill('form-0-length_of_code', '2')
-
-
-@step(u'And I click the create hierarchy button')
-def and_i_click_the_create_hierarchy_button(step):
- world.page.submit()
-
-
-@step(u'Then I should see location hierarchy successfully created')
-def then_i_should_see_location_hierarchy_successfully_created(step):
- world.page.see_success_message('Location Hierarchy', 'created')
diff --git a/survey/features/location_weights.feature b/survey/features/location_weights.feature
deleted file mode 100644
index 7a5a6a2a..00000000
--- a/survey/features/location_weights.feature
+++ /dev/null
@@ -1,58 +0,0 @@
-Feature: Location Weights upload
-
- Scenario: Upload locations weights
- Given I am logged in as researcher
- And I have some locations to add weights
- And I have a survey
- When I visit upload locations weights page
- Then I should see upload weights form fields
- When I click on the link for input file format
- Then I should see table of location weights layout
- When I click on the link for input file format
- Then said weight layout should collapse
- When I have a locations weights csv file
- And I input that file
- And I select a survey
- And I click the save button
- Then I should see location weights upload is in progress
-
- Scenario: List locations weights
- Given I am logged in as researcher
- And I have a survey
- And I have some locations with weights
- And I have error logs from location weights upload
- And I visit the list location weights page
- Then I should see the locations weights
- When I click the view error logs link
- Then I should see the error logs from previous the month
-
- Scenario: List locations weights -- pagination and upload link
- Given I am logged in as researcher
- And I have a survey
- And I have some 100 locations with weights
- And I visit the list location weights page
- Then I see locations weights paginated
- When I click the upload weights link
- Then I should see upload weights page
-
-
- Scenario: Filter list locations weights
- Given I am logged in as researcher
- And I have two surveys
- And I have a number of locations and weights in each survey
- And I visit the list location weights page
- And I select one survey
- And I click get list
- Then I should see the location weights in that survey
- When I select a location
- And I click get list
- Then I should see the weights for that location and survey
-
- Scenario: List and filter upload weights error logs
- Given I am logged in as researcher
- And I have some error logs for upload weights
- And I visit the weights error logs page
- Then I should see all error logs
- When I select from and to dates
- And I click the filter link
- Then I should see only error logs between those dates
\ No newline at end of file
diff --git a/survey/features/location_weights_steps.py b/survey/features/location_weights_steps.py
deleted file mode 100644
index 54defd7d..00000000
--- a/survey/features/location_weights_steps.py
+++ /dev/null
@@ -1,300 +0,0 @@
-import csv
-from time import sleep
-import datetime
-from lettuce import step, world
-from rapidsms.contrib.locations.models import Location, LocationType
-from survey.features.page_objects.uploads import UploadWeightsPage
-from survey.features.page_objects.weights import ListLocationWeightsPage, ListLocationWeightsErrorLogPage
-from survey.models import LocationWeight, UploadErrorLog, Survey, LocationTypeDetails
-
-
-@step(u'And I have some locations to add weights')
-def and_i_have_a_locations(step):
- country = LocationType.objects.create(name='Country', slug='country')
- uganda = Location.objects.create(name="Uganda", type=country)
- LocationTypeDetails.objects.create(country=uganda, location_type=country)
-
- region_type = LocationType.objects.create(name="region1", slug="region1")
- district_type = LocationType.objects.create(
- name="district1", slug='district1')
- county_type = LocationType.objects.create(name="county1", slug='county1')
-
- region = Location.objects.create(
- name="region1", type=region_type, tree_parent=uganda)
- district = Location.objects.create(
- name="district1", tree_parent=region, type=district_type)
- Location.objects.create(
- name="county1", tree_parent=district, type=county_type)
-
- region = Location.objects.create(
- name="region2", tree_parent=uganda, type=region_type)
- district = Location.objects.create(
- name="district2", tree_parent=region, type=district_type)
- Location.objects.create(
- name="county2", tree_parent=district, type=county_type)
-
-
-@step(u'When I visit upload locations weights page')
-def when_i_visit_upload_locations_weights_page(step):
- world.page = UploadWeightsPage(world.browser)
- world.page.visit()
-
-
-@step(u'Then I should see upload weights form fields')
-def then_i_should_see_upload_weights_form_fields(step):
- world.page.validate_fields_present(
- ["Upload Location Weights", "Survey", "Location weights file"])
-
-
-@step(u'Then I should see table of location weights layout')
-def then_i_should_see_table_of_location_weights_layout(step):
- world.type_names = [type.name.capitalize(
- ) + 'Name' for type in LocationType.objects.all()]
- world.page.validate_fields_present(world.type_names)
-
-
-@step(u'And I select a survey')
-def and_i_select_a_survey(step):
- world.page.select('survey', [world.survey.id])
-
-
-@step(u'When I have a locations weights csv file')
-def when_i_have_a_locations_weights_csv_file(step):
- filedata = [world.type_names,
- ['region1', 'district1', 'county1', '0.02'],
- ['region2', 'district2', 'county2', '0.1']]
- write_to_csv('wb', filedata, 'test.csv')
-
-
-def write_to_csv(mode, data, csvfilename):
- with open(csvfilename, mode) as fp:
- file = csv.writer(fp, delimiter=',')
- file.writerows(data)
-
-
-@step(u'Then I should see location weights upload is in progress')
-def then_i_should_see_location_weights_successfully_added(step):
- world.page.is_text_present('Upload in progress. This could take a while.')
-
-
-@step(u'Then said weight layout should collapse')
-def then_said_weight_layout_should_collapse(step):
- sleep(3)
- world.page.validate_layout_collapsed()
-
-
-@step(u'And I have some locations with weights')
-def and_i_have_some_locations_to_with_weights(step):
- country = LocationType.objects.create(name="Country", slug="country")
- uganda = Location.objects.create(name="Uganda", type=country)
- LocationTypeDetails.objects.create(country=uganda, location_type=country)
-
- reqion_type = LocationType.objects.create(name="region1", slug="region1")
- district_type = LocationType.objects.create(
- name="district1", slug='district1')
- county_type = LocationType.objects.create(name="county1", slug='county1')
-
- region = Location.objects.create(
- name="region1", type=reqion_type, tree_parent=uganda)
- district = Location.objects.create(
- name="district1", tree_parent=region, type=district_type)
- county = Location.objects.create(
- name="county1", tree_parent=district, type=county_type)
-
- region = Location.objects.create(
- name="region2", type=reqion_type, tree_parent=uganda)
- district = Location.objects.create(
- name="district2", tree_parent=region, type=district_type)
- county1 = Location.objects.create(
- name="county2", tree_parent=district, type=county_type)
- world.weight_1 = LocationWeight.objects.create(
- location=county, selection_probability=0.1, survey=world.survey)
- world.weight_2 = LocationWeight.objects.create(
- location=county1, selection_probability=0.2, survey=world.survey)
-
-
-@step(u'And I have error logs from location weights upload')
-def and_i_have_error_logs_from_location_weights_upload(step):
- world.error_log = UploadErrorLog.objects.create(
- model="WEIGHTS", filename="some_file.csv", error="Some error")
- world.error_log2 = UploadErrorLog.objects.create(
- model="WEIGHTS", filename="some_file.csv", error="Some error two")
-
-
-@step(u'And I visit the list location weights page')
-def and_i_visit_the_list_location_weights_page(step):
- world.page = ListLocationWeightsPage(world.browser)
- world.page.visit()
-
-
-@step(u'Then I should see the locations weights')
-def then_i_should_see_the_locations_weights(step):
- weight_1_details = [world.weight_1.location.name, str(world.weight_1.selection_probability),
- str(world.weight_1.survey.get_total_respondents()), str(world.weight_1.survey.sample_size)]
- weight_2_details = [world.weight_2.location.name, str(world.weight_2.selection_probability),
- str(world.weight_2.survey.get_total_respondents()), str(world.weight_1.survey.sample_size)]
- world.page.validate_fields_present(weight_1_details)
- world.page.validate_fields_present(weight_2_details)
-
-
-@step(u'When i click the view error logs link')
-def when_i_click_the_view_error_logs_link(step):
- world.page.click_by_css("#view_error_log")
-
-
-@step(u'Then I should see the error logs from previous the month')
-def then_i_should_see_the_error_logs_from_previous_the_month(step):
- world.page = ListLocationWeightsErrorLogPage(world.browser)
- world.page.validate_fields_present(
- [world.error_log.filename, world.error_log.error])
- world.page.validate_fields_present(
- [world.error_log2.filename, world.error_log2.error])
-
-
-@step(u'And I have two surveys')
-def and_i_have_two_surveys(step):
- world.survey_1 = Survey.objects.create(name="Survey 1")
- world.survey_2 = Survey.objects.create(name="Survey 2")
-
-
-@step(u'And I select one survey')
-def and_i_select_one_survey(step):
- world.page.select("survey", [world.survey_2.id])
-
-
-@step(u'And I have a number of locations and weights in each survey')
-def and_i_have_a_number_of_locations_and_weights_in_each_survey(step):
- country = LocationType.objects.create(name='Country', slug='country')
- uganda = Location.objects.create(name="Uganda", type=country)
- LocationTypeDetails.objects.create(country=uganda, location_type=country)
-
- county = LocationType.objects.create(name="County", slug="county")
- world.county1 = Location.objects.create(
- name="county1", type=county, tree_parent=uganda)
- world.county2 = Location.objects.create(
- name="county2", type=county, tree_parent=uganda)
- world.weight_1 = LocationWeight.objects.create(
- location=world.county1, selection_probability=0.1, survey=world.survey_1)
- world.weight_2 = LocationWeight.objects.create(
- location=world.county2, selection_probability=0.2, survey=world.survey_2)
- world.weight_3 = LocationWeight.objects.create(
- location=world.county1, selection_probability=0.22, survey=world.survey_2)
-
-
-@step(u'And I click get list')
-def and_i_click_get_list(step):
-
- world.page.click_by_css("#get_list")
-
-
-@step(u'Then I should see the location weights in that survey')
-def then_i_should_see_the_location_weights_in_that_survey(step):
- weight_3_details = [world.weight_3.location.name, str(world.weight_3.selection_probability),
- str(world.weight_3.survey.get_total_respondents()), str(world.weight_3.survey.sample_size)]
- weight_2_details = [world.weight_2.location.name, str(world.weight_2.selection_probability),
- str(world.weight_2.survey.get_total_respondents()), str(world.weight_1.survey.sample_size)]
- world.page.validate_fields_present(weight_3_details)
- world.page.validate_fields_present(weight_2_details)
-
-
-@step(u'When I select a location')
-def when_i_select_a_location(step):
- world.page.fill_in_with_js('$("#location-county")', world.county1.id)
-
-
-@step(u'Then I should see the weights for that location and survey')
-def then_i_should_see_the_weights_for_that_location_and_survey(step):
- weight_3_details = [world.weight_3.location.name, str(world.weight_3.selection_probability),
- str(world.weight_3.survey.get_total_respondents()), str(world.weight_3.survey.sample_size)]
- world.page.validate_fields_present(weight_3_details)
-
-
-@step(u'When I click the upload weights link')
-def when_i_click_the_upload_weights_link(step):
- world.page.click_by_css('#upload_weights')
-
-
-@step(u'Then I should see upload weights page')
-def then_i_should_see_upload_weights_page(step):
- world.page = UploadWeightsPage(world.browser)
- world.page.validate_url()
-
-
-@step(u'And I have some 100 locations with weights')
-def and_i_have_some_100_locations_with_weights(step):
- country = LocationType.objects.create(name="Country", slug="country")
- uganda = Location.objects.create(name="Uganda", type=country)
- LocationTypeDetails.objects.create(country=uganda, location_type=country)
-
- reqion_type = LocationType.objects.create(name="region1", slug="region1")
- district_type = LocationType.objects.create(
- name="district1", slug='district1')
- county_type = LocationType.objects.create(name="county1", slug='county1')
-
- region = Location.objects.create(
- name="region1", type=reqion_type, tree_parent=uganda)
- district = Location.objects.create(
- name="district1", tree_parent=region, type=district_type)
- county = Location.objects.create(
- name="county1", tree_parent=district, type=county_type)
-
- for i in xrange(100):
- location = Location.objects.create(
- name=str(i), tree_parent=district, type=county_type)
- LocationWeight.objects.create(
- location=location, selection_probability=i / 100.0, survey=world.survey)
-
-
-@step(u'Then I see locations weights paginated')
-def then_i_see_locations_weights_paginated(step):
- world.page.validate_pagination()
-
-
-@step(u'And I have some error logs for upload weights')
-def and_i_have_some_error_logs_for_upload_weights(step):
- world.error_log = UploadErrorLog.objects.create(
- model="WEIGHTS", filename="some_file.csv", error="Some error")
- world.error_log2 = UploadErrorLog.objects.create(
- model="WEIGHTS", filename="some_file_1.csv", error="Some error two")
- world.error_log3 = UploadErrorLog.objects.create(
- model="LOCATION", filename="some_file_2.csv", error="Some error three")
-
- world.timedelta = datetime.timedelta(days=4)
- world.error_log2.created += world.timedelta
- world.error_log2.save()
-
-
-@step(u'And I visit the weights error logs page')
-def and_i_visit_the_weights_error_logs_page(step):
- world.page = ListLocationWeightsErrorLogPage(world.browser)
- world.page.visit()
-
-
-@step(u'Then I should see all error logs')
-def then_i_should_see_all_error_logs(step):
- world.page.validate_fields_present(
- [world.error_log.filename, world.error_log.error])
- world.page.validate_fields_present(
- [world.error_log2.filename, world.error_log2.error])
- world.page.validate_fields_present(
- [world.error_log3.filename, world.error_log3.error], False)
-
-
-@step(u'When I select from and to dates')
-def when_i_select_from_and_to_dates(step):
- dates = {'from_date': world.error_log.created.strftime('%Y-%m-%d'),
- 'to_date': world.error_log.created.strftime('%Y-%m-%d')}
- world.page.fill_valid_values(dates)
-
-
-@step(u'Then I should see only error logs between those dates')
-def then_i_should_see_only_error_logs_between_those_dates(step):
- world.page.validate_fields_present(
- [world.error_log.filename, world.error_log.error])
- world.page.validate_fields_present(
- [world.error_log2.filename, world.error_log2.error], False)
-
-
-@step(u'And I click the filter link')
-def and_i_click_the_filter_link(step):
- world.page.click_by_css('#get_logs')
diff --git a/survey/features/login-steps.py b/survey/features/login-steps.py
deleted file mode 100644
index 29a9797f..00000000
--- a/survey/features/login-steps.py
+++ /dev/null
@@ -1,83 +0,0 @@
-from lettuce import *
-from django.contrib.auth.models import User
-
-from survey.features.page_objects.accounts import LoginPage
-
-from survey.features.page_objects.aggregates import AggregateStatusPage, DownloadExcelPage
-from survey.features.page_objects.households import NewHouseholdPage
-from survey.features.page_objects.investigators import NewInvestigatorPage, InvestigatorsListPage
-from survey.features.page_objects.root import HomePage
-from survey.features.page_objects.users import NewUserPage
-from survey.models.users import UserProfile
-
-
-@step(u'Given I have a user')
-def given_i_have_a_user(step):
- world.user = User.objects.create_user(
- 'Rajni', 'rajni@kant.com', 'I_Rock', first_name='Rajin', last_name="Kant")
- profile = UserProfile.objects.create(
- user=world.user, mobile_number='2222222223')
-
-
-@step(u'And I visit the login page')
-def and_i_visit_the_login_page(step):
- world.page = LoginPage(world.browser)
- world.page.visit()
-
-
-@step(u'And I login a user')
-def and_i_login_a_user(step):
- world.page = LoginPage(world.browser)
- world.page.login(world.user)
-
-
-@step(u'Then I should see that I am logged in as given username')
-def then_i_should_see_that_i_am_logged_in_as_given_username(step):
- world.page.see_home_page_and_logged_in_status(world.user)
-
-
-@step(u'And I am in the home page')
-def and_i_am_in_the_home_page(step):
- world.page = HomePage(world.browser)
- world.page.visit()
-
-
-@step(u'And I click the login link')
-def and_i_click_the_login_link(step):
- world.page.click_the_login_link()
-
-
-@step(u'Then I should see new investigator with logout link')
-def then_i_should_see_new_investigator_with_logout_link(step):
- world.page = NewInvestigatorPage(world.browser)
- world.page.see_username_link()
-
-
-@step(u'Then I should see list investigator with logout link')
-def then_i_should_see_list_investigator_with_logout_link(step):
- world.page = InvestigatorsListPage(world.browser)
- world.page.see_username_link()
-
-
-@step(u'Then I should see new household page with logout link')
-def then_i_should_see_new_household_page_with_logout_link(step):
- world.page = NewHouseholdPage(world.browser)
- world.page.see_username_link()
-
-
-@step(u'Then I should see aggregate status page with logout link')
-def then_i_should_see_aggregate_status_page_with_logout_link(step):
- world.page = AggregateStatusPage(world.browser)
- world.page.see_username_link()
-
-
-@step(u'Then I should see download excel page with logout link')
-def then_i_should_see_download_excel_page_with_logout_link(step):
- world.page = DownloadExcelPage(world.browser)
- world.page.see_username_link()
-
-
-@step(u'Then I should see new user page with logout link')
-def then_i_should_see_new_user_page_with_logout_link(step):
- world.page = NewUserPage(world.browser)
- world.page.see_username_link()
diff --git a/survey/features/login.feature b/survey/features/login.feature
deleted file mode 100644
index 76307db4..00000000
--- a/survey/features/login.feature
+++ /dev/null
@@ -1,50 +0,0 @@
-Feature: Login feature
-
- Scenario: Login page
- Given I have a user
- And And I visit the login page
- And I login a user
- Then I should see that I am logged in as given username
-
- Scenario: Login from Home page
- Given I have a user
- And I am in the home page
- And I click the login link
- And I login a user
- Then I should see that I am logged in as given username
-
- Scenario: Login from new investigator page
- Given I have a user
- And I have locations
- And I visit new investigator page
- And I login a user
- Then I should see new investigator with logout link
-
- Scenario: Login from list investigator page
- Given I have a user
- And I have locations
- And I visit investigators listing page
- And I login a user
- Then I should see list investigator with logout link
-
- Scenario: Login from new household page
- Given I have a user
- And I have locations
- And I have an investigator in that location
- And I visit new household page
- And I login a user
- Then I should see new household page with logout link
-
- Scenario: Login from download excel report page
- Given I have a user
- And I have three surveys
- And I have batches in those surveys
- And I visit download excel page
- And I login a user
- Then I should see download excel page with logout link
-
- Scenario: Login from users page
- Given I have a user
- And I visit new user page
- And I login a user
- Then I should see new user page with logout link
diff --git a/survey/features/page_objects/__init__.py b/survey/features/page_objects/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/survey/features/page_objects/accounts.py b/survey/features/page_objects/accounts.py
deleted file mode 100644
index 63f105f4..00000000
--- a/survey/features/page_objects/accounts.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
-from survey.features.page_objects.base import PageObject
-from survey.features.page_objects.root import AboutPage, HomePage
-
-from lettuce.django import django_url
-
-
-class ResetPasswordPage(PageObject):
- url = '/accounts/reset_password/'
-
- def is_change_password_form_visble(self):
- self.browser.is_text_present("Old password")
- self.browser.is_text_present("New password")
- self.browser.is_text_present("New password confirmation")
-
- def click_change_password_button(self):
- self.browser.find_by_name("save_changes").first.click()
-
- def is_incorrect_oldpassword_error_visible(self):
- self.is_text_present(
- "Your old password was entered incorrectly. Please enter it again.")
-
- def is_password_mismatch(self):
- self.is_text_present("The two password fields didn't match.")
-
-
-class LogoutPage(PageObject):
- url = "/accounts/logout"
-
- def check_browser_is_in_about_page(self):
- assert self.browser.url == django_url(AboutPage.url)
-
-
-class LoginPage(PageObject):
- url = "/accounts/login"
-
- def login(self, user):
- self.is_text_present('Type your username and password to login')
-
- user.set_password('secret')
- user.save()
- details = {'username': user.username,
- 'password': 'secret',
- }
-
- self.browser.fill_form(details)
- self.submit()
-
- def see_home_page_and_logged_in_status(self, user):
- assert self.browser.url == django_url(HomePage.url)
- self.see_logged_in_status(user)
diff --git a/survey/features/page_objects/aggregates.py b/survey/features/page_objects/aggregates.py
deleted file mode 100644
index 2c35a08e..00000000
--- a/survey/features/page_objects/aggregates.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
-import os
-from rapidsms.contrib.locations.models import Location
-from survey.features.page_objects.base import PageObject
-
-
-class AggregateStatusPage(PageObject):
- url = "/aggregates/status"
-
- def choose_location(self, locations):
- for key, value in locations.items():
- object_id = "location-%s" % key
- assert self.browser.is_element_present_by_id(object_id)
- jquery_id = '$("#%s")' % object_id
- location = Location.objects.get(name=value)
- self.fill_in_with_js(jquery_id, location.pk)
-
- def check_if_batches_present(self, batches):
- all_options = self.browser.find_by_id(
- 'id_batch')[0].find_by_tag('option')
- all_options = [option.text for option in all_options]
- for batch in batches:
- assert batch.name in all_options
-
- def check_get_status_button_presence(self):
- assert self.browser.find_by_css(
- "#aggregates-form")[0].find_by_tag('button')[0].text == "Get status"
-
- def choose_batch(self, batch):
- self.browser.select('batch', batch.pk)
-
- def assert_status_count(self, pending_households, completed_housesholds, pending_clusters, completed_clusters):
- assert self.browser.find_by_id(
- 'pending-households-count')[0].text == str(pending_households)
- assert self.browser.find_by_id(
- 'completed-households-count')[0].text == str(completed_housesholds)
- assert self.browser.find_by_id(
- 'pending-clusters-count')[0].text == str(pending_clusters)
- assert self.browser.find_by_id(
- 'completed-clusters-count')[0].text == str(completed_clusters)
-
- def check_presence_of_investigators(self, *investigators):
- for investigator in investigators:
- self.is_text_present(investigator.name)
- self.is_text_present(investigator.mobile_number)
- self.is_text_present("10")
-
- def assert_presence_of_batch_is_closed_message(self):
- self.is_text_present(
- "This batch is currently closed for this location.")
-
- def select_all_district(self):
- self.browser.execute_script(
- "$('#location-district').val('').change().trigger('liszt:updated').chosen().change();")
-
- def see_all_districts_location_selected(self):
- assert self.browser.find_by_css('input[name=location]')[0].value == ''
-
-
-class DownloadExcelPage(PageObject):
- url = "/aggregates/download_spreadsheet"
-
-
-class InvestigatorReportPage(PageObject):
-
- def __init__(self, browser):
- super(InvestigatorReportPage, self).__init__(browser)
- self.url = '/investigator_report/'
-
- def validate_select_option(self, batch):
- element_value = self.browser.find_by_css("#id_batch")[0].value
- assert int(element_value) == int(batch.id)
diff --git a/survey/features/page_objects/base.py b/survey/features/page_objects/base.py
deleted file mode 100644
index 8e4d0cc6..00000000
--- a/survey/features/page_objects/base.py
+++ /dev/null
@@ -1,228 +0,0 @@
-# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
-from random import randint
-from time import sleep
-from django.core.urlresolvers import reverse
-from lettuce.django import django_url
-from nose.tools import assert_equals
-
-
-class PageObject(object):
-
- def __init__(self, browser):
- self.browser = browser
-
- def visit(self):
- self.browser.visit(django_url(self.url))
-
- def validate_url(self):
- assert self.browser.url == django_url(self.url)
-
- def fill(self, name, value):
- self.browser.fill(name, value)
-
- def is_text_present(self, text, status=True):
- assert_equals(status, self.browser.is_text_present(text))
-
- def is_disabled(self, element_id):
- try:
- element = self.browser.find_by_css(
- '#%s[disabled]' % element_id).first
- return True
- except Exception, e:
- return False
-
- def fill_in_with_js(self, jquery_id, object_id):
- script = '%s.val(%s).change(); %s.trigger("liszt:updated").chosen().change()' % (
- jquery_id, object_id, jquery_id)
- self.browser.execute_script(script)
- sleep(2)
-
- def submit(self):
- self.browser.find_by_css("form button").first.click()
-
- def see_username_link(self):
- self.click_by_css('.btn-navbar')
- assert self.browser.find_by_css("#drop-user-settings")
-
- def see_logged_in_status(self, user):
- assert self.browser.find_link_by_partial_text(
- "Logged in as: %s" % user.get_full_name())
-
- def see_the_about_link(self):
- assert self.browser.find_link_by_text('About')
-
- def find_link_by_text(self, text):
- assert self.browser.find_link_by_text(text)
-
- def click_the_about_link(self):
- self.browser.click_link_by_text('About')
-
- def check_anonymous_user_allowed_tabs(self):
- assert self.browser.find_link_by_text('About')
- assert self.browser.find_link_by_text('mMICS')
- assert self.browser.find_link_by_text('Login')
-
- def check_data_entry_allowed_tabs(self):
- assert self.browser.find_link_by_text('About')
- assert self.browser.find_link_by_text('mMICS')
- assert self.browser.find_link_by_text('Survey Administration')
-
- def check_researcher_allowed_tabs(self):
- self.check_data_entry_allowed_tabs()
- assert self.browser.find_link_by_text('Downloads')
- assert self.browser.find_link_by_text('Analysis')
-
- def check_all_tabs(self):
- self.check_researcher_allowed_tabs()
- assert self.browser.find_link_by_text('Settings')
-
- def check_researcher_not_allowed_tabs(self):
- assert not self.browser.find_link_by_text('Settings')
-
- def check_data_entry_not_allowed_tabs(self):
- self.check_researcher_not_allowed_tabs()
- assert not self.browser.find_link_by_text('Downloads')
- assert not self.browser.find_link_by_text('Analysis')
-
- def check_anonymous_user_not_allowed_tabs(self):
- self.check_data_entry_not_allowed_tabs()
- assert not self.browser.find_link_by_text('Survey Administration')
-
- def check_notify_investigators_drop_down_is_not_present(self):
- self.browser.click_link_by_text('Survey Administration')
- assert not self.browser.find_link_by_text('Notifications')
-
- def choose_radio(self, name, value):
- js = "$('input:radio[name=%s][value=%s]').prop('checked', true).change()" % (
- name, value)
- self.browser.execute_script(js)
-
- def see_user_settings_link(self, user):
- assert self.browser.find_link_by_partial_text(
- "%s" % str(user.get_full_name()))
-
- def click_user_settings(self):
- self.click_by_css("#fold-menu")
- sleep(3)
- self.click_by_css("#drop-user-settings")
-
- def assert_user_can_see_profile_and_logout_link(self):
- links = ["Edit Profile", "Change Password", "Logout"]
- for link in links:
- assert self.browser.find_link_by_partial_text(link)
-
- def click_reset_password_form(self):
- self.browser.find_link_by_partial_text("Change Password").click()
-
- def assert_password_successfully_reset(self):
- self.browser.is_text_present("Your password was reset successfully!!")
-
- def click_actions_button(self):
- self.browser.find_by_css('#action_caret').first.click()
-
- def click_link_by_text(self, text):
- self.browser.click_link_by_text(text)
-
- def fill_valid_values(self, data):
- self.browser.fill_form(data)
- sleep(2)
-
- def validate_pagination(self):
- self.browser.click_link_by_text("2")
-
- def is_radio_selected(self, name, value):
- js = "$('input[name=%s]:radio').prop('checked')" % name
- return self.browser.execute_script(js) == value
-
- def see_success_message(self, object_name, action_str):
- self.is_text_present('%s successfully %s.' % (object_name, action_str))
-
- def select_multiple(self, field_id=None, *data):
- for item in data:
- script = "$('%s').multiSelect('select', '%s')" % (
- field_id, item.pk)
- self.browser.execute_script(script)
-
- def validate_fields_present(self, fields, status=True):
- for field in fields:
- self.is_text_present(field, status)
-
- def select_date(self, field_id):
- script = "$('%s').focus()" % field_id
- self.browser.execute_script(script)
- script = "$('.ui-state-default').first().click()"
- self.browser.execute_script(script)
-
- def click_tab(self, tab_name):
- self.browser.click_link_by_text(tab_name)
-
- def see_dropdown(self, links):
- for url_name in links:
- assert self.browser.find_link_by_partial_href(reverse(url_name))
-
- def select(self, name, values):
- for value in values:
- self.browser.select(name, value)
-
- def click_by_css(self, css_selector):
- self.browser.find_by_css(css_selector).first.click()
-
- def click_link_by_partial_href(self, modal_id):
- self.browser.click_link_by_partial_href(modal_id)
-
- def click_link_by_href(self, modal_id):
- self.browser.click_link_by_href(modal_id)
-
- def click_button(self, name):
- self.browser.find_by_name(name).first.click()
-
- def find_by_css(self, css_selector, text):
- assert self.browser.find_by_css(css_selector).first.value == text
-
- def see_select_option(self, option_list, field_name):
- for option in option_list:
- assert option in self.browser.find_by_name(field_name).first.text
-
- def option_not_present(self, option_list, field_name):
- for option in option_list:
- assert not option in self.browser.find_by_name(
- field_name).first.text
-
- def see_message(self, text):
- assert self.browser.is_text_present(text)
-
- def see_confirm_modal_message(self, name, action_str="delete"):
- self.is_text_present(
- "Confirm: Are you sure you want to %s %s?" % (action_str, name))
-
- def validate_form_present(self, form):
- for key in form.keys():
- assert self.browser.find_by_name(key).first
- self.is_text_present(form[key])
-
- def validate_form_values(self, form_values):
- for key in form_values.keys():
- assert self.browser.find_by_name(
- key).first.value == str(form_values[key])
-
- def field_not_present(self, field_name):
- assert not self.browser.find_by_name(field_name)
-
- def field_is_visible(self, field_name):
- return self.browser.find_by_name(field_name).first.visible
-
- def find_element_by_css(self, selector):
- assert self.browser.find_by_css(selector).first
-
- def is_hidden(self, field, status=True):
- assert_equals(status, not self.browser.find_by_css(
- '.hide').first.visible)
-
- def find_by_name(self, name):
- assert self.browser.find_by_name(name)
-
- def click_by_name(self, name):
- self.browser.find_by_name(name).first.click()
-
- def input_file(self, filename):
- self.browser.attach_file('file', filename)
diff --git a/survey/features/page_objects/batches.py b/survey/features/page_objects/batches.py
deleted file mode 100644
index 66d28f80..00000000
--- a/survey/features/page_objects/batches.py
+++ /dev/null
@@ -1,97 +0,0 @@
-# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
-from time import sleep
-from survey.features.page_objects.base import PageObject
-from nose.tools import assert_equals
-
-
-class AddBatchPage(PageObject):
-
- def __init__(self, browser, survey):
- self.browser = browser
- self.survey = survey
- self.url = '/surveys/%s/batches/new/' % survey.pk
-
- def validate_error_message_on_fields(self):
- self.is_text_present("This field is required.")
-
-
-class BatchShowPage(PageObject):
-
- def __init__(self, browser, batch):
- super(BatchShowPage, self).__init__(browser)
- self.url = "/batches/" + str(batch.pk)
-
- def batch_closed_for_all_locations(self):
- assert len(self.browser.find_by_css('input[checked=checked]')) == 0
-
- def open_batch_for(self, location):
- self.browser.execute_script(
- '$("#open_close_switch_%s").parent().bootstrapSwitch("toggleState")' % location.id)
- sleep(2)
-
- def close_batch_for(self, location):
- self.browser.execute_script(
- '$("#open_close_switch_%s").parent().bootstrapSwitch("toggleState")' % location.id)
- sleep(2)
-
- def activate_non_response_for_batch_and(self, location):
- self.browser.execute_script(
- '$("#activate_non_response_switch_%s").parent().bootstrapSwitch("toggleState")' % location.id)
- sleep(2)
-
- def deactivate_non_response_for_batch_and(self, location):
- self.browser.execute_script(
- '$("#activate_non_response_switch_%s").parent().bootstrapSwitch("toggleState")' % location.id)
- sleep(2)
-
-
-class EditBatchPage(PageObject):
-
- def __init__(self, browser, batch, survey):
- self.browser = browser
- self.batch = batch
- self.survey = survey
- self.url = '/surveys/%s/batches/%s/edit/' % (
- self.survey.id, self.batch.id)
-
-
-class BatchListPage(PageObject):
-
- def __init__(self, browser, survey):
- self.browser = browser
- self.survey = survey
- self.url = '/surveys/' + str(self.survey.id) + '/batches/'
-
- def visit_batch(self, batch):
- self.browser.click_link_by_text(" Open/Close")
- return BatchShowPage(self.browser, batch)
-
- def click_add_batch_button(self):
- self.browser.click_link_by_text("Add Batch")
-
- def validate_fields(self):
- self.validate_fields_present(
- [self.survey.name.capitalize(), "Batch Name", "Description", "Actions"])
-
- def click_link_by_text(self, text):
- self.browser.click_link_by_text(text)
-
- def validate_page_got_survey_id(self):
- assert self.browser.find_by_css(
- '#survey_id').first.value == str(self.survey.id)
-
-
-class AssignQuestionToBatchPage(PageObject):
-
- def __init__(self, browser, batch):
- self.browser = browser
- self.batch = batch
- self.url = '/batches/' + str(self.batch.id) + '/assign_questions/'
-
- def see_the_question(self, status, question_id):
- assert_equals(status, self.browser.find_by_id(
- "%s-selectable" % question_id).visible)
-
- def see_the_selected_question(self, status, question_id):
- assert_equals(status, self.browser.find_by_id(
- "%s-selection" % question_id).visible)
diff --git a/survey/features/page_objects/ea.py b/survey/features/page_objects/ea.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/survey/features/page_objects/household_member.py b/survey/features/page_objects/household_member.py
deleted file mode 100644
index ad613ccb..00000000
--- a/survey/features/page_objects/household_member.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
-from survey.features.page_objects.base import PageObject
-
-
-class NewHouseholdMemberPage(PageObject):
-
- def __init__(self, browser, household):
- self.browser = browser
- self.household = household
- self.url = '/households/%d/member/new/' % household.id
-
- def validate_fields(self):
- self.validate_fields_present(
- ['Family Name', 'Sex', 'Date of birth', 'Create', 'Cancel'])
-
- def fill_valid_member_values(self, data):
- self.browser.fill_form(data)
-
-
-class EditHouseholdMemberPage(PageObject):
-
- def __init__(self, browser, household, member):
- self.browser = browser
- self.household = household
- self.member = member
- self.url = '/households/%d/member/%d/edit/' % (household.id, member.id)
-
- def validate_member_details(self, household_member):
- self.browser.is_text_present(household_member.surname)
- self.browser.is_text_present(household_member.date_of_birth)
- self.is_radio_selected('male', True)
-
- def fill_valid_member_values(self, data):
- self.browser.fill_form(data)
-
-
-class DeleteHouseholdMemberPage(PageObject):
-
- def __init__(self, browser, household, member):
- self.browser = browser
- self.household = household
- self.member = member
- self.url = '/households/%d/member/%d/delete/' % (
- household.id, member.id)
-
- def see_delete_confirmation_modal(self):
- self.is_text_present("Delete Household Member")
- self.is_text_present(
- "Confirm: Are you sure you want to delete %s?" % self.member.surname)
diff --git a/survey/features/page_objects/household_member_groups.py b/survey/features/page_objects/household_member_groups.py
deleted file mode 100644
index b1c59d86..00000000
--- a/survey/features/page_objects/household_member_groups.py
+++ /dev/null
@@ -1,65 +0,0 @@
-from survey.features.page_objects.base import PageObject
-
-
-class GroupConditionListPage(PageObject):
- url = '/conditions/'
-
- def validate_fields(self):
- self.validate_fields_present(
- ["Group Criteria List", "Condition", "Attribute", "Value"])
-
-
-class GroupsListingPage(PageObject):
- url = '/groups/'
-
- def validate_fields(self):
- self.validate_fields_present(
- ["Groups List", "Order", "Group name", "Actions"])
-
-
-class AddConditionPage(PageObject):
- url = "/conditions/new/"
-
-
-class AddGroupPage(PageObject):
- url = '/groups/new/'
-
- def validate_latest_condition(self, condition):
- self.browser.find_by_value("%s > %s > %s" % (
- condition.attribute, condition.condition, condition.value))
-
-
-class GroupConditionModalPage(PageObject):
- url = ''
-
- def validate_contents(self):
- self.validate_fields_present(
- ["Value", "Attribute", "Eligibility Criteria", "New Eligibility Criteria"])
-
-
-class GroupDetailsPage(PageObject):
-
- def __init__(self, browser, group):
- super(GroupDetailsPage, self).__init__(browser)
- self.group = group
- self.url = '/groups/%s/' % group.id
-
- def validate_fields(self):
- self.validate_fields_present(
- ["Group %s Criteria List" % self.group.name, "Condition", "Attribute", "Value"])
-
-
-class AddNewConditionToGroupPage(PageObject):
-
- def __init__(self, browser, group):
- super(AddNewConditionToGroupPage, self).__init__(browser)
- self.group = group
- self.url = '/groups/%d/conditions/new/' % group.id
-
-
-class DeleteHouseholdMemberGroup(PageObject):
-
- def __init__(self, browser, group):
- super(DeleteHouseholdMemberGroup, self).__init__(browser)
- self.group = group
- self.url = '/groups/%d/delete/' % group.id
diff --git a/survey/features/page_objects/households.py b/survey/features/page_objects/households.py
deleted file mode 100644
index ff000cdb..00000000
--- a/survey/features/page_objects/households.py
+++ /dev/null
@@ -1,173 +0,0 @@
-# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
-from rapidsms.contrib.locations.models import Location
-from survey.features.page_objects.base import PageObject
-from survey.investigator_configs import MONTHS
-from survey.models import EnumerationArea
-from survey.models.investigator import Investigator
-from lettuce.django import django_url
-
-
-class NewHouseholdPage(PageObject):
- url = "/households/new/"
-
- def valid_page(self):
- fields = ['investigator', 'surname', 'first_name', 'male', 'date_of_birth', 'occupation',
- 'level_of_education', 'resident_since_month', 'resident_since_year']
- fields += ['uid']
- for field in fields:
- assert self.browser.is_element_present_by_name(field)
-
- def get_household_values(self):
- return self.values
-
- def fill_valid_values(self, values, ea=None):
- kampala = Location.objects.get(name="Kampala")
- kampala_county = Location.objects.get(name="Kampala County")
- kampala_subcounty = Location.objects.get(name="Subcounty")
- kampala_parish = Location.objects.get(name="Parish")
- kampala_village = Location.objects.get(name="Village")
- self.fill_in_with_js('$("#location-district")', kampala.id)
- self.fill_in_with_js('$("#location-county")', kampala_county.id)
- self.fill_in_with_js('$("#location-subcounty")', kampala_subcounty.id)
- self.fill_in_with_js('$("#location-parish")', kampala_parish.id)
- self.fill_in_with_js('$("#location-village")', kampala_village.id)
- self.fill_in_with_js('$("#widget_ea")', ea.id)
-
- investigator = Investigator.objects.get(name="Investigator name")
- self.fill_in_with_js('$("#household-investigator")', investigator.id)
- self.fill_in_with_js('$("#household-extra_resident_since_year")', 1984)
- self.fill_in_with_js('$("#household-extra_resident_since_month")', 1)
- self.values = values
- self.browser.fill_form(self.values)
-
- def validate_household_created(self):
- assert self.browser.is_text_present(
- "Household successfully registered.")
-
- def has_children(self, value):
- self.choose_radio('has_children', value)
-
- def are_children_fields_disabled(self, is_disabled=True):
- for element_id in ['aged_between_5_12_years', 'aged_between_13_17_years']:
- element_id = 'household-children-' + element_id
- assert self.is_disabled(element_id) == is_disabled
- self.are_children_below_5_fields_disabled(is_disabled=is_disabled)
-
- def is_no_below_5_checked(self):
- assert self.browser.find_by_id(
- 'household-children-has_children_below_5_1').selected == True
-
- def cannot_say_yes_to_below_5(self):
- assert self.is_disabled(
- "household-children-has_children_below_5_0") == True
- self.are_children_fields_disabled()
-
- def has_children_below_5(self, value):
- self.choose_radio('has_children_below_5', value)
-
- def are_children_below_5_fields_disabled(self, is_disabled=True):
- for element_id in ['aged_between_0_5_months', 'aged_between_6_11_months', 'aged_between_12_23_months',
- 'aged_between_24_59_months']:
- element_id = 'household-children-' + element_id
- assert self.is_disabled(element_id) == is_disabled
-
- def has_women(self, value):
- self.choose_radio('has_women', value)
-
- def are_women_fields_disabled(self, is_disabled=True):
- for element_id in ['aged_between_15_19_years', 'aged_between_20_49_years']:
- element_id = 'household-women-' + element_id
- assert self.is_disabled(element_id) == is_disabled
-
- def fill_in_number_of_females_lower_than_sum_of_15_19_and_20_49(self):
- self.browser.fill('number_of_females', '1')
- self.browser.fill('aged_between_15_19_years', '2')
- self.browser.fill('aged_between_20_49_years', '3')
-
- def see_an_error_on_number_of_females(self):
- self.is_text_present(
- 'Please enter a value that is greater or equal to the total number of women above 15 years age.')
-
- def choose_occupation(self, occupation_value):
- self.browser.select('occupation', occupation_value)
-
- def is_specify_visible(self, status=True):
- extra = self.browser.find_by_css('#extra-occupation-field')
- if status:
- assert len(extra) == 1
- else:
- assert len(extra) == 0
-
-
-class HouseholdDetailsPage(PageObject):
-
- def __init__(self, browser, household):
- super(HouseholdDetailsPage, self).__init__(browser)
- self.browser = browser
- self.household = household
- self.url = '/households/' + str(household.id) + '/'
-
- def validate_household_details(self):
- household_head = self.household.get_head()
- details = {
- 'Family Name': household_head.surname,
- 'Other Names': household_head.first_name,
- 'Age': str(household_head.get_age()),
- 'Gender': 'Male' if household_head.male else 'Female',
- 'Occupation / Main Livelihood': household_head.occupation,
- 'Highest level of education completed': household_head.level_of_education,
- 'Since when have you lived here': str(household_head.resident_since_year),
- }
- for label, text in details.items():
- self.is_text_present(label)
- self.is_text_present(text)
- self.is_text_present(MONTHS[household_head.resident_since_month][1])
-
- def validate_household_member_details_table_headings(self):
- member_details_headings = ['Family Name', 'Date of birth', 'Sex']
- for heading in member_details_headings:
- self.is_text_present(heading)
-
- def validate_household_member_details_values(self):
- for member in self.household.household_member.all():
- for detail in [member.surname, member.date_of_birth.strftime('%b %d, %Y'), 'Male' if member.male else 'Female']:
- self.is_text_present(str(detail))
-
- def validate_household_member_details(self):
- self.validate_household_member_details_table_headings()
- self.validate_household_member_details_values()
-
- def validate_household_member_title_and_add_household_member_link(self):
- self.is_text_present('Household Members:')
- self.browser.find_link_by_text('Add Member')
-
- def validate_actions_edit_and_delete_member(self):
- self.browser.find_link_by_text('Edit')
- self.browser.find_link_by_text('Delete')
-
- def click_delete_link(self, member_id):
- self.browser.click_link_by_partial_href(
- "#delete_member_%d" % member_id)
-
-
-class HouseholdsListPage(PageObject):
- url = '/households/'
-
- def validate_fields(self):
- self.validate_fields_present(["Households List", "Household ID", "Household Head",
- "District", "County", "Sub County", "Parish", "Village", "Investigator"])
-
- def validate_pagination(self):
- self.browser.click_link_by_text("2")
-
- def no_registered_huseholds(self):
- self.browser.is_text_present(
- 'There are no households currently registered for this country.')
-
-
-class EditHouseholdsPage(PageObject):
-
- def __init__(self, browser, household):
- self.browser = browser
- self.household = household
- self.url = '/households/%s/edit/' % str(household.id)
diff --git a/survey/features/page_objects/indicators.py b/survey/features/page_objects/indicators.py
deleted file mode 100644
index c08b6694..00000000
--- a/survey/features/page_objects/indicators.py
+++ /dev/null
@@ -1,26 +0,0 @@
-from survey.features.page_objects.base import PageObject
-
-
-class NewIndicatorPage(PageObject):
- url = '/indicators/new/'
-
-
-class ListIndicatorPage(PageObject):
- url = '/indicators/'
-
- def see_indicators(self, indicators):
- list_titles = ['Indicator', 'Description',
- 'Module', 'Measure', 'Actions']
- values = [[field.name, field.description, field.module.name,
- field.measure] for field in indicators]
- values.append(list_titles)
- fields = [field for fields in values for field in fields]
- self.validate_fields_present(fields)
-
-
-class SimpleIndicatorGraphPage(PageObject):
-
- def __init__(self, browser, indicator):
- self.indicator = indicator
- self.browser = browser
- self.url = "/indicators/%s/simple/" % self.indicator.id
diff --git a/survey/features/page_objects/investigators.py b/survey/features/page_objects/investigators.py
deleted file mode 100644
index ff5842be..00000000
--- a/survey/features/page_objects/investigators.py
+++ /dev/null
@@ -1,149 +0,0 @@
-# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
-from time import sleep
-from survey.features.page_objects.base import PageObject
-from survey.investigator_configs import COUNTRY_PHONE_CODE
-from rapidsms.contrib.locations.models import Location
-from lettuce.django import django_url
-from survey.models import EnumerationArea
-
-
-class NewInvestigatorPage(PageObject):
- url = "/investigators/new/"
-
- def valid_page(self):
- fields = ['name', 'mobile_number',
- 'confirm_mobile_number', 'male', 'age', 'backend']
- for field in fields:
- assert self.browser.is_element_present_by_name(field)
- assert self.browser.find_by_css(
- "span.add-on")[0].text == COUNTRY_PHONE_CODE
-
- def get_investigator_values(self):
- return self.values
-
- def validate_detail_page_url(self):
- assert self.browser.url == django_url(self.url)
-
- def fill_valid_values(self, values, ea):
- self.browser.find_by_id(
- "location-value").value = Location.objects.create(name="Uganda").id
- kampala = Location.objects.get(name="Kampala")
- kampala_county = Location.objects.get(name="Kampala County")
- kampala_subcounty = Location.objects.get(name="Subcounty")
- kampala_parish = Location.objects.get(name="Parish")
- kampala_village = Location.objects.get(name="Village")
- ea = EnumerationArea.objects.get(name="EA")
- self.fill_in_with_js('$("#location-district")', kampala.id)
- self.fill_in_with_js('$("#location-county")', kampala_county.id)
- self.fill_in_with_js('$("#location-subcounty")', kampala_subcounty.id)
- self.fill_in_with_js('$("#location-parish")', kampala_parish.id)
- self.fill_in_with_js('$("#location-village")', kampala_village.id)
- self.fill_in_with_js('$("#widget_ea")', ea.id)
-
- self.values = values
- self.browser.fill_form(self.values)
-
-
-class InvestigatorsListPage(PageObject):
- url = '/investigators/'
-
- def validate_fields(self):
- self.validate_fields_present(
- ["Investigators List", "Name", "Mobile Number", "Action"])
-
- def validate_pagination(self):
- self.browser.click_link_by_text("2")
-
- def validate_presence_of_investigator(self, values):
- assert self.browser.is_text_present(values['name'])
- assert self.browser.is_text_present(values['mobile_number'])
-
- def no_registered_invesitgators(self):
- assert self.browser.is_text_present(
- "There are no investigators currently registered for this location.")
-
- def visit_investigator(self, investigator):
- self.browser.click_link_by_text(investigator.name)
-
- def see_confirm_block_message(self, confirmation_type, investigator):
- self.is_text_present("Confirm: Are you sure you want to %s investigator %s" % (
- confirmation_type, investigator.name))
-
- def validate_successful_edited_message(self):
- self.is_text_present("Investigator successfully edited.")
-
- def validate_page_url(self):
- assert self.browser.url == django_url(self.url)
-
-
-class FilteredInvestigatorsListPage(InvestigatorsListPage):
-
- def __init__(self, browser, location_id):
- self.browser = browser
- self.url = '/investigators/?location=' + str(location_id)
-
- def no_registered_invesitgators(self):
- assert self.browser.is_text_present(
- "There are no investigators currently registered for this county.")
-
-
-class EditInvestigatorPage(PageObject):
-
- def __init__(self, browser, investigator):
- self.browser = browser
- self.investigator = investigator
- self.url = '/investigators/' + str(investigator.id) + '/edit/'
-
- def validate_edit_investigator_url(self):
- assert self.browser.url == django_url(self.url)
-
- def change_name_of_investigator(self):
- self.values = {
- 'name': 'Updated Name',
- 'mobile_number': self.investigator.mobile_number,
- 'confirm_mobile_number': self.investigator.mobile_number,
- 'male': self.investigator.male,
- 'age': self.investigator.age,
- 'level_of_education': self.investigator.level_of_education,
- 'language': self.investigator.language,
- 'location': self.investigator.location,
- }
- self.browser.fill_form(self.values)
-
- def assert_user_saved_sucessfully(self):
- self.is_text_present("User successfully edited.")
-
-
-class InvestigatorDetailsPage(PageObject):
-
- def __init__(self, browser, investigator):
- self.browser = browser
- self.investigator = investigator
- self.url = '/investigators/' + str(investigator.id) + '/'
-
- def validate_page_content(self):
- details = {
- 'Name': self.investigator.name,
- 'Mobile Number': self.investigator.mobile_number,
- 'Age': str(self.investigator.age),
- 'Sex': 'Male' if self.investigator.male else 'Female',
- 'Highest Level of Education': self.investigator.level_of_education,
- 'Preferred Language of Communication': self.investigator.language,
- 'Country': 'Uganda',
- 'City': 'Kampala',
- }
- for label, text in details.items():
- self.is_text_present(label)
- self.is_text_present(text)
-
- def validate_navigation_links(self):
- assert self.browser.find_link_by_text(' Back')
-
- def validate_back_link(self):
- self.browser.find_link_by_href(django_url(InvestigatorsListPage.url))
-
- def validate_detail_page_url(self):
- assert self.browser.url == django_url(self.url)
-
- def validate_successful_edited_message(self):
- self.is_text_present("Investigator successfully edited.")
diff --git a/survey/features/page_objects/location_hierarchy.py b/survey/features/page_objects/location_hierarchy.py
deleted file mode 100644
index 0b1ca00e..00000000
--- a/survey/features/page_objects/location_hierarchy.py
+++ /dev/null
@@ -1,19 +0,0 @@
-from survey.features.page_objects.base import PageObject
-from nose.tools import assert_equals
-
-
-class AddLocationHierarchyPage(PageObject):
-
- def __init__(self, browser):
- super(AddLocationHierarchyPage, self).__init__(browser)
- self.url = '/locations/hierarchy/add/'
-
- def see_field_details(self, level, form, status=True):
- assert_equals(status, self.browser.is_text_present(level))
- status = 1 if status else 0
- for field in ['levels', 'required', 'has_code', 'code']:
- assert_equals(status, len(
- self.browser.find_by_name(form + '-levels')))
-
- def submit(self):
- self.browser.find_by_name('save_button').first.click()
diff --git a/survey/features/page_objects/question.py b/survey/features/page_objects/question.py
deleted file mode 100644
index 386bddd3..00000000
--- a/survey/features/page_objects/question.py
+++ /dev/null
@@ -1,91 +0,0 @@
-from survey.features.page_objects.base import PageObject
-from nose.tools import assert_equals
-
-
-class BatchQuestionsListPage(PageObject):
-
- def __init__(self, browser, batch):
- self.browser = browser
- self.batch = batch
- self.url = '/batches/%d/questions/' % batch.id
-
- def validate_fields(self):
- self.is_text_present('%s Question' % self.batch.name.capitalize())
- self.is_text_present('Code')
- self.is_text_present('Question')
- self.is_text_present('Type')
- self.is_text_present('Group')
- self.is_text_present('Actions')
-
- def validate_pagination(self, status=True):
- assert_equals(not status, not self.browser.find_link_by_text("2"))
-
- def validate_back_to_questions_list_page(self):
- assert_equals(False, self.browser.is_text_present("Text"))
- assert_equals(False, self.browser.is_text_present("Order"))
- assert_equals(False, self.browser.is_text_present("Close"))
-
- def validate_only_view_options_action_exists(self):
- self.find_link_by_text("View options/Logic")
- self.find_link_by_text("View Logic")
-
- self.is_text_present("Add Subquestion", False)
- self.is_text_present("Add Logic", False)
- self.is_text_present("Edit", False)
- self.is_text_present("Remove", False)
-
-
-class ListAllQuestionsPage(PageObject):
- url = "/questions/"
-
- def validate_fields(self):
- self.validate_fields_present(
- ['Questions List', 'Question', 'Type', 'Group', 'Actions'])
-
- def click_delete_subquestion(self):
- self.click_by_css("#delete_subquestion")
-
-
-class AddQuestionPage(PageObject):
-
- def __init__(self, browser, batch):
- self.browser = browser
- self.batch = batch
- self.url = '/batches/%d/questions/new/' % batch.id
-
-
-class CreateNewQuestionPage(PageObject):
- url = "/questions/new/"
-
- def see_one_option_field(self, option):
- self.is_text_present(option)
-
- def see_option_add_and_remove_buttons(self, length):
- assert len(self.browser.find_by_css(".icon-plus")) == length
- assert len(self.browser.find_by_css(".icon-remove")) == length
-
- def option_not_present(self, option):
- assert not self.browser.is_text_present(option)
-
- def see_option_text(self, option_text, field_name):
- elements = self.browser.find_by_name(field_name)
- for element in elements:
- if option_text in element.text:
- return True
- return False
-
-
-class CreateNewSubQuestionPage(PageObject):
-
- def __init__(self, browser, question):
- self.browser = browser
- self.question = question
- self.url = "/questions/%d/sub_questions/new/" % question.id
-
-
-class EditQuestionPage(PageObject):
-
- def __init__(self, browser, question):
- super(EditQuestionPage, self).__init__(browser)
- self.question = question
- self.url = "/questions/%d/edit/" % question.id
diff --git a/survey/features/page_objects/question_module.py b/survey/features/page_objects/question_module.py
deleted file mode 100644
index 840bcf64..00000000
--- a/survey/features/page_objects/question_module.py
+++ /dev/null
@@ -1,17 +0,0 @@
-from survey.features.page_objects.base import PageObject
-
-
-class QuestionModuleList(PageObject):
- url = "/modules/"
-
-
-class NewQuestionModule(PageObject):
- url = "/modules/new/"
-
-
-class EditQuestionModulePage(PageObject):
-
- def __init__(self, browser, module):
- super(EditQuestionModulePage, self).__init__(browser)
- self.module = module
- self.url = '/modules/%s/edit/' % module.id
diff --git a/survey/features/page_objects/root.py b/survey/features/page_objects/root.py
deleted file mode 100644
index f1de3002..00000000
--- a/survey/features/page_objects/root.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# -*- coding: utf-8 -*-
-from time import sleep
-
-from rapidsms.backends.database.models import BackendMessage
-
-from survey.features.page_objects.base import PageObject
-from survey.models.investigator import Investigator
-
-
-class HomePage(PageObject):
- url = "/"
-
- def click_the_login_link(self):
- self.browser.click_link_by_text('Login')
-
- def see_under_construction(self):
- self.is_text_present('Under Construction')
-
-
-class AboutPage(PageObject):
- url = "/about/"
-
- def see_the_about_text_provided_by_panwar(self):
- self.is_text_present('Multiple Indicator Cluster Survey (MICS)')
- self.is_text_present('Survey tools')
- self.is_text_present(
- 'Mobile-based Multiple Indicator Cluster Survey (MICS)')
-
- def assert_edit_link_absent(self):
- assert not self.browser.find_by_css("#edit-about_us")
-
-
-class EditAboutUsPage(PageObject):
- url = '/about/edit/'
-
- def fill_wywget_textarea(self, data):
- script = '$("#content-editor").show().css("visibility","")'
- self.browser.execute_script(script)
- sleep(2)
- self.fill_valid_values(data)
-
-
-class BulkSMSPage(PageObject):
- url = "/bulk_sms"
- messages = {
- "location": "Please select a location.",
- "text": "Please enter the message to send.",
- }
-
- def compose_message(self, message):
- self.message = message
- self.fill('text', message)
-
- def is_message_sent(self):
- self.is_text_present("Your message has been sent to investigators.")
- for investgator in Investigator.objects.all():
- assert BackendMessage.objects.filter(
- identity=investgator.identity, text=self.message).count() == 1
-
- def error_message_for(self, field):
- self.is_text_present(self.messages[field])
-
- def enter_text(self, length):
- message = "*" * length
- self.fill('text', message)
-
- def counter_updated(self, length):
- counter = str(length) + "/480"
- self.is_text_present(counter)
diff --git a/survey/features/page_objects/rules.py b/survey/features/page_objects/rules.py
deleted file mode 100644
index 545994c8..00000000
--- a/survey/features/page_objects/rules.py
+++ /dev/null
@@ -1,17 +0,0 @@
-from survey.features.page_objects.base import PageObject
-
-
-class AddLogicToBatchQuestionPage(PageObject):
-
- def __init__(self, browser, batch, question):
- super(AddLogicToBatchQuestionPage, self).__init__(browser)
- self.question = question
- self.batch = batch
- self.url = '/batches/%s/questions/%s/add_logic/' % (
- batch.id, question.id)
-
- def validate_fields(self):
- fields = ['Question: %s' % str(
- self.question), 'Eligibility criteria', 'Attribute', 'Then']
-
- self.validate_fields_present(fields)
diff --git a/survey/features/page_objects/survey_completion_rates.py b/survey/features/page_objects/survey_completion_rates.py
deleted file mode 100644
index c27923a7..00000000
--- a/survey/features/page_objects/survey_completion_rates.py
+++ /dev/null
@@ -1,48 +0,0 @@
-from rapidsms.contrib.locations.models import Location
-from survey.features.page_objects.base import PageObject
-
-
-class SurveyCompletionRatesPage(PageObject):
-
- def __init__(self, browser):
- super(SurveyCompletionRatesPage, self).__init__(browser)
- self.url = '/surveys/completion/'
-
- def choose_location(self, locations):
- for key, value in locations.items():
- object_id = "location-%s" % key
- assert self.browser.is_element_present_by_id(object_id)
- jquery_id = '$("#%s")' % object_id
- location = Location.objects.get(name=value)
- self.fill_in_with_js(jquery_id, location.pk)
-
- def choose_ea(self, ea):
- jquery_id = '$("#widget_ea")'
- self.fill_in_with_js(jquery_id, ea.id)
-
- def check_if_batches_present(self, batches):
- all_options = self.browser.find_by_id(
- 'id_batch')[0].find_by_tag('option')
- all_options = [option.text for option in all_options]
- for batch in batches:
- assert batch.name in all_options
-
- def check_get_status_button_presence(self):
- assert self.browser.find_by_css(
- "#aggregates-form")[0].find_by_tag('button')[0].text == "Get status"
-
- def choose_batch(self, batch):
- self.browser.select('batch', batch.pk)
-
- def see_completion_rates_table(self):
- assert self.browser.is_text_present('Location')
- assert self.browser.is_text_present('Total Household')
- assert self.browser.is_text_present('% Completed')
-
- def see_houdehold_completion_table(self):
- assert self.browser.is_text_present('HH Code')
- assert self.browser.is_text_present('Household Head')
- assert self.browser.is_text_present(
- 'Total number of members in Household')
- assert self.browser.is_text_present('Total Interviewed')
- assert self.browser.is_text_present('Date Completed')
diff --git a/survey/features/page_objects/surveys.py b/survey/features/page_objects/surveys.py
deleted file mode 100644
index 0d7d8866..00000000
--- a/survey/features/page_objects/surveys.py
+++ /dev/null
@@ -1,21 +0,0 @@
-from survey.features.page_objects.base import PageObject
-
-
-class SurveyListPage(PageObject):
- url = '/surveys/'
-
- def validate_fields(self):
- self.validate_fields_present(
- ["Survey List", "Name", "Description", "Type", "Number of Households", "Actions"])
-
-
-class AddSurveyPage(PageObject):
- url = '/surveys/new/'
-
-
-class EditSurveyPage(PageObject):
-
- def __init__(self, browser, survey):
- super(EditSurveyPage, self).__init__(browser)
- self.survey = survey
- self.url = '/surveys/%d/edit/' % survey.id
diff --git a/survey/features/page_objects/uploads.py b/survey/features/page_objects/uploads.py
deleted file mode 100644
index 085a797d..00000000
--- a/survey/features/page_objects/uploads.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
-from survey.features.page_objects.base import PageObject
-
-
-class UploadLocationsPage(PageObject):
-
- def __init__(self, browser):
- super(UploadLocationsPage, self).__init__(browser)
- self.url = '/locations/upload/'
-
- def validate_typecode_appear_before_typename(self, type_name, length_of_code):
- headers = self.browser.find_by_css('th')
- assert headers[0].value == type_name.capitalize() + 'Code'
- assert headers[1].value == type_name.capitalize() + 'Name'
-
- self.is_text_present('0' * length_of_code)
-
-
-class UploadBase(PageObject):
-
- def submit(self):
- self.browser.find_by_name('save_button').first.click()
-
- def validate_layout_collapsed(self):
- collapse_element = self.browser.find_by_css("#collapse_table")
- assert not 'in' in collapse_element.first['class']
-
-
-class UploadWeightsPage(UploadBase):
-
- def __init__(self, browser):
- super(UploadWeightsPage, self).__init__(browser)
- self.url = '/locations/weights/upload/'
-
-
-class UploadEAPage(UploadBase):
-
- def __init__(self, browser):
- super(UploadEAPage, self).__init__(browser)
- self.url = '/locations/enumeration_area/upload/'
diff --git a/survey/features/page_objects/users.py b/survey/features/page_objects/users.py
deleted file mode 100644
index 4e68bdea..00000000
--- a/survey/features/page_objects/users.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
-from time import sleep
-from lettuce.django import django_url
-from survey.features.page_objects.base import PageObject
-
-
-class UsersListPage(PageObject):
- url = "/users/"
-
- def validate_users_listed(self):
- self.is_text_present('Users List')
-
- def validate_displayed_headers(self):
- self.validate_fields_present(
- ["Full name", "Role", "Mobile number", "Actions"])
-
- def validate_users_paginated(self):
- self.browser.click_link_by_text("2")
-
- def assert_user_saved_sucessfully(self):
- self.is_text_present("User successfully edited.")
-
-
-class EditUserDetailsPage(PageObject):
-
- def set_user(self, user):
- self.user = user
- self.url = "/users/" + str(user.pk) + "/edit/"
-
- def assert_form_has_infomation(self):
- assert self.browser.find_by_name(
- "username").first.value == self.user.username
- assert self.browser.find_by_name(
- "mobile_number").first.value == self.user.userprofile.mobile_number
- assert self.browser.find_by_name(
- "email").first.value == self.user.email
-
- def modify_users_information(self):
- assert self.browser.find_by_name('mobile_number')
- self.fill('mobile_number', '994747474')
-
- def click_update_button(self):
- self.browser.find_by_name("save_button").first.click()
-
- def assert_user_saved_sucessfully(self):
- self.is_text_present("User successfully edited.")
-
- def assert_username_is_readonly(self):
- try:
- assert self.browser.find_by_css('#id_username[readonly]').first
- except Exception, e:
- return False
-
- def is_group_input_field_visible(self, status=True):
- if status:
- assert self.browser.find_by_name("groups")
- else:
- assert not self.browser.find_by_name("groups")
-
-
-class UserDetailsPage(PageObject):
-
- def __init__(self, browser, user):
- self.browser = browser
- self.user = user
- self.url = '/users/%d/' % user.id
-
- def validate_page_content(self):
- details = {
- 'Username': self.user.username,
- 'First name': self.user.first_name,
- 'Last name': self.user.last_name,
- 'Mobile number': self.user.userprofile.mobile_number,
- 'Email': self.user.email,
- 'Groups': ", ".join(self.user.groups.all().values_list('name', flat=True)),
- }
- for label, text in details.items():
- self.is_text_present(label)
- self.is_text_present(text)
-
- def validate_back_link(self):
- self.browser.find_link_by_href(django_url(UsersListPage.url))
-
-
-class NewUserPage(PageObject):
- url = "/users/new/"
-
- def valid_page(self):
- sleep(5)
- self.is_text_present('New User')
- fields = ['username', 'password1', 'password2', 'first_name', 'last_name',
- 'mobile_number', 'email', 'groups']
- for field in fields:
- assert self.browser.is_element_present_by_name(field)
-
- def see_user_successfully_registered(self):
- sleep(0.5)
- self.is_text_present('User successfully registered.')
diff --git a/survey/features/page_objects/weights.py b/survey/features/page_objects/weights.py
deleted file mode 100644
index 59d73a2e..00000000
--- a/survey/features/page_objects/weights.py
+++ /dev/null
@@ -1,11 +0,0 @@
-from survey.features.page_objects.base import PageObject
-
-__author__ = 'mnandri'
-
-
-class ListLocationWeightsPage(PageObject):
- url = "/locations/weights/"
-
-
-class ListLocationWeightsErrorLogPage(PageObject):
- url = "/locations/weights/error_logs/"
diff --git a/survey/features/permissions-steps.py b/survey/features/permissions-steps.py
deleted file mode 100644
index 3ba8207a..00000000
--- a/survey/features/permissions-steps.py
+++ /dev/null
@@ -1,94 +0,0 @@
-from lettuce import *
-from django.contrib.auth.models import User, Group, Permission
-from django.contrib.contenttypes.models import ContentType
-
-from survey.features.page_objects.accounts import LogoutPage, LoginPage
-
-
-@step(u'Given I am an anonymous user')
-def given_i_am_an_anonymous_user(step):
- world.page = LogoutPage(world.browser)
- world.page.visit()
-
-
-@step(u'Then I should see anonymous user allowed tabs')
-def then_i_should_see_anonymous_user_allowed_tabs(step):
- world.page = LoginPage(world.browser)
- world.page.check_anonymous_user_allowed_tabs()
-
-
-@step(u'And I should not be seeing above anonymous user level tabs')
-def and_i_should_not_be_seeing_above_anonymous_user_level_tabs(step):
- world.page.check_anonymous_user_not_allowed_tabs()
-
-
-def set_permissions(group, permissions_codename_list):
- auth_content = ContentType.objects.get_for_model(Permission)
- for codename in permissions_codename_list:
- permission, out = Permission.objects.get_or_create(
- codename=codename, content_type=auth_content)
- group.permissions.add(permission)
-
-
-@step(u'Given I have a data entry user')
-def given_i_have_a_data_entry_user(step):
- data_entry = Group.objects.create(name='data_entry')
- world.user = User.objects.create_user('Rajni', 'rajni@kant.com', 'I_Rock')
- data_entry.user_set.add(world.user)
- set_permissions(
- data_entry, ['can_view_households', 'can_view_investigators'])
-
-
-@step(u'And I login that user')
-def and_i_login_that_user(step):
- world.page = LoginPage(world.browser)
- world.page.visit()
- world.page.login(world.user)
-
-
-@step(u'Then I should see data entry allowed tabs')
-def then_i_should_see_data_entry_allowed_tabs(step):
- world.page.check_data_entry_allowed_tabs()
-
-
-@step(u'And I should not be seeing above data entry level tabs')
-def and_i_should_not_be_seeing_above_data_entry_level_tabs(step):
- world.page.check_data_entry_not_allowed_tabs()
-
-
-@step(u'Given I have a researcher user')
-def given_i_have_a_researcher_user(step):
- researcher = Group.objects.create(name='researcher')
- world.user = User.objects.create_user('Rajni', 'rajni@kant.com', 'I_Rock')
- researcher.user_set.add(world.user)
- set_permissions(researcher, [
- 'can_view_aggregates', 'can_view_households', 'can_view_batches', 'can_view_investigators'])
-
-
-@step(u'And I should not be seeing above researcher level tabs')
-def and_i_should_not_be_seeing_above_researcher_level_tabs(step):
- world.page.check_researcher_not_allowed_tabs()
-
-
-@step(u'Then I should see researcher allowed tabs')
-def then_i_should_see_researcher_allowed_tabs(step):
- world.page.check_researcher_allowed_tabs()
-
-
-@step(u'Given I have a admin user')
-def given_i_have_a_admin_user(step):
- admin = Group.objects.create(name='mics_admin')
- world.user = User.objects.create_user('rajni', 'Rajni@kant.com', 'I_Rock')
- admin.user_set.add(world.user)
- set_permissions(admin, ['can_view_aggregates', 'can_view_households',
- 'can_view_batches', 'can_view_investigators', 'can_view_users'])
-
-
-@step(u'Then I should all tabs')
-def then_i_should_all_tabs(step):
- world.page.check_all_tabs()
-
-
-@step(u'Then I should not see notify investigators drop-down')
-def then_i_should_not_see_notify_investigators_drop_down(step):
- world.page.check_notify_investigators_drop_down_is_not_present()
diff --git a/survey/features/permissions.feature b/survey/features/permissions.feature
deleted file mode 100644
index 10c3e90d..00000000
--- a/survey/features/permissions.feature
+++ /dev/null
@@ -1,33 +0,0 @@
-Feature: Permissions feature
-
- Scenario: Anonymous user tabs
- Given I am an anonymous user
- And I visit the login page
- Then I should see anonymous user allowed tabs
- And I should not be seeing above anonymous user level tabs
-
- Scenario: Data entry Tabs
- Given I have a data entry user
- And And I visit the login page
- And I login that user
- Then I should see data entry allowed tabs
- And I should not be seeing above data entry level tabs
-
- Scenario: Researcher Tabs
- Given I have a researcher user
- And And I visit the login page
- And I login that user
- Then I should see researcher allowed tabs
- And I should not be seeing above researcher level tabs
-
- Scenario: Admin Tabs
- Given I have a admin user
- And And I visit the login page
- And I login that user
- Then I should all tabs
-
- Scenario: Notify investigators
- Given I have a data entry user
- And And I visit the login page
- And I login that user
- Then I should not see notify investigators drop-down
\ No newline at end of file
diff --git a/survey/features/question_module-steps.py b/survey/features/question_module-steps.py
deleted file mode 100644
index 84897ed4..00000000
--- a/survey/features/question_module-steps.py
+++ /dev/null
@@ -1,86 +0,0 @@
-from lettuce import step, world
-from survey.features.page_objects.question_module import QuestionModuleList, NewQuestionModule, EditQuestionModulePage
-from survey.models import QuestionModule
-
-
-@step(u'And I have two question modules')
-def and_i_have_two_question_modules(step):
- world.health_module = QuestionModule.objects.create(name="Health")
- world.education_module = QuestionModule.objects.create(name="Education")
-
-
-@step(u'When I visit the list questions modules page')
-def when_i_visit_the_list_questions_modules_page(step):
- world.page = QuestionModuleList(browser=world.browser)
- world.page.visit()
-
-
-@step(u'Then I should see the questions modules listed')
-def then_i_should_see_the_questions_modules_listed(step):
- fields = [world.health_module.name, world.education_module.name,
- 'Number', 'Module Name', 'Module Lists']
- world.page.validate_fields_present(fields)
-
-
-@step(u'When I visit the create questions module page')
-def when_i_visit_the_create_questions_module_page(step):
- world.page = NewQuestionModule(world.browser)
- world.page.visit()
- world.page.validate_url()
-
-
-@step(u'And I fill in the question module details')
-def and_i_fill_in_the_question_module_details(step):
- world.page.fill_valid_values({'name': 'Education'})
-
-
-@step(u'Then I should see that the question module on the listing page')
-def then_i_should_see_that_the_question_module_on_the_listing_page(step):
- world.page = QuestionModuleList(browser=world.browser)
- fields = ['Education', 'Number', 'Module Name', 'Module Lists']
- world.page.validate_fields_present(fields)
-
-
-@step(u'And I click delete module')
-def and_i_click_delete_module(step):
- world.page.click_by_css("#delete-question-module_%s" %
- world.health_module.id)
-
-
-@step(u'I should see a delete module confirmation modal')
-def i_should_see_a_confirmation_modal(step):
- world.page.see_confirm_modal_message(world.health_module.name)
-
-
-@step(u'When I confirm delete')
-def when_i_confirm_delete(step):
- world.page.click_by_css("#delete-module-%s" % world.health_module.id)
-
-
-@step(u'Then I should see the module was deleted')
-def then_i_should_see_the_module_was_deleted(step):
- world.page.see_success_message("Module", "deleted")
-
-
-@step(u'And I click edit module')
-def and_i_click_edit_module(step):
- world.page.click_by_css("#edit-module_%s" % world.health_module.id)
-
-
-@step(u'I should see a edit module page')
-def i_should_see_a_edit_module_page(step):
- world.page = EditQuestionModulePage(world.browser, world.health_module)
- world.page.validate_url()
-
-
-@step(u'When I fill in valid values')
-def when_i_fill_in_valid_values(step):
- world.page.fill_valid_values({'name': 'Edited Module'})
-
-
-@step(u'Then I should see the edited question module')
-def then_i_should_see_the_edited_question_module(step):
- world.page = QuestionModuleList(world.browser)
- assert not world.page.browser.find_link_by_text(world.health_module.name)
- world.page.is_text_present('Edited Module')
- world.page.see_success_message("Question module", "edited")
diff --git a/survey/features/question_module.feature b/survey/features/question_module.feature
deleted file mode 100644
index 86ba122c..00000000
--- a/survey/features/question_module.feature
+++ /dev/null
@@ -1,33 +0,0 @@
-Feature: Question module
-
- Scenario: List Question modules
- Given I am logged in as researcher
- And I have two question modules
- When I visit the list questions modules page
- Then I should see the questions modules listed
-
- Scenario: Create a Question module
- Given I am logged in as researcher
- When I visit the create questions module page
- And I fill in the question module details
- And I submit the form
- Then I should see that the question module on the listing page
-
- Scenario: Delete a Question module
- Given I am logged in as researcher
- And I have two question modules
- When I visit the list questions modules page
- And I click delete module
- I should see a delete module confirmation modal
- When I confirm delete
- Then I should see the module was deleted
-
- Scenario: Edit a Question module
- Given I am logged in as researcher
- And I have two question modules
- When I visit the list questions modules page
- And I click edit module
- I should see a edit module page
- When I fill in valid values
- And I submit the form
- Then I should see the edited question module
\ No newline at end of file
diff --git a/survey/features/rule_to_batch-steps.py b/survey/features/rule_to_batch-steps.py
deleted file mode 100644
index 3599110f..00000000
--- a/survey/features/rule_to_batch-steps.py
+++ /dev/null
@@ -1,364 +0,0 @@
-from time import sleep
-from lettuce import *
-from survey.features.page_objects.question import BatchQuestionsListPage
-from survey.features.page_objects.rules import AddLogicToBatchQuestionPage
-from survey.models import Question, AnswerRule, BatchQuestionOrder
-from survey.models.question import QuestionOption
-
-
-def save_batch_to_question(question, batch):
- question.batches.add(batch)
- BatchQuestionOrder.objects.create(question=question, batch=batch, order=1)
-
-
-@step(u'And I have a question')
-def and_i_have_a_question(step):
- world.question = Question.objects.create(text="question1", answer_type=Question.NUMBER, order=1,
- group=world.household_member_group, module=world.module, identifier='ID 1')
-
-
-@step(u'And I assign batch to these questions')
-def and_i_assign_batch_to_these_questions(step):
- save_batch_to_question(world.question, world.batch)
-
-
-@step(u'And I visit batches question list page')
-def and_i_visit_batches_question_list_page(step):
- world.page = BatchQuestionsListPage(world.browser, world.batch)
- world.page.visit()
-
-
-@step(u'And I click on add logic link')
-def and_i_click_on_add_logic_link(step):
- sleep(5)
- world.page.click_link_by_text(" Add Logic")
-
-
-@step(u'Then I should see the add logic page')
-def then_i_should_see_the_add_logic_page(step):
- world.page = AddLogicToBatchQuestionPage(
- world.browser, world.batch, world.question)
- world.page.validate_url()
- world.page.validate_fields()
-
-
-@step(u'When I fill in skip rule details')
-def when_i_fill_in_skip_rule_details(step):
- form_data = {'condition': 'EQUALS',
- 'attribute': 'value',
- 'value': '0',
- 'action': 'END_INTERVIEW',
- }
- world.page.fill_valid_values(form_data)
-
-
-@step(u'Then I should see the logic was successfully added to the question')
-def then_i_should_see_the_logic_was_successfully_added_to_the_question(step):
- world.page.see_success_message('Logic', 'added')
-
-
-@step(u'And I assign batch to multichoice question')
-def and_i_assign_batch_to_multichoice_question(step):
- world.question = world.multi_choice_question
- save_batch_to_question(world.question, world.batch)
-
-
-@step(u'And I should see in multichoice if field defaulted to equals option')
-def and_i_should_see_if_field_defaulted_to_equals_option(step):
- form_data = {'condition': 'EQUALS_OPTION'}
- world.page.validate_form_values(form_data)
-
-
-@step(u'And I should see if field is disabled')
-def and_i_should_see_if_field_is_disabled(step):
- assert world.page.is_disabled("id_condition")
-
-
-@step(u'And I should see attribute field defaulted to option')
-def and_i_should_see_attribute_field_defaulted_to_option(step):
- form_data = {'attribute': 'option'}
- world.page.validate_form_values(form_data)
-
-
-@step(u'And I should see attribute field is disabled')
-def and_i_should_see_attribute_field_is_disabled(step):
- assert world.page.is_disabled("id_attribute")
-
-
-@step(u'And I should see dropdown of all available options')
-def and_i_should_see_dropdown_of_all_available_options(step):
- options = [option.text for option in QuestionOption.objects.filter(
- question=world.question)]
- world.page.see_select_option(options, 'option')
-
-
-@step(u'And I should not see value text box and questions dropdown')
-def and_i_should_not_see_value_text_box_and_questions_dropdown(step):
- world.page.field_not_present('value')
- world.page.field_not_present('validate_with_question')
-
-
-@step(u'When I select option from dropdown')
-def when_i_select_option_from_dropdown(step):
- world.page.select('option', [world.option1.id])
-
-
-@step(u'And I select skip to from then field')
-def and_i_select_skip_to_from_then_field(step):
- world.page.select('action', ['SKIP_TO'])
-
-
-@step(u'Then I should see field for next question next to the then field')
-def then_i_should_see_field_for_next_question_next_to_the_then_field(step):
- assert world.page.field_is_visible('next_question')
-
-
-@step(u'When I select end interview from then field')
-def when_i_select_end_interview_from_then_field(step):
- world.page.select('action', ['END_INTERVIEW'])
-
-
-@step(u'Then I should not see field for next question next to the then field')
-def then_i_should_not_see_field_for_next_question_next_to_the_then_field(step):
- assert not world.page.field_is_visible('next_question')
-
-
-@step(u'And I should see if field defaulted to equals')
-def and_i_should_see_if_field_defaulted_to_equals(step):
- form_data = {'condition': 'EQUALS'}
- world.page.validate_form_values(form_data)
-
-
-@step(u'And I should see if field is not disabled')
-def and_i_should_see_if_field_is_not_disabled(step):
- assert not world.page.is_disabled("id_condition")
-
-
-@step(u'And I should also have all other conditions in the dropdown')
-def and_i_should_also_have_all_other_conditions_in_the_dropdown(step):
- condition_options = ['> QUESTION RESPONSE', '> VALUE', '< QUESTION RESPONSE', '< VALUE',
- 'EQUALS']
- world.page.see_select_option(condition_options, 'condition')
-
-
-@step(u'And I should see attribute field defaulted to value')
-def and_i_should_see_attribute_field_defaulted_to_value(step):
- form_data = {'attribute': 'value'}
- world.page.validate_form_values(form_data)
-
-
-@step(u'And I should also have question in the attribute field dropdown')
-def and_i_should_also_have_question_in_the_attribute_field_dropdown(step):
- world.page.see_select_option(['Value', 'Question'], 'attribute')
-
-
-@step(u'And I should see attribute field is not disabled')
-def and_i_should_see_attribute_field_is_not_disabled(step):
- assert not world.page.is_disabled("id_attribute")
-
-
-@step(u'And I should see value text field')
-def and_i_should_see_value_text_field(step):
- world.browser.find_by_name('value')
- assert world.page.field_is_visible('value')
-
-
-@step(u'And I should not see option dropdown box and questions dropdown')
-def and_i_should_not_see_option_dropdown_box_and_questions_dropdown(step):
- world.page.field_not_present('option')
- assert not world.page.field_is_visible('validate_with_question')
-
-
-@step(u'When I select question option from dropdown')
-def when_i_select_question_option_from_dropdown(step):
- world.page.select('attribute', ['validate_with_question'])
-
-
-@step(u'Then I should see questions dropdown')
-def then_i_should_see_questions_dropdown(step):
- assert world.page.field_is_visible('validate_with_question')
-
-
-@step(u'And I should not see option dropdown box and value text box')
-def and_i_should_not_see_option_dropdown_box_and_value_text_box(step):
- world.page.field_not_present('option')
- assert not world.page.field_is_visible('value')
-
-
-@step(u'And I should see all the action dropdown options')
-def and_i_should_see_all_the_action_dropdown_options(step):
- action_options = ['RECONFIRM', 'END INTERVIEW',
- 'ASK SUBQUESTION', 'SKIP TO']
- world.page.see_select_option(action_options, 'action')
-
-
-@step(u'And I have two subquestions for this question')
-def and_i_have_two_subquestions_for_this_question(step):
- world.sub_question1 = Question.objects.create(text="sub question1", answer_type=Question.NUMBER, subquestion=True,
- parent=world.question, identifier='ID 2')
- world.sub_question2 = Question.objects.create(text="sub question2", answer_type=Question.NUMBER, subquestion=True,
- parent=world.question, identifier='ID 3')
- world.sub_question1.batches.add(world.batch)
- world.sub_question2.batches.add(world.batch)
-
-
-@step(u'When I select ask subquestion from then field')
-def when_i_select_ask_subquestion_from_then_field(step):
- world.page.select('action', ['ASK_SUBQUESTION'])
-
-
-@step(u'Then I should see next question populated with subquestions')
-def then_i_should_see_next_question_populated_with_subquestions(step):
- next_question_options = [
- world.sub_question1.text, world.sub_question2.text]
- world.page.see_select_option(next_question_options, 'next_question')
-
-
-@step(u'Then I should see add subquestion button')
-def then_i_should_see_add_subquestion_button(step):
- world.page.find_link_by_text("Add Subquestion")
-
-
-@step(u'When I click add subquestion button')
-def when_i_click_add_subquestion_button(step):
- world.page.click_link_by_partial_href("#add_sub_question_modal")
-
-
-@step(u'Then I should see a modal for add subquestion')
-def then_i_should_see_a_modal_for_add_subquestion(step):
- world.page.validate_fields_present(
- ["New Sub Question", "Text", "Group", "Answer type"])
-
-
-@step(u'When I fill the subquestion details')
-def when_i_fill_the_subquestion_details(step):
- world.data = {'text': 'hritik question',
- 'answer_type': Question.NUMBER,
- 'identifier': 'Q234'}
-
- world.page.fill_valid_values(world.data)
-
-
-@step(u'And I click save question button on the form')
-def and_i_click_save_question_button_on_the_form(step):
- world.page.click_by_css('#modal_sub_question_button')
-
-
-@step(u'Then I should see the recent subquestion in next question dropdown')
-def then_i_should_see_the_recent_subquestion_in_next_question_dropdown(step):
- sleep(2)
- world.page.see_select_option(world.data['text'], 'next_question')
-
-
-@step(u'And I should not see the add subquestion button')
-def and_i_should_not_see_the_add_subquestion_button(step):
- assert not world.page.field_is_visible("add_subquestion_button")
-
-
-@step(u'And I should not the add subquestion button')
-def and_i_should_not_the_add_subquestion_button(step):
- assert world.page.field_is_visible("add_subquestion_button")
-
-
-@step(u'When I select greater than value from the drop down')
-def when_i_select_greater_than_value_from_the_drop_down(step):
- world.page.select('condition', ['GREATER_THAN_VALUE'])
-
-
-@step(u'Then I should see attribute field defaulted to value')
-def then_i_should_see_attribute_field_defaulted_to_value(step):
- form_data = {'attribute': 'value'}
- world.page.validate_form_values(form_data)
-
-
-@step(u'And I should not see question in the attribute')
-def and_i_should_not_see_question_in_the_attribute(step):
- world.page.option_not_present(['Question'], 'attribute')
-
-
-@step(u'When I select less than value from the drop down')
-def when_i_select_less_than_value_from_the_drop_down(step):
- world.page.select('condition', ['LESS_THAN_VALUE'])
-
-
-@step(u'When I select greater than question from the drop down')
-def when_i_select_greater_than_question_from_the_drop_down(step):
- world.page.select('condition', ['GREATER_THAN_QUESTION'])
-
-
-@step(u'Then I should see attribute field defaulted to question')
-def then_i_should_see_attribute_field_defaulted_to_question(step):
- form_data = {'attribute': 'validate_with_question'}
- world.page.validate_form_values(form_data)
-
-
-@step(u'And I should not see value in the attribute')
-def and_i_should_not_see_value_in_the_attribute(step):
- world.page.option_not_present(['Value'], 'attribute')
-
-
-@step(u'When I select less than question from the drop down')
-def when_i_select_less_than_question_from_the_drop_down(step):
- world.page.select('condition', ['LESS_THAN_QUESTION'])
-
-
-@step(u'When I select equals from drop down')
-def when_i_select_equals_from_drop_down(step):
- world.page.select('condition', ['EQUALS'])
-
-
-@step(u'And I should see question in the attribute')
-def and_i_should_see_question_in_the_attribute(step):
- world.page.see_select_option(['Question'], 'attribute')
-
-
-@step(u'And I have a subquestion under this question')
-def and_i_have_a_subquestion_under_this_question(step):
- world.sub_question = Question.objects.create(subquestion=True, parent=world.question,
- text="this is a subquestion", identifier='ID 4')
-
-
-@step(u'When I fill the duplicate subquestion details')
-def when_i_fill_the_duplicate_subquestion_details(step):
- world.page.fill_valid_values({'text': world.sub_question.text,
- 'identifier': world.sub_question.identifier})
- world.page.select('group', [world.household_member_group.pk])
- world.page.select('answer_type', [Question.NUMBER])
-
-
-@step(u'And I should see error on the form text field')
-def and_i_should_see_error_on_the_form_text_field(step):
- sleep(5)
- world.page.is_text_present(
- "Sub question for this question with this text already exists.")
-
-
-@step(u'When I refill the form with valid values')
-def when_i_refill_the_form_with_valid_values(step):
- world.data = {
- 'text': world.sub_question.text + "edited text",
- 'answer_type': Question.NUMBER,
- 'identifier': 'ID 5',
- 'group': world.household_member_group.pk
- }
- world.page.fill_valid_values(
- {'text': world.data['text'], 'identifier': world.data['identifier']})
- world.page.select('group', [world.data['group']])
- world.page.select('answer_type', [world.data['answer_type']])
-
-
-@step(u'And I should see already existing logic for the question')
-def and_i_should_see_already_existing_logic_for_the_question(step):
- world.page.validate_fields_present(
- [world.question.text, "Eligibility Criteria", "Question/Value/Option", "Action"])
-
-
-@step(u'When I select between from the drop down')
-def when_i_select_between_from_the_drop_down(step):
- world.page.select('condition', ['BETWEEN'])
-
-
-@step(u'And I should see two text fields for min and max value')
-def and_i_should_see_two_text_fields_for_min_and_max_value(step):
- assert world.browser.find_by_css('#id_min_value')
- assert world.browser.find_by_css('#id_max_value')
diff --git a/survey/features/rules_to_batch.feature b/survey/features/rules_to_batch.feature
deleted file mode 100644
index f338e533..00000000
--- a/survey/features/rules_to_batch.feature
+++ /dev/null
@@ -1,158 +0,0 @@
-Feature: Batch related features
-
- Scenario: Add new answer rule to batch question
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I have a member group
- And I have a module
- And I have a question
- And I assign batch to these questions
- And I visit batches question list page
- And I click on add logic link
- Then I should see the add logic page
- And I should see already existing logic for the question
- When I fill in skip rule details
- And I submit the form
- Then I should see the logic was successfully added to the question
-
- Scenario: Add answer rule to multichoice question - Javascript
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I have a module
- And I have a member group
- And I have a multichoice question
- And I assign batch to multichoice question
- And I visit batches question list page
- And I click on add logic link
- Then I should see the add logic page
- And I should see in multichoice if field defaulted to equals option
- And I should see if field is disabled
- And I should see attribute field defaulted to option
- And I should see attribute field is disabled
- And I should see dropdown of all available options
- And I should not see value text box and questions dropdown
- When I select option from dropdown
- And I select skip to from then field
- Then I should see field for next question next to the then field
- When I select end interview from then field
- Then I should not see field for next question next to the then field
-
- Scenario: Add answer rule to question which is not multichoice - Javascript
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I have a member group
- And I have a module
- And I have a question
- And I assign batch to these questions
- And I visit batches question list page
- And I click on add logic link
- Then I should see the add logic page
- And I should see if field defaulted to equals
- And I should see if field is not disabled
- And I should also have all other conditions in the dropdown
- And I should see attribute field defaulted to value
- And I should also have question in the attribute field dropdown
- And I should see attribute field is not disabled
- And I should see value text field
- When I select greater than value from the drop down
- Then I should see attribute field defaulted to value
- And I should not see question in the attribute
- When I select less than value from the drop down
- Then I should see attribute field defaulted to value
- And I should not see question in the attribute
- When I select greater than question from the drop down
- Then I should see attribute field defaulted to question
- And I should not see value in the attribute
- When I select less than question from the drop down
- Then I should see attribute field defaulted to question
- And I should not see value in the attribute
- When I select equals from drop down
- And I should see attribute field defaulted to value
- And I should see question in the attribute
- And I should not see option dropdown box and questions dropdown
- When I select question option from dropdown
- Then I should see questions dropdown
- And I should not see option dropdown box and value text box
- And I should see all the action dropdown options
-
- Scenario: Add Between condition- Javascript
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I have a member group
- And I have a module
- And I have a question
- And I assign batch to these questions
- And I visit batches question list page
- And I click on add logic link
- Then I should see the add logic page
- When I select between from the drop down
- Then I should see attribute field defaulted to value
- And I should not see question in the attribute
- And I should see two text fields for min and max value
- And I should not see option dropdown box and value text box
-
-
- Scenario: add rule ask subquestion to a question
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I have a member group
- And I have a module
- And I have a question
- And I assign batch to these questions
- And I have two subquestions for this question
- And I visit batches question list page
- And I click on add logic link
- Then I should see the add logic page
- And I should not see the add subquestion button
- When I select ask subquestion from then field
- Then I should see next question populated with subquestions
- And I should not the add subquestion button
-
- Scenario: Add subquestion modal
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I have a member group
- And I have a module
- And I have a question
- And I assign batch to these questions
- And I visit batches question list page
- And I click on add logic link
- Then I should see the add logic page
- When I select ask subquestion from then field
- Then I should see add subquestion button
- When I click add subquestion button
- Then I should see a modal for add subquestion
- And I click save question button on the form
- Then I should see field required error message
- When I fill the subquestion details
- And I click save question button on the form
- Then I should see the recent subquestion in next question dropdown
-
- Scenario: Add duplicate subquestion on modal
- Given I am logged in as researcher
- And I have a survey
- And I have a batch
- And I have a member group
- And I have a module
- And I have a question
- And I assign batch to these questions
- And I have a subquestion under this question
- And I visit batches question list page
- And I click on add logic link
- Then I should see the add logic page
- When I select ask subquestion from then field
- Then I should see add subquestion button
- When I click add subquestion button
- Then I should see a modal for add subquestion
- When I fill the duplicate subquestion details
- And I click save question button on the form
- And I should see error on the form text field
- When I refill the form with valid values
- And I click save question button on the form
- Then I should see the recent subquestion in next question dropdown
\ No newline at end of file
diff --git a/survey/features/simple_indicator_chart.feature b/survey/features/simple_indicator_chart.feature
deleted file mode 100644
index c5c5c584..00000000
--- a/survey/features/simple_indicator_chart.feature
+++ /dev/null
@@ -1,27 +0,0 @@
-Feature: Simple indicator results
-
- Background:
- Given I am logged in as researcher
- And I have a survey
- And I have three batches
- And I have two modules
-
- Scenario: Simple Indicator - Transition from List to analysis
- And I have regions and districts
- And I have investigators in those districts
- And I have households in in those districts
- And I have a multichoice question
- And I have an indicator in that survey
- And I have responses for that question
- Given I am on the indicator listing page
- And I click the analysis link of the indicator
- Then I should see indicator result page
- And I should see indicator graph for the country
- And I should see indicator data table for the country
-
- Scenario: Simple Indicator - Transition from List to analysis when no formula is added
- And I have regions and districts
- And I have an indicator with out a formula
- Given I am on the indicator listing page
- And I click that indicators analysis link
- Then I should see indicator has no formula message
\ No newline at end of file
diff --git a/survey/features/simple_indicator_chart_step.py b/survey/features/simple_indicator_chart_step.py
deleted file mode 100644
index 95637e34..00000000
--- a/survey/features/simple_indicator_chart_step.py
+++ /dev/null
@@ -1,185 +0,0 @@
-from random import randint
-from lettuce import *
-from survey.models.locations import *
-from survey.features.page_objects.indicators import ListIndicatorPage, SimpleIndicatorGraphPage
-from survey.models import HouseholdMemberGroup, Indicator, LocationTypeDetails, EnumerationArea
-from survey.models.households import HouseholdHead, Household
-from survey.models.backend import Backend
-from survey.models.interviewer import Interviewer
-from survey.models.formula import *
-from survey.models.questions import Question, QuestionOption
-
-
-def create_household_head(uid, investigator, household_listing, survey_householdlisting):
- household = Household.objects.create(house_number=uid, listing=household_listing, physical_address='Test address' + str(randint(1, 9999)),
- last_registrar=investigator, registration_channel="ODK Access", head_desc="Head", head_sex='MALE')
- return HouseholdHead.objects.create(surname="sur" + str(randint(1, 9999)), first_name='fir' + str(randint(1, 9999)), gender='MALE', date_of_birth="1988-01-01",
- household=household, survey_listing=survey_householdlisting,
- registrar=investigator, registration_channel="ODK Access",
- occupation="Agricultural labor", level_of_education="Primary",
- resident_since='1989-02-02')
-
-
-@step(u'And I have regions and districts')
-def and_i_have_regions_and_districts(step):
- world.country = LocationType.objects.create(name='Country', slug='country')
- world.region = LocationType.objects.create(name='Region', slug='region')
- world.district = LocationType.objects.create(
- name='District', slug='district')
- world.village = LocationType.objects.create(name='Village', slug='village')
-
- world.uganda = Location.objects.create(name="Uganda", type=world.country)
-
- LocationTypeDetails.objects.create(
- location_type=world.country, country=world.uganda)
- LocationTypeDetails.objects.create(
- location_type=world.region, country=world.uganda)
- LocationTypeDetails.objects.create(
- location_type=world.district, country=world.uganda)
- LocationTypeDetails.objects.create(
- location_type=world.village, country=world.uganda)
-
- world.west = Location.objects.create(
- name="WEST", type=world.region, tree_parent=world.uganda)
- world.central = Location.objects.create(
- name="CENTRAL", type=world.region, tree_parent=world.uganda)
- world.kampala = Location.objects.create(
- name="Kampala", tree_parent=world.central, type=world.district)
- world.mbarara = Location.objects.create(
- name="Mbarara", tree_parent=world.west, type=world.district)
-
- world.kibungo = Location.objects.create(
- name="Kibungo", type=world.district, tree_parent=world.west)
- world.mpigi = Location.objects.create(
- name="Mpigi", type=world.district, tree_parent=world.central)
-
- world.ea = EnumerationArea.objects.get_or_create(name="EA")[0]
- world.ea.locations.add(world.kampala)
-
- world.ea_mbarara = EnumerationArea.objects.get_or_create(name="EA2")[0]
- world.ea_mbarara.locations.add(world.mbarara)
-
-
-@step(u'And I have an indicator in that survey')
-def and_i_have_an_indicator_in_that_survey(step):
- world.indicator = Indicator.objects.create(name="ITN 1.23", description="rajni indicator",
- measure='Percentage',
- batch=world.batch_1, module=world.health_module_1)
-
- world.formula = Formula.objects.create(
- count=world.question_3, indicator=world.indicator)
-
-
-@step(u'And I have a multichoice question')
-def and_i_have_a_multichoice_question(step):
- world.member_group = HouseholdMemberGroup.objects.create(
- name="GENERAL", order=1)
- world.question_3 = Question.objects.create(text="This is a question", module=world.health_module_1,
- answer_type=Question.MULTICHOICE, order=3, group=world.member_group)
-
- world.yes_option = QuestionOption.objects.create(
- question=world.question_3, text="Yes", order=1)
- world.no_option = QuestionOption.objects.create(
- question=world.question_3, text="No", order=2)
- world.question_3.batches.add(world.batch_1)
- BatchQuestionOrder.objects.create(
- question=world.question_3, batch=world.batch_1, order=1)
-
-
-@step(u'And I have households in in those districts')
-def and_i_have_households_in_in_those_districts(step):
- world.household_head_1 = create_household_head(0, world.investigator)
- world.household_head_2 = create_household_head(1, world.investigator)
- world.household_head_3 = create_household_head(2, world.investigator)
- world.household_head_4 = create_household_head(3, world.investigator)
- world.household_head_5 = create_household_head(4, world.investigator)
-
- world.household_head_6 = create_household_head(5, world.investigator_2)
- world.household_head_7 = create_household_head(6, world.investigator_2)
- world.household_head_8 = create_household_head(7, world.investigator_2)
- world.household_head_9 = create_household_head(8, world.investigator_2)
-
-
-@step(u'And I have investigators in those districts')
-def and_i_have_investigators_in_those_districts(step):
- backend = Backend.objects.create(name="Backend")
- world.investigator = Investigator.objects.create(name="Investigator 1", mobile_number="1", ea=world.ea,
- backend=backend)
- world.investigator_2 = Investigator.objects.create(name="Investigator 1", mobile_number="33331",
- ea=world.ea_mbarara,
- backend=backend)
-
-
-@step(u'And I have responses for that question')
-def and_i_have_responses_for_that_question(step):
- world.investigator.member_answered(
- world.question_3, world.household_head_1, world.yes_option.order, world.batch_1)
- world.investigator.member_answered(
- world.question_3, world.household_head_2, world.yes_option.order, world.batch_1)
- world.investigator.member_answered(
- world.question_3, world.household_head_3, world.yes_option.order, world.batch_1)
- world.investigator.member_answered(
- world.question_3, world.household_head_4, world.no_option.order, world.batch_1)
- world.investigator.member_answered(
- world.question_3, world.household_head_5, world.no_option.order, world.batch_1)
-
- world.investigator_2.member_answered(
- world.question_3, world.household_head_6, world.yes_option.order, world.batch_1)
- world.investigator_2.member_answered(
- world.question_3, world.household_head_7, world.yes_option.order, world.batch_1)
- world.investigator_2.member_answered(
- world.question_3, world.household_head_8, world.no_option.order, world.batch_1)
- world.investigator_2.member_answered(
- world.question_3, world.household_head_9, world.no_option.order, world.batch_1)
-
-
-@step(u'Given I am on the indicator listing page')
-def given_i_am_on_the_indicator_listing_page(step):
- world.page = ListIndicatorPage(world.browser)
- world.page.visit()
-
-
-@step(u'And I click the analysis link of the indicator')
-def and_i_click_the_analysis_link_of_the_indicator(step):
- world.page.click_by_css("#analyse-indicator_%s" % world.indicator.id)
-
-
-@step(u'Then I should see indicator result page')
-def then_i_should_see_indicator_result_page(step):
- world.page = SimpleIndicatorGraphPage(world.browser, world.indicator)
- world.page.validate_url()
-
-
-@step(u'And I should see indicator graph for the country')
-def and_i_should_see_indicator_graph_for_the_country(step):
- world.page.validate_fields_present(
- ['Yes', 'No', '%s Count per %s' % (world.indicator.name, world.region.name)])
-
-
-@step(u'And I should see indicator data table for the country')
-def and_i_should_see_indicator_data_table_for_the_country(step):
- world.page.validate_fields_present(
- [world.region.name, world.district.name, world.yes_option.text, world.no_option.text, 'Total'])
-
- central_tabulated_data_results = ['3', '2', '5']
- west_tabulated_data_results = ['2', '2', '4']
- world.page.validate_fields_present(central_tabulated_data_results)
- world.page.validate_fields_present(west_tabulated_data_results)
-
-
-@step(u'And I have an indicator with out a formula')
-def and_i_have_an_indicator_with_out_a_formula(step):
- world.indicator_with_no_formula = Indicator.objects.create(name="ITN 1.23", description="rajni indicator",
- measure='Percentage',
- batch=world.batch_1, module=world.health_module_1)
-
-
-@step(u'Then I should see indicator has no formula message')
-def then_i_should_see_indicator_has_no_formula_message(step):
- world.page.see_message("No formula was found in this indicator")
-
-
-@step(u'And I click that indicators analysis link')
-def and_i_click_that_indicators_analysis_link(step):
- world.page.click_by_css("#analyse-indicator_%s" %
- world.indicator_with_no_formula.id)
diff --git a/survey/features/survey.feature b/survey/features/survey.feature
deleted file mode 100644
index 03630ac3..00000000
--- a/survey/features/survey.feature
+++ /dev/null
@@ -1,55 +0,0 @@
-Feature: Survey features
-
- Scenario: List survey page
- Given I am logged in as researcher
- And I have 100 surveys
- And I visit surveys listing page
- Then I should see the survey list paginated
- And when I click on add batch action for first survey
- Then I should go to add batch page
-
- Scenario: Link to batch list
- Given I am logged in as researcher
- And I have a survey
- And I visit surveys listing page
- And I click on a survey name
- Then I should see a list of the batches under the survey
-
- Scenario: Add a survey
- Given I am logged in as researcher
- And I visit the new survey page
- When I fill in the survey details
- And I click save button
- Then I should see that the survey was saved successfully
-
- Scenario: Add survey modal
- Given I am logged in as researcher
- And I visit surveys listing page
- And I click on create new survey button
- Then I should see the create new survey modal
- When I fill in the survey details
- And I click the modal save button
- Then I should see that the survey was saved successfully
-
- Scenario: Edit a survey
- Given I am logged in as researcher
- And I have a survey
- And I visit surveys listing page
- And I click on edit link for this survey
- Then I should see the edit survey page
- When I fill in the survey details
- And I submit the form
- Then I should see that the survey was edited successfully
-
- Scenario: Delete a survey
- Given I am logged in as researcher
- And I have a survey
- And I visit surveys listing page
- And I click on delete link for this survey
- Then I should see confirm delete survey
- And if I click yes
- Then I should go back to survey listing page
- And I should see that the survey was deleted successfully
-
-
-
diff --git a/survey/features/survey_steps.py b/survey/features/survey_steps.py
deleted file mode 100644
index ba9d5a9e..00000000
--- a/survey/features/survey_steps.py
+++ /dev/null
@@ -1,153 +0,0 @@
-from random import randint
-
-from lettuce import *
-from survey.features.page_objects.batches import BatchListPage, AddBatchPage
-from survey.models.surveys import Survey
-from survey.features.page_objects.surveys import SurveyListPage, AddSurveyPage, EditSurveyPage
-
-
-@step(u'And I visit surveys listing page')
-def and_i_visit_surveys_listing_page(step):
- world.page = SurveyListPage(world.browser)
- world.page.visit()
-
-
-@step(u'And I have 100 surveys')
-def and_i_have_100_surveys(step):
- world.survey = list()
- for i in xrange(100):
- try:
- world.survey.append(Survey.objects.create(name='survey %d' % i, description='survey descrpition %d' % i,
- type=(True if i % 2 else False), sample_size=i))
- except Exception:
- pass
-
-
-@step(u'Then I should see the survey list paginated')
-def then_i_should_see_the_survey_list_paginated(step):
- world.page.validate_fields()
- world.page.validate_pagination()
- world.page.validate_fields()
-
-
-@step(u'And if I click the add survey button')
-def and_if_i_click_the_add_survey_button(step):
- world.page.click_link_by_text("Create New Survey")
-
-
-@step(u'Then I should see the new survey form')
-def then_i_should_see_the_new_survey_form(step):
- world.page = AddSurveyPage(world.browser)
- world.page.validate_url()
- world.page.validate_fields_present(
- ["New Survey", "Name", "Description", "Type", "Number of Households"])
-
-
-@step(u'And I visit the new survey page')
-def and_i_visit_the_new_survey_page(step):
- world.page = AddSurveyPage(world.browser)
- world.page.visit()
-
-
-@step(u'When I fill in the survey details')
-def when_i_fill_in_the_survey_details(step):
- world.data = {'name': 'survey rajni',
- 'description': 'survey description rajni',
- 'sample_size': 10,
- 'type': True,
- }
- world.page.fill_valid_values(world.data)
-
-
-@step(u'And I select the questions')
-def and_i_select_the_questions(step):
- world.page.select_multiple('#id_questions', world.question)
-
-
-@step(u'Then I should see that the survey was saved successfully')
-def then_i_should_see_that_the_survey_was_saved_successfully(step):
- world.page.see_success_message('Survey', 'added')
-
-
-@step(u'And I have a survey')
-def and_i_have_a_survey(step):
- world.survey = Survey.objects.create(
- name='survey name', description='survey descrpition', type=False, sample_size=10)
-
-
-@step(u'And I click on a survey name')
-def and_i_click_on_a_survey_name(step):
- world.page.click_link_by_text(world.survey.name)
-
-
-@step(u'Then I should see a list of the batches under the survey')
-def then_i_should_see_a_list_of_the_batches_under_the_survey(step):
- world.page = BatchListPage(world.browser, world.survey)
- world.page.validate_url()
-
-
-@step(u'And I click on create new survey button')
-def and_i_click_on_create_new_survey_button(step):
- world.page.click_link_by_partial_href("#new_survey")
-
-
-@step(u'Then I should see the create new survey modal')
-def then_i_should_see_the_create_new_survey_modal(step):
- world.page.validate_fields_present(
- ["New Survey", "Name", "Description", "Type", "Number of Households"])
-
-
-@step(u'And I click the modal save button')
-def and_i_click_the_modal_save_button(step):
- world.page.click_button("save_button")
-
-
-@step(u'And when I click on add batch action for first survey')
-def and_when_i_click_on_add_batch_action_for_first_survey(step):
- world.page = SurveyListPage(world.browser)
- world.page.visit()
- world.page.click_by_css(".add_batch")
-
-
-@step(u'Then I should go to add batch page')
-def then_i_should_go_to_add_batch_page(step):
- world.page = AddBatchPage(world.browser, world.survey[0])
- world.page.validate_url()
-
-
-@step(u'And I click on edit link for this survey')
-def and_i_click_on_edit_link_for_this_survey(step):
- world.page.click_link_by_text(" Edit")
-
-
-@step(u'Then I should see the edit survey page')
-def then_i_should_see_the_edit_survey_page(step):
- world.page = EditSurveyPage(world.browser, world.survey)
- world.page.validate_url()
-
-
-@step(u'Then I should see that the survey was edited successfully')
-def then_i_should_see_that_the_survey_was_edited_successfully(step):
- world.page.is_text_present(world.data['name'])
- world.page.see_success_message("Survey", "edited")
-
-
-@step(u'And I click on delete link for this survey')
-def and_i_click_on_delete_link_for_this_survey(step):
- world.page.click_link_by_text(" Delete")
-
-
-@step(u'Then I should go back to survey listing page')
-def then_i_should_go_back_to_survey_listing_page(step):
- world.page = SurveyListPage(world.browser)
- world.page.validate_url()
-
-
-@step(u'And I should see that the survey was deleted successfully')
-def and_i_should_see_that_the_survey_was_deleted_successfully(step):
- world.page.see_success_message("Survey", "deleted")
-
-
-@step(u'Then I should see confirm delete survey')
-def then_i_should_see_confirm_delete_survey(step):
- world.page.see_confirm_modal_message(world.survey.name)
diff --git a/survey/features/upload_location-steps.py b/survey/features/upload_location-steps.py
deleted file mode 100644
index 0549a006..00000000
--- a/survey/features/upload_location-steps.py
+++ /dev/null
@@ -1,154 +0,0 @@
-# -*- coding: utf-8 -*-
-import csv
-from time import sleep
-from django.contrib.auth.models import Group, User, Permission
-from django.contrib.contenttypes.models import ContentType
-from lettuce import step, world
-from rapidsms.contrib.locations.models import LocationType
-from survey.features.page_objects.accounts import LoginPage
-from survey.features.page_objects.location_hierarchy import AddLocationHierarchyPage
-from survey.features.page_objects.uploads import UploadLocationsPage
-from survey.models import LocationTypeDetails
-from survey.tests.base_test import BaseTest
-
-
-def set_permissions(group, permissions_codename_list):
- auth_content = ContentType.objects.get_for_model(Permission)
- for codename in permissions_codename_list:
- permission, out = Permission.objects.get_or_create(
- codename=codename, content_type=auth_content)
- group.permissions.add(permission)
-
-
-def create_admin():
- admin = Group.objects.create(name='mics_admin')
- user = User.objects.create_user('rajni', 'Rajni@kant.com', 'I_Rock')
- admin.user_set.add(user)
- set_permissions(admin, ['can_view_aggregates', 'can_view_households', 'can_view_batches',
- 'can_view_investigators', 'can_view_users', 'can_add_location_types'])
-
- return user
-
-
-@step(u'Given I am logged in as admin')
-def given_i_am_logged_in_as_admin(step):
- user = create_admin()
- world.page = LoginPage(world.browser)
- world.page.visit()
- world.page.login(user)
-
-
-@step(u'When I visit upload locations page')
-def and_i_visit_upload_locations_page(step):
- world.page = UploadLocationsPage(world.browser)
- world.page.visit()
-
-
-@step(u'And I have location type and location details objects')
-def and_i_have_location_type_and_location_details_objects(step):
- world.location_type1 = LocationType.objects.create(
- name='type1', slug='type1')
- world.location_type_details1 = LocationTypeDetails.objects.create(required=False, has_code=True,
- location_type=world.location_type1,
- length_of_code=3, country=world.country)
-
- world.location_type2 = LocationType.objects.create(
- name='type2', slug='type2')
- world.location_type_details2 = LocationTypeDetails.objects.create(
- required=False, has_code=False, location_type=world.location_type2, country=world.country)
-
-
-@step(u'Then I should see the page title')
-def then_i_should_see_the_text_message(step):
- world.page.is_text_present('Upload Geographical Locations')
-
-
-@step(u'And I should see name of the country for which details were added')
-def and_i_should_see_name_of_the_country_for_which_details_were_added(step):
- world.page.find_by_css('#id_country', world.country.name)
-
-
-@step(u'And I should see link for input file format')
-def and_i_should_see_link_for_input_file_format(step):
- world.page.find_link_by_text("Location Input File Format")
-
-
-@step(u'When I click on the link for input file format')
-def when_i_click_on_the_link_for_input_file_format(step):
- sleep(3)
- world.page.click_link_by_partial_href('#collapse_table')
-
-
-@step(u'Then I should see table of all location types')
-def then_i_should_see_table_of_all_location_types(step):
- world.page.is_text_present(
- world.location_type1.name.capitalize() + 'Name', True)
- world.page.is_text_present(
- world.location_type2.name.capitalize() + 'Name', True)
-
-
-@step(u'And Type code should be in front of any type that has code')
-def and_type_code_should_be_in_front_of_any_type_that_has_code(step):
- world.page.validate_typecode_appear_before_typename(world.location_type1.name,
- world.location_type_details1.length_of_code)
- world.page.is_text_present(
- world.location_type2.name.capitalize() + 'Code', False)
-
-
-@step(u'Then Table should collapse')
-def then_table_should_collapse(step):
- sleep(3)
- world.page.is_text_present(
- world.location_type1.name.capitalize() + 'Name', False)
- world.page.is_text_present(
- world.location_type2.name.capitalize() + 'Name', False)
-
-
-@step(u'Then I should see no hierarchy message')
-def then_i_should_see_no_hierarchy_message(step):
- world.page.is_text_present('No location hierarchy added yet.')
-
-
-@step(u'And I should see the button to add hierarchy')
-def and_i_should_see_the_button_to_add_hierarchy(step):
- world.page.find_by_name('add_hierarchy')
-
-
-@step(u'When I click on add hierarchy button')
-def when_i_click_on_add_hierarchy_button(step):
- world.page.click_by_name('add_hierarchy')
-
-
-@step(u'And I should go to add hierarchy page')
-def and_i_should_go_to_add_hierarchy_page(step):
- world.page = AddLocationHierarchyPage(world.browser)
- world.page.validate_url()
-
-
-@step(u'When I have a csv locations file')
-def when_i_have_a_csv_locations_file(step):
- data = [[world.location_type1.name + 'Code', world.location_type1.name + 'Name', world.location_type2.name + 'Name'],
- ['001', 'district1', 'county1'],
- ['003', 'district2', 'county2']]
- write_to_csv('wb', data, 'test.csv')
-
-
-def write_to_csv(mode, data, csvfilename):
- with open(csvfilename, mode) as fp:
- file = csv.writer(fp, delimiter=',')
- file.writerows(data)
-
-
-@step(u'And I input that file')
-def and_i_input_that_file(step):
- world.page.input_file('test.csv')
-
-
-@step(u'And I click the save button')
-def when_i_click_the_save_button(step):
- world.page.submit()
-
-
-@step(u'Then I should see locations uploads processing')
-def then_i_should_see_locations_successfully_added(step):
- world.page.is_text_present("Upload in progress. This could take a while.")
diff --git a/survey/features/upload_locations.feature b/survey/features/upload_locations.feature
deleted file mode 100644
index 2c66c626..00000000
--- a/survey/features/upload_locations.feature
+++ /dev/null
@@ -1,28 +0,0 @@
-Feature: Location upload
-
- Scenario: Upload locations
- Given I am logged in as admin
- And I have a country
- And I have location type and location details objects
- When I visit upload locations page
- Then I should see the page title
- And I should see name of the country for which details were added
- And I should see link for input file format
- When I click on the link for input file format
- Then I should see table of all location types
- And Type code should be in front of any type that has code
- When I click on the link for input file format
- Then Table should collapse
- When I have a csv locations file
- And I input that file
- And I click the save button
- Then I should see locations uploads processing
-
- Scenario: Upload locations- when no details object present
- Given I am logged in as admin
- And I have a country
- When I visit upload locations page
- Then I should see no hierarchy message
- And I should see the button to add hierarchy
- When I click on add hierarchy button
- And I should go to add hierarchy page
diff --git a/survey/features/user_settings-steps.py b/survey/features/user_settings-steps.py
deleted file mode 100644
index 2260de3a..00000000
--- a/survey/features/user_settings-steps.py
+++ /dev/null
@@ -1,54 +0,0 @@
-from lettuce import *
-from survey.features.page_objects.accounts import ResetPasswordPage
-
-
-@step(u'And I click user settings link')
-def and_i_click_user_settings_link(step):
- world.page.click_user_settings()
-
-
-@step(u'Then I see edit profile, change password and logout link')
-def then_i_see_edit_profile_change_password_and_logout_link(step):
- world.page.assert_user_can_see_profile_and_logout_link()
-
-
-@step(u'Then I click change password link')
-def then_i_click_change_password_link(step):
- world.page.click_reset_password_form()
-
-
-@step(u'Then I should see a form asking me to add old password and new password')
-def then_i_should_see_a_form_asking_me_to_add_old_password_and_new_password(step):
- world.page = ResetPasswordPage(world.browser)
- world.page.visit()
- world.page.is_change_password_form_visble()
-
-
-@step(u'Then I fill in the old password and new password')
-def then_i_fill_in_the_old_password_and_new_password(step):
- world.page.fill('old_password', 'kant')
- world.page.fill('new_password1', 'pass')
- world.page.fill('new_password2', 'pass')
-
-
-@step(u'And I click the change my password button')
-def and_i_click_the_change_my_password_button(step):
- world.page.click_change_password_button()
-
-
-@step(u'Then I should see password reset successfully')
-def then_i_should_see_password_reset_successfully(step):
- world.page.assert_password_successfully_reset()
-
-
-@step(u'Then I fill in the wrong old password and correct new password')
-def then_i_fill_in_the_wrong_old_password_and_correct_new_password(step):
- world.page.fill('old_password', 'kantus')
- world.page.fill('new_password1', 'pass')
- world.page.fill('new_password2', 'pasq')
-
-
-@step(u'Then I should error that my old password is incorrect')
-def then_i_should_error_that_my_old_password_is_incorrect(step):
- world.page.is_incorrect_oldpassword_error_visible()
- world.page.is_password_mismatch()
diff --git a/survey/features/user_settings.feature b/survey/features/user_settings.feature
deleted file mode 100644
index 3d73de39..00000000
--- a/survey/features/user_settings.feature
+++ /dev/null
@@ -1,35 +0,0 @@
-Feature: User Settings feature
-
- Scenario: user settings links
- Given I have a user
- And I visit the login page
- And I login a user
- And I am in the home page
- And I click user settings link
- Then I see edit profile, change password and logout link
-
- Scenario: Change use password
- Given I have a user
- And I visit the login page
- And I login a user
- And I am in the home page
- And I click user settings link
- Then I see edit profile, change password and logout link
- Then I click change password link
- Then I should see a form asking me to add old password and new password
- Then I fill in the old password and new password
- And I click the change my password button
- Then I should see password reset successfully
-
- Scenario: Change user password with errors
- Given I have a user
- And I visit the login page
- And I login a user
- And I am in the home page
- And I click user settings link
- Then I see edit profile, change password and logout link
- Then I click change password link
- Then I should see a form asking me to add old password and new password
- Then I fill in the wrong old password and correct new password
- And I click the change my password button
- Then I should error that my old password is incorrect and password mismatch
\ No newline at end of file
diff --git a/survey/features/users-steps.py b/survey/features/users-steps.py
deleted file mode 100644
index f9774e8f..00000000
--- a/survey/features/users-steps.py
+++ /dev/null
@@ -1,305 +0,0 @@
-from random import randint
-from time import sleep
-
-from lettuce import *
-from django.contrib.auth.models import User, Group
-
-from survey.features.page_objects.accounts import LoginPage, LogoutPage
-from survey.features.page_objects.users import NewUserPage, UsersListPage, EditUserDetailsPage, UserDetailsPage
-from survey.models.users import UserProfile
-
-
-@step(u'Given I am logged in as a superuser')
-def given_i_am_logged_in_as_a_superuser(step):
- world.user = User.objects.create(username='Rajni', email='rajni@kant.com',
- password='I_Rock', first_name='some name', last_name='last_name')
- world.user.is_superuser = True
- world.user.save()
- UserProfile.objects.create(user=world.user, mobile_number='123456666')
- world.page = LoginPage(world.browser)
- world.page.visit()
- world.page.login(world.user)
-
-
-@step(u'And I visit new user page')
-def and_i_visit_new_user_page(step):
- world.page = NewUserPage(world.browser)
- world.page.visit()
-
-
-@step(u'Then I see all new user fields')
-def then_i_see_all_new_user_fields(step):
- world.page.valid_page()
-
-
-@step(u'And I click submit')
-def and_i_click_submit(step):
- world.page.submit()
-
-
-@step(u'And I have a group')
-def and_i_have_a_group(step):
- world.group = Group.objects.create(name="kojo")
-
-
-@step(u'Then I fill all necessary new user fields')
-def then_i_fill_all_necessary_new_user_fields(step):
- world.user_data = {
- 'username': 'babyrajni',
- 'password1': 'baby_kant',
- 'password2': 'baby_kant',
- 'first_name': 'Baby',
- 'last_name': 'Kant',
- 'mobile_number': '123456789',
- 'email': 'baby@ka.nt',
- 'groups': world.group.id,
- }
-
- world.page.fill_valid_values(world.user_data)
-
-
-@step(u'Then I should see user successfully registered')
-def then_i_should_see_user_successfully_registered(step):
- world.page.see_user_successfully_registered()
-
-
-def logout(world):
- world.page = LogoutPage(world.browser)
- world.page.visit()
-
-
-def login(user, world):
- world.page = LoginPage(world.browser)
- world.page.visit()
- world.page.login(user)
-
-
-@step(u'And I can login that user successfully')
-def and_i_can_login_that_user_successfully(step):
- logout(world)
- user = User.objects.get(username=world.user_data['username'])
- login(user, world)
- world.page.see_home_page_and_logged_in_status(user)
-
-
-@step(u'Then I fill an existing mobile number')
-def then_i_fill_an_existing_mobile_number(step):
- world.user_data = {
- 'mobile_number': '123456789',
- }
-
- user = User.objects.create(username='some_other_name')
- UserProfile.objects.create(
- user=user, mobile_number=world.user_data['mobile_number'])
-
- world.page.fill_valid_values(world.user_data)
- world.page.submit()
-
-
-@step(u'Then I should see existing mobile number error message')
-def then_i_should_see_existing_mobile_number_error_message(step):
- world.page.is_text_present(
- '%s is already associated with a different user.' % world.user_data['mobile_number'])
-
-
-@step(u'Then I fill an existing username')
-def then_i_fill_an_existing_username(step):
- world.user_data = {
- 'username': 'babyrajni',
- }
- User.objects.create(username=world.user_data['username'])
-
- world.page.fill_valid_values(world.user_data)
- world.page.submit()
-
-
-@step(u'Then I should see existing username error message')
-def then_i_should_see_existing_username_error_message(step):
- world.page.is_text_present(
- '%s is no longer available.' % world.user_data['username'])
-
-
-@step(u'Then I fill an existing email')
-def then_i_fill_an_existing_email(step):
- world.user_data = {
- 'email': 'haha@ha.ha',
- }
- User.objects.create(email=world.user_data['email'])
-
- world.page.fill_valid_values(world.user_data)
- world.page.submit()
-
-
-@step(u'Then I should see existing email error message')
-def then_i_should_see_existing_email_error_message(step):
- world.page.is_text_present(
- '%s is already associated with a different user.' % world.user_data['email'])
-
-
-@step(u'Then I fill a not allowed username')
-def then_i_fill_a_not_allowed_username(step):
- not_allowed_username = 'haha#%&&**!'
- world.user_data = {
- 'username': not_allowed_username,
- }
- User.objects.create(username=world.user_data['username'])
-
- world.page.fill_valid_values(world.user_data)
- world.page.submit()
-
-
-@step(u'Then I should see not allowed username error message')
-def then_i_should_see_not_allowed_username_error_message(step):
- world.page.is_text_present("username may contain only letters characters.")
-
-
-@step(u'And I have 100 users')
-def and_i_have_users(step):
- for i in range(100):
- random_suffix_number = str(randint(1, 99999))
- try:
- user = User.objects.create_user('user' + random_suffix_number, random_suffix_number + "@gmail.com",
- 'pass' + random_suffix_number)
- UserProfile.objects.create(
- mobile_number=random_suffix_number, user=user)
- except:
- pass
-
-
-@step(u'And I visit the users list page')
-def and_i_visit_the_users_list_page(step):
- world.page = UsersListPage(world.browser)
- world.page.visit()
-
-
-@step(u'Then I should see a list of users')
-def then_i_should_see_a_list_of_users(step):
- world.page.validate_users_listed()
- world.page.validate_displayed_headers()
- world.page.validate_users_paginated()
-
-
-@step(u'Then I should see the users information in a form')
-def then_i_should_see_the_users_information_in_a_form(step):
- world.page = EditUserDetailsPage(world.browser)
- world.page.set_user(world.user)
- world.page.assert_form_has_infomation()
-
-
-@step(u'When I modify the users information')
-def when_i_modify_the_users_information(step):
- world.page.modify_users_information()
-
-
-@step(u'And I click the update button')
-def and_i_click_the_update_button(step):
- world.page.click_update_button()
-
-
-@step(u'Then I should see user information updated successfully')
-def then_i_should_see_user_information_saved_successfully(step):
- world.page.assert_user_saved_sucessfully()
-
-
-@step(u'And I see that username is readonly')
-def and_i_see_that_username_is_readonly(step):
- world.page.assert_username_is_readonly()
-
-
-@step(u'Then I should not see the groups field')
-def then_i_should_not_see_the_groups_field(step):
- world.page.is_group_input_field_visible(False)
-
-
-@step(u'Then I should see the groups field')
-def then_i_should_see_the_groups_field(step):
- world.page.is_group_input_field_visible(True)
-
-
-@step(u'And I select edit action')
-def and_i_select_edit_action(step):
- world.page.click_by_css("#edit_user")
- world.page = EditUserDetailsPage(world.browser)
-
-
-@step(u'When I click add user button')
-def when_i_click_add_user_button(step):
- world.page = UsersListPage(world.browser)
- world.page.visit()
- world.page.click_by_css("#add-user")
-
-
-@step(u'Then I should see add user page')
-def then_i_should_see_add_user_page(step):
- world.page = NewUserPage(world.browser)
- world.page.validate_url()
-
-
-@step(u'And I have one user')
-def and_i_have_one_user(step):
- world.user = User.objects.create_user(username='hahaRajni', email='rarajni@kant.com',
- password='I_Rock_0', first_name='some rajni name', last_name='last_name')
- UserProfile.objects.create(user=world.user, mobile_number='123456667')
- admin = Group.objects.get(name='mics_admin')
- admin.user_set.add(world.user)
-
-
-@step(u'And I click the user details link')
-def and_i_click_the_user_details_link(step):
- world.page.click_link_by_href("/users/%d/" % world.user.id)
-
-
-@step(u'Then I should see the user details displayed')
-def then_i_should_see_the_user_details_displayed(step):
- world.page = UserDetailsPage(world.browser, world.user)
- world.page.validate_url()
- world.page.validate_page_content()
-
-
-@step(u'Then back button should take back to users page')
-def then_back_button_should_take_back_to_users_page(step):
- world.page.validate_back_link()
-
-
-@step(u'And I click the user deactivate link')
-def and_i_click_the_user_deactivate_link(step):
- world.page.click_link_by_partial_href(
- "#deactivate_user_%d" % world.user.id)
-
-
-@step(u'Then I should see a deactivate user confirmation modal')
-def then_i_should_see_a_deactivate_user_confirmation_modal(step):
- world.page.see_confirm_modal_message(world.user.username, "deactivate")
-
-
-@step(u'Then I should see the user is deactivated')
-def then_i_should_see_the_user_is_deactivated(step):
- world.page.see_success_message(
- "User %s" % world.user.username, "deactivated")
-
-
-@step(u'When I click the activate link for that user')
-def when_i_click_the_activate_link_for_that_user(step):
- world.page.click_link_by_partial_href(
- "#re-activate_user_%d" % world.user.id)
-
-
-@step(u'Then I should see a reactivate user confirmation modal')
-def then_i_should_see_a_reactivate_user_confirmation_modal(step):
- world.page.see_confirm_modal_message(world.user.username, "re-activate")
-
-
-@step(u'Then I should see the user is reactivated')
-def then_i_should_see_the_user_is_reactivated(step):
- world.page.see_success_message(
- "User %s" % world.user.username, "re-activated")
-
-
-@step(u'When I confirm deactivate')
-def when_i_confirm_deactivate(step):
- world.page.click_by_css("#deactivate-user-%d" % world.user.id)
-
-
-@step(u'When I confirm reactivate')
-def when_i_confirm_reactivate(step):
- world.page.click_by_css("#re-activate-user-%d" % world.user.id)
diff --git a/survey/features/users.feature b/survey/features/users.feature
deleted file mode 100644
index 33b28a19..00000000
--- a/survey/features/users.feature
+++ /dev/null
@@ -1,114 +0,0 @@
-Feature: Users feature
-
- Scenario: new user page
- Given I am logged in as a superuser
- And I visit new user page
- Then I see all new user fields
- And I click submit
- Then I should see the error messages
-
- Scenario: create user
- Given I am logged in as a superuser
- And I have a group
- And I visit new user page
- Then I fill all necessary new user fields
- And I click submit
- Then I should see user successfully registered
- And I can login that user successfully
-
- Scenario: create user with already existing mobile
- Given I am logged in as a superuser
- And I have a group
- And I visit new user page
- Then I fill an existing mobile number
- And I click submit
- Then I should see existing mobile number error message
-
- Scenario: create user with already existing username
- Given I am logged in as a superuser
- And I have a group
- And I visit new user page
- Then I fill an existing username
- And I click submit
- Then I should see existing username error message
-
- Scenario: create user with already existing email
- Given I am logged in as a superuser
- And I have a group
- And I visit new user page
- Then I fill an existing email
- And I click submit
- Then I should see existing email error message
-
- Scenario: create user with prohibited username
- Given I am logged in as a superuser
- And I have a group
- And I visit new user page
- Then I fill a not allowed username
- And I click submit
- Then I should see not allowed username error message
-
- Scenario: List users
- Given I am logged in as a superuser
- And I have 100 users
- And I visit the users list page
- Then I should see a list of users
- When I click add user button
- Then I should see add user page
-
-
- Scenario: Edit a user
- Given I am logged in as a superuser
- And I visit the users list page
- And I click on the edit button
- Then I should see the users information in a form
- And I see that username is readonly
- When I modify the users information
- And I click the update button
- Then I should see user information updated successfully
-
-
- Scenario: Edit a user when logged in with no permissions
- Given I have a user
- And I visit the login page
- And I login a user
- And I am in the home page
- And I click user settings link
- And I select edit action
- Then I should not see the groups field
- When I modify the users information
- And I click the update button
- Then I should see user information updated successfully
-
- Scenario: Edit a user when logged as superuser
- Given I am logged in as a superuser
- And I visit the login page
- And I login a user
- And I am in the home page
- And I click user settings link
- And I select edit action
- Then I should see the groups field
- When I modify the users information
- And I click the update button
- Then I should see user information updated successfully
-
- Scenario: View user details
- Given I am logged in as admin
- And I have one user
- And I visit the users list page
- And I click the user details link
- Then I should see the user details displayed
- Then back button should take back to users page
-
- Scenario: Deactivate/Activate a user
- Given I am logged in as admin
- And I have one user
- And I visit the users list page
- And I click the user deactivate link
- Then I should see a deactivate user confirmation modal
- When I confirm deactivate
- Then I should see the user is deactivated
- When I click the activate link for that user
- Then I should see a reactivate user confirmation modal
- When I confirm reactivate
- Then I should see the user is reactivated
\ No newline at end of file
diff --git a/survey/fixtures/__init__.py b/survey/fixtures/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/survey/fixtures/about_us.json b/survey/fixtures/about_us.json
deleted file mode 100644
index 9deaeb9b..00000000
--- a/survey/fixtures/about_us.json
+++ /dev/null
@@ -1,11 +0,0 @@
-[
- {
- "pk": 2,
- "model": "survey.aboutus",
- "fields": {
- "content": "
Multiple Indicator Cluster Survey (MICS)
UNICEF assists countries in collecting and analyzing data in order to fill data gaps for monitoring the situation of children and women through its international household survey initiative the Multiple Indicator Cluster Surveys (MICS). Since the mid-1990s, the MICS has enabled many countries to produce statistically sound and internationally comparable estimates of a range of indicators in the areas of health, education child protection and HIV/AIDS. MICS findings have been used extensively as a basis for policy decisions and programme interventions, and for the purpose of influencing public opinion on the situation of children and women around the world.
Survey tools
The MICS survey tools are developed by UNICEF after consultations with relevant experts from various UN organizations as well as with interagency monitoring groups. UNICEF works closely with other household survey programmes, in particular the Demographic and Health Surveys (DHS) programme, to harmonize survey questions and modules and to ensure a coordinated approach to survey implementation, with the objective to provide comparability across surveys and to avoid duplication of efforts. The survey questionnaires are modular tools that can be adapted to the needs of the country
UNICEF Uganda has developed a mobile-based tool to work over the USSD technology to collect household-level. The advantage of the mobile-based approach is:
To ease implementation of a potentially large-scale survey across regions/districts with large number of investigators.
To ensure a shorter processing time-frame so that data is available for analysis and informed decision-making in real-time
To make it possible to deploy remotely to mobiles and track survey work in real time taking advantage of prompt review of data quality thus ensuring a quicker audit and respondent tracking process.
To allow flexibility to handle new requests and make modification to on-going interviews while investigators are already in the field.
To make it easier to provide feedback and to exchange information between stakeholders in real time.
UNICEF assists countries in collecting and analyzing data in order to fill data gaps for monitoring the
- situation of children and women through its international household survey initiative the Multiple Indicator
- Cluster Surveys (MICS). Since the mid-1990s, the MICS has enabled many countries to produce statistically
- sound and internationally comparable estimates of a range of indicators in the areas of health, education,
- child protection and HIV/AIDS. MICS findings have been used extensively as a basis for policy decisions
- and programme interventions, and for the purpose of influencing public opinion on the situation of
- children and women around the world.
-
-
Survey tools
- The MICS survey tools are developed by UNICEF after consultations with relevant experts from various UN
- organizations as well as with interagency monitoring groups. UNICEF works closely with other household
- survey programmes, in particular the Demographic and Health Surveys (DHS) programme, to harmonize survey
- questions and modules and to ensure a coordinated approach to survey implementation, with the objective to
- provide comparability across surveys and to avoid duplication of efforts.
- The survey questionnaires are modular tools that can be adapted to the needs of the country
-
- UNICEF Uganda has developed a mobile-based tool to work over the USSD technology to collect household-level.
-
- The advantage of the mobile-based approach is:
-
-
- To ease implementation of a potentially large-scale survey across regions/districts with large number of
- investigators.
-
-
- To ensure a shorter processing time-frame so that data is available for analysis and informed decision-making
- in real-time
-
-
- To make it possible to deploy remotely to mobiles and track survey work in real time taking advantage of
- prompt review of data quality thus ensuring a quicker audit and respondent tracking process.
-
-
- To allow flexibility to handle new requests and make modification to on-going interviews while investigators
- are already in the field.
-
-
- To make it easier to provide feedback and to exchange information between stakeholders in real time.
-
UNICEF assists countries in collecting and analyzing data in order to fill data gaps for monitoring the situation of children and women through its international household survey initiative the Multiple Indicator Cluster Surveys (MICS). Since the mid-1990s, the MICS has enabled many countries to produce statistically sound and internationally comparable estimates of a range of indicators in the areas of health, education child protection and HIV/AIDS. MICS findings have been used extensively as a basis for policy decisions and programme interventions, and for the purpose of influencing public opinion on the situation of children and women around the world.
Survey tools
The MICS survey tools are developed by UNICEF after consultations with relevant experts from various UN organizations as well as with interagency monitoring groups. UNICEF works closely with other household survey programmes, in particular the Demographic and Health Surveys (DHS) programme, to harmonize survey questions and modules and to ensure a coordinated approach to survey implementation, with the objective to provide comparability across surveys and to avoid duplication of efforts. The survey questionnaires are modular tools that can be adapted to the needs of the country
UNICEF Uganda has developed a mobile-based tool to work over the USSD technology to collect household-level. The advantage of the mobile-based approach is:
To ease implementation of a potentially large-scale survey across regions/districts with large number of investigators.
To ensure a shorter processing time-frame so that data is available for analysis and informed decision-making in real-time
To make it possible to deploy remotely to mobiles and track survey work in real time taking advantage of prompt review of data quality thus ensuring a quicker audit and respondent tracking process.
To allow flexibility to handle new requests and make modification to on-going interviews while investigators are already in the field.
To make it easier to provide feedback and to exchange information between stakeholders in real time.