Commit 05e2f7f3 authored by xie.qin's avatar xie.qin

firstly commit.

parent 7136930e
......@@ -49,8 +49,8 @@ dependencies {
testImplementation 'io.cucumber:cucumber-java:6.10.4'
testImplementation 'io.cucumber:cucumber-junit:6.10.4'
testImplementation 'io.cucumber:cucumber-spring:6.10.4'
//testImplementation 'io.rest-assured:spring-mock-mvc:4.4.0'
testImplementation 'io.qameta.allure:allure-junit4:2.14.0'
testImplementation 'io.rest-assured:spring-mock-mvc:4.4.0'
//testImplementation 'io.qameta.allure:allure-junit4:2.14.0'
//testImplementation 'io.qameta.allure:allure-cucumber4-jvm:2.14.0'
testImplementation 'io.qameta.allure:allure-cucumber6-jvm:2.14.0'
}
......
......@@ -4,7 +4,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class VersionController {
public class BackendServiceController {
@GetMapping("/version")
public String getVersion() {
return "1.0";
......
......@@ -15,7 +15,7 @@ import java.util.Map;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class RestfulMessage {
public class RestfulMessageEntity {
private ContentType contentType;
private Headers headers;
......
......@@ -4,17 +4,17 @@ import org.springframework.context.ApplicationEvent;
public class RestfulMessageEvent extends ApplicationEvent {
private RestfulMessage restfulMsg;
private RestfulMessageEntity restfulMsg;
public RestfulMessageEvent(Object source) {
super(source);
}
public RestfulMessage getMsg() {
public RestfulMessageEntity getMsg() {
return restfulMsg;
}
public void setMsg(RestfulMessage restfulMsg) {
public void setMsg(RestfulMessageEntity restfulMsg) {
this.restfulMsg = restfulMsg;
}
}
......@@ -17,11 +17,12 @@ import java.math.BigDecimal;
public class GlobalProperties {
private String release;
private Integer int32max;
private Long int64max;
private String int64max;
private String dftstring;
private Boolean dftboolean;
private BigDecimal dftnumber;
private Long dftuserid;
private String dftusername;
private Integer intmin;
private String latestchain33version;
}
package com.fuzamei.autotest.utils;
public class FileUtils {
}
global.test.release=v2.1.0
global.test.release=v2.2.0
global.test.intmin=0
global.test.int32max=2147483647
global.test.int64max=9223372036854775807
......@@ -7,8 +7,10 @@ global.test.dftboolean=false
global.test.dftnumber=9999999999.99
global.test.dftuserid=87654321
global.test.dftusername=automation
global.test.latestchain33version=chain33_v1.6.6
server.port=8080
logging.level.root=WARN
logging.level.org.springframework=ERROR
logging.level.com.fuzamei.autotest=DEBUG
spring.jackson.default-property-inclusion=non_null
......
......@@ -8,7 +8,13 @@ import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(
features = "src/test/resources/features",
plugin = {"pretty"},
plugin = {"pretty",
"html:target/cucumber/report.html",
"json:target/cucumber/report.json",
"io.qameta.allure.cucumber6jvm.AllureCucumber6Jvm"
//"rerun:target/cucumbre/failed_scenarios.txt"
},
monochrome = true,
extraGlue = "com.fuzamei.autotest.steps",
tags = "not @dryrun"
)
......
package com.fuzamei.autotest.steps.openapi;
import com.fuzamei.autotest.openapi.ParseOpenApi;
import com.fuzamei.autotest.openapi.OpenApiParser;
import com.fuzamei.autotest.properties.BackendServiceProperties;
import com.fuzamei.autotest.properties.GlobalProperties;
import io.cucumber.java.en.Given;
......@@ -20,14 +20,14 @@ public class ApiVerification {
private BackendServiceProperties backendServiceProperties;
@Autowired
private ParseOpenApi parseOpenApi;
private OpenApiParser openApiParser;
@Given("^Found OpenAPI definition for (.*?) service$")
public void foundOpenApiProfileForTestingVer(String serviceName) throws Throwable {
String release = globalProperties.getRelease();
switch (serviceName) {
case "backend":
String openApiFilePath = parseOpenApi.getOpenApiFilePathByVersion(serviceName, release);
String openApiFilePath = openApiParser.getOpenApiFilePathByVersion(serviceName, release);
//log.debug("OpenApi definition for {} locates in {}", serviceName, openApiFilePath);
backendServiceProperties.setOpenapifilepath(openApiFilePath);
break;
......@@ -50,7 +50,7 @@ public class ApiVerification {
default:
break;
}
assertThat(parseOpenApi.analyzeOpenApiAndGenerateRequests(serviceName, targetServiceApiFilePath), is(Boolean.TRUE));
assertThat(openApiParser.analyzeOpenApiAndGenerateRequests(serviceName, targetServiceApiFilePath), is(Boolean.TRUE));
}
......
# new feature
# Tags: optional
Feature: A description
Scenario: A scenario
Given something..
\ No newline at end of file
@api_backend
@restfulapi @backend
Feature: API tests for service of backend
@verifyApi
@sanity
Scenario: Verify the exposed APIs work as design
#Given Found OpenAPI definition for backend service
#When The most basic testing data orgUser is ready for backend service
Given Found OpenAPI definition for backend service
When The most basic testing data orgUser is ready for backend service
Then Analyze OpenAPI file of backend service and generate REST-ful requests automatically
\ No newline at end of file
{
"u_userinfo": {
"id": 87654325,
"id": 87654321,
"phone": "13999999999",
"name": "automation",
"passwd": "admin",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"u_userinfo": {
"id": 87654321,
"phone": "13999999999",
"name": "automation",
"passwd": "admin",
"password": "F6889AA527EA40FB0A2AECC5A28A694E",
"mail": "xie.qin@33.cn",
"create_time": 1625557620511,
"status": 1
},
"u_organization": {
"id": "49d8e2dcb4ed41b5b564ab1608322613",
"name": "automation",
"address": "automation",
"type": "automation",
"creator": 87654321,
"owner": 87654321,
"status": 1,
"create_time": 1625554060376
},
"u_org_user": {
"id": 87654321,
"user_id": 87654321,
"org_id": "49d8e2dcb4ed41b5b564ab1608322613",
"status": 0
},
"u_federation": {
"id": "896bc3c9312abcdea5d5839be79cdda5",
"name": "automation",
"creator": 87654321,
"owner": 87654321,
"create_time": 1625643698310
},
"u_fed_org": {
"id": 87654321,
"fed_id": "896bc3c9312abcdea5d5839be79cdda5",
"org_id": "49d8e2dcb4ed41b5b564ab1608322613",
"status": 0,
"join_time": 1625643698483,
"quit_time": null
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment