Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add api integration tests #2487

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions onadata/integration-tests/extend-config2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<extentreports>
<configuration>
<!-- report theme --> <!-- standard, dark -->
<theme>standard</theme>

<!-- document encoding --> <!-- defaults to UTF-8 -->
<encoding>UTF-8</encoding>

<!-- protocol for script and stylesheets --> <!-- defaults to https -->
<protocol>https</protocol>

<!-- title of the document -->
<documentTitle>ToolsQA - Cucumber Framework</documentTitle>

<!-- report name - displayed at top-nav -->
<reportName>ToolsQA - Cucumber Report</reportName>

<!-- global date format override --> <!-- defaults to yyyy-MM-dd -->
<dateFormat>yyyy-MM-dd</dateFormat>

<!-- global time format override --> <!-- defaults to HH:mm:ss -->
<timeFormat>HH:mm:ss</timeFormat>

<!-- custom javascript -->
<scripts>
<![CDATA[
$(document).ready(function() {

});
]]>
</scripts>

<!-- custom styles -->
<styles>
<![CDATA[

]]>
</styles>
</configuration>
</extentreports>
49 changes: 49 additions & 0 deletions onadata/integration-tests/extent-config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<extentreports>
<configuration>
<!-- report theme -->
<!-- standard, dark -->
<theme>standard</theme>

<!-- document encoding -->
<!-- defaults to UTF-8 -->
<encoding>UTF-8</encoding>

<!-- protocol for script and stylesheets -->
<!-- defaults to https -->
<protocol>https</protocol>

<!-- title of the document -->
<documentTitle>ExtentReports 2.0</documentTitle>

<!-- report name - displayed at top-nav -->
<reportName></reportName>

<!-- report headline - displayed at top-nav, after reportHeadline -->
<reportHeadline>Automation Report</reportHeadline>

<!-- global date format override -->
<!-- defaults to yyyy-MM-dd -->
<dateFormat>yyyy-MM-dd</dateFormat>

<!-- global time format override -->
<!-- defaults to HH:mm:ss -->
<timeFormat>HH:mm:ss</timeFormat>

<!-- custom javascript -->
<scripts>
<![CDATA[
$(document).ready(function() {

});
]]>
</scripts>

<!-- custom styles -->
<styles>
<![CDATA[

]]>
</styles>
</configuration>
</extentreports>
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions onadata/integration-tests/files/Colourful_Choices_1.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
good_or_bad,flavour,dominant_flavour,location,_location_latitude,_location_longitude,_location_altitude,_location_precision,resp_name,resp_age,image,meta/instanceID,_id,_uuid,_submission_time,_date_modified,_tags,_notes,_version,_duration,_submitted_by,_total_media,_media_count,_media_all_received,_xform_id
good,sweet sour hot,sweet,-1.207433 36.651521 0 0,-1.207433,36.651521,0,0,Kayla,30,nasa-9_46_24.jpeg,uuid:270cb7e8-b914-4aaf-8f6c-252180a6bdd9,1041820,270cb7e8-b914-4aaf-8f6c-252180a6bdd9,2023-05-17T06:46:33,2023-05-17T06:46:34,,,202305161142,,qastuff,1,1,True,5122
bad,sweet sour savoury,sweet,-1.206854 36.651649 0 0,-1.206854,36.651649,0,0,Mary,37,flora-9_46_56.jpeg,uuid:b23bc2ff-fa69-4760-9270-1ac2768680ab,1041821,b23bc2ff-fa69-4760-9270-1ac2768680ab,2023-05-17T06:47:08,2023-05-17T06:47:09,,,202305161142,,qastuff,1,1,True,5122
good,sour hot savoury,hot,-1.210651 36.661397 0 0,-1.210651,36.661397,0,0,Brenda,38,download3-9_47_29.jpeg,uuid:a1a161a3-9426-4584-99d0-2a21bd0060aa,1041822,a1a161a3-9426-4584-99d0-2a21bd0060aa,2023-05-17T06:47:42,2023-05-17T06:47:43,,,202305161142,,qastuff,1,1,True,5122
bad,sweet sour hot savoury,sour,-1.206275 36.65122 0 0,-1.206275,36.65122,0,0,Grace,32,satellite-9_48_0.jpeg,uuid:004db6e7-c93b-4f83-bb41-14a2f83a7be5,1041823,004db6e7-c93b-4f83-bb41-14a2f83a7be5,2023-05-17T06:48:12,2023-05-17T06:48:13,,,202305161142,,qastuff,1,1,True,5122
good,sour hot savoury,hot,-1.213741 36.652122 0 0,-1.213741,36.652122,0,0,Garry,28,warm wall colour-9_48_34.jpeg,uuid:c250cdcf-c31c-49e8-86f3-10eb862a300d,1041824,c250cdcf-c31c-49e8-86f3-10eb862a300d,2023-05-17T06:49:06,2023-05-17T06:49:07,,,202305161142,,qastuff,1,1,True,5122
good,sweet sour hot,sweet,-1.206532 36.651649 0 0,-1.206532,36.651649,0,0,Harold,29,images1-9_49_29.jpeg,uuid:d48647dd-f440-41d8-9011-acf1a3464382,1041825,d48647dd-f440-41d8-9011-acf1a3464382,2023-05-17T06:49:42,2023-05-17T06:49:42,,,202305161142,,qastuff,1,1,True,5122
good,sweet sour hot,sweet,-1.211981 36.654956 0 0,-1.211981,36.654956,0,0,Kailyn,27,flora-9_50_47.jpeg,uuid:30c752e4-0cc3-4206-a525-c25768cf2810,1041826,30c752e4-0cc3-4206-a525-c25768cf2810,2023-05-17T06:50:59,2023-05-17T06:51:00,,,202305161142,,qastuff,1,1,True,5122
good,sweet sour hot savoury,savoury,-1.208377 36.650748 0 0,-1.208377,36.650748,0,0,Jillian,35,download2-9_52_10.jpeg,uuid:a1676d48-98ee-48f1-acb7-8ddb6569c96b,1041827,a1676d48-98ee-48f1-acb7-8ddb6569c96b,2023-05-17T06:52:23,2023-05-17T06:52:24,,,202305161142,,qastuff,1,1,True,5122
good,sweet sour hot,sour,-1.213054 36.651864 0 0,-1.213054,36.651864,0,0,Esther,29,images3-9_52_48.jpeg,uuid:6babeeb3-131b-49f8-b795-66d84c5af28a,1041828,6babeeb3-131b-49f8-b795-66d84c5af28a,2023-05-17T06:53:01,2023-05-17T06:53:02,,,202305161142,,qastuff,1,1,True,5122
good,sweet hot savoury,sweet,-1.214084 36.652336 0 0,-1.214084,36.652336,0,0,Yvonne,27,images2-9_55_40.jpeg,uuid:e01b12b5-4c41-4751-9069-574e363e3ba9,1041829,e01b12b5-4c41-4751-9069-574e363e3ba9,2023-05-17T06:55:53,2023-05-17T06:55:54,,,202305161142,,qastuff,1,1,True,5122
good,sour hot savoury,hot,-1.205803 36.650833 0 0,-1.205803,36.650833,0,0,Gianna,30,satellite-9_57_8.jpeg,uuid:5000263c-b133-4c4a-a3a3-6da69660e98a,1041830,5000263c-b133-4c4a-a3a3-6da69660e98a,2023-05-17T06:57:21,2023-05-17T06:57:22,,,202305161142,,qastuff,1,1,True,5122
11 changes: 11 additions & 0 deletions onadata/integration-tests/files/Test_formA_2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
start,end,today,deviceid,group_1/resp_name,group_1/resp_age,group_1/resp_sex,group_1/hhh_female,group_1/child_num,group_1/photo,group_2/food,group_2/transport,group_2/total,group_cr41n78/Interview_ID,group_cr41n78/Interview_Type,imei
n/a,2022-05-26T11:30:35.805+03:00,2018-12-14,enketo.moda.wfp.org:uDbWTSXQWrfnNsxJ,George,34,1,n/a,1,http://classic.ona.io/api/v1/files/10488011?filename=qastuff/attachments/368110_Test_formA/pic2-10_36_5.jpg,5000,6000,11000,n/a,n/a,n/a
2021-05-27T11:26:44.098000+03:00,2021-05-27T11:27:13.505000+03:00,2021-05-27,n/a,Hannah,28,2,1,3,http://classic.ona.io/api/v1/files/20450401?filename=qastuff/attachments/368110_Test_formA/Screenshot_2021-05-24_at_17.56.33-11_27_6.png,3000,4000,7000,n/a,n/a,n/a
2021-05-27T11:27:13.631000+03:00,2021-05-27T11:28:10.506000+03:00,2021-05-27,n/a,leila,27,2,1,1,n/a,4000,3000,7000,n/a,n/a,n/a
n/a,2022-05-26T11:30:20.997+03:00,2021-05-27,enketo.moda.wfp.org:uDbWTSXQWrfnNsxJ,NIah,29,2,1,2,n/a,5000,6000,11000,n/a,n/a,n/a
2021-05-27T11:28:31.831000+03:00,2021-05-27T11:28:52.185000+03:00,2021-05-27,n/a,Jason,37,1,n/a,3,n/a,4000,1000,5000,n/a,n/a,n/a
2018-12-14T10:29:30.373000+03:00,2018-12-14T10:30:42.480000+03:00,2018-12-14,n/a,Kayla,20,2,n/a,3,http://classic.ona.io/api/v1/files/10487989?filename=qastuff/attachments/368110_Test_formA/Koala-10_30_34.jpg,3000,2000,5000,n/a,n/a,n/a
2021-05-27T11:28:10.563000+03:00,2021-05-27T11:28:31.761000+03:00,2021-05-27,n/a,Jane,29,2,1,2,n/a,5000,6000,11000,n/a,n/a,n/a
2021-05-27T11:28:31.831000+03:00,2021-05-27T11:28:52.185000+03:00,2021-05-27,n/a,Jason,37,1,n/a,3,n/a,4000,1000,5000,n/a,n/a,n/a
2022-02-21T10:11:27.097+03:00,2022-02-21T10:12:16.367+03:00,2022-02-21,enketo.moda.wfp.org:KpdlEsjj8pjkPVnE,jay,30,1,n/a,2,http://api.moda.wfp.org/api/v1/files/6169385?filename=support/attachments/29535_Test_formA/satellite-10_11_54.jpeg,3000,3000,6000,38902,virtual,n/a
2022-05-26T11:03:58.953+03:00,2022-05-26T11:04:43.624+03:00,2022-05-26,enketo.moda.wfp.org:uDbWTSXQWrfnNsxJ,Janice,34,2,1,4,http://api.moda.wfp.org/api/v1/files/7028808?filename=support/attachments/29535_Test_formA/bluethroat-11_4_23.png,4000,3000,7000,453,virtual,n/a
12 changes: 12 additions & 0 deletions onadata/integration-tests/files/images.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<data
id="images2" version="202307240721">
<location>KIle</location>
<resp_name>John</resp_name>
<photo1>photo-02.jpeg</photo1>
<gps>-1.229187 36.901679 0 0</gps>
<meta>
<instanceID>uuid:63708127-a40f-4efa-8755-d844739f8fdc</instanceID>
</meta>
</data>


Binary file added onadata/integration-tests/files/images2.xlsx
Binary file not shown.
Binary file added onadata/integration-tests/files/photo-02.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
178 changes: 178 additions & 0 deletions onadata/integration-tests/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--suppress ALL -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>RestAssuredFramework</groupId>
<artifactId>RestAssuredFramework</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.41.0</version>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>ru.qatools.commons</groupId>
<artifactId>properties</artifactId>
<version>2.0.RC6</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.12</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.6.2</version>
</dependency>

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.13-beta1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.30</version>
</dependency>
<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<version>1.5.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.8</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.4.0</version>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>28.2-jre</version>
</dependency>

<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>json-schema-validator</artifactId>
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.1.1</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>3.0.2</version>
</dependency>

<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>4.0.9</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.vimalselvam/cucumber-extentsreport -->
<dependency>
<groupId>com.vimalselvam</groupId>
<artifactId>cucumber-extentsreport</artifactId>
<version>3.1.1</version>
</dependency>

<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports-cucumber4-adapter</artifactId>
<version>1.0.7</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>3.0.3</version>
</dependency>
</dependencies>

<build>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14.1</version>
<configuration>
<includes>
<testSourceDirectory>test</testSourceDirectory>
<include>**/RunCukesTest*.java</include>
</includes>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>


</plugins>
</build>
</project>
Loading