writing mock data test for pet
This commit is contained in:
110
test/e2e/db.json
110
test/e2e/db.json
@@ -19,7 +19,115 @@
|
|||||||
"status": "available"
|
"status": "available"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 2,
|
"id": 3,
|
||||||
|
"category": {
|
||||||
|
"id": 0,
|
||||||
|
"name": "string"
|
||||||
|
},
|
||||||
|
"name": "doggie",
|
||||||
|
"photoUrls": [
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"name": "string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"status": "available"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 4,
|
||||||
|
"category": {
|
||||||
|
"id": 0,
|
||||||
|
"name": "string"
|
||||||
|
},
|
||||||
|
"name": "doggie",
|
||||||
|
"photoUrls": [
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"name": "string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"status": "available"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 5,
|
||||||
|
"category": {
|
||||||
|
"id": 0,
|
||||||
|
"name": "string"
|
||||||
|
},
|
||||||
|
"name": "doggie",
|
||||||
|
"photoUrls": [
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"name": "string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"status": "available"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 6,
|
||||||
|
"category": {
|
||||||
|
"id": 0,
|
||||||
|
"name": "string"
|
||||||
|
},
|
||||||
|
"name": "doggie",
|
||||||
|
"photoUrls": [
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"name": "string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"status": "available"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 7,
|
||||||
|
"category": {
|
||||||
|
"id": 0,
|
||||||
|
"name": "string"
|
||||||
|
},
|
||||||
|
"name": "doggie",
|
||||||
|
"photoUrls": [
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"name": "string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"status": "available"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 8,
|
||||||
|
"category": {
|
||||||
|
"id": 0,
|
||||||
|
"name": "string"
|
||||||
|
},
|
||||||
|
"name": "doggie",
|
||||||
|
"photoUrls": [
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"name": "string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"status": "available"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 9,
|
||||||
"category": {
|
"category": {
|
||||||
"id": 0,
|
"id": 0,
|
||||||
"name": "string"
|
"name": "string"
|
||||||
|
|||||||
@@ -117,6 +117,30 @@ module.exports = {
|
|||||||
petOperationPostExecuteBtn: {
|
petOperationPostExecuteBtn: {
|
||||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) button.execute"
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) button.execute"
|
||||||
},
|
},
|
||||||
|
petOperationPostTryTextArea: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) textarea"
|
||||||
|
},
|
||||||
|
petOperationPostResultsBox: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) pre.microlight"
|
||||||
|
},
|
||||||
|
petOperationPostMockCategoryID: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) pre.microlight span:nth-child(17)"
|
||||||
|
},
|
||||||
|
petOperationPostMockCategoryName: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) pre.microlight span:nth-child(23)"
|
||||||
|
},
|
||||||
|
petOperationPostMockName: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) pre.microlight span:nth-child(31)"
|
||||||
|
},
|
||||||
|
petOperationPostTagID: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) pre.microlight span:nth-child(54)"
|
||||||
|
},
|
||||||
|
petOperationPostTagName: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) pre.microlight span:nth-child(60)"
|
||||||
|
},
|
||||||
|
petOperationPostStatus: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) pre.microlight span:nth-child(70)"
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* Put pet/ api
|
* Put pet/ api
|
||||||
*/
|
*/
|
||||||
@@ -141,6 +165,30 @@ module.exports = {
|
|||||||
petOperationPutExecuteBtn: {
|
petOperationPutExecuteBtn: {
|
||||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put button.execute"
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put button.execute"
|
||||||
},
|
},
|
||||||
|
petOperationPutTryTextArea: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put textarea"
|
||||||
|
},
|
||||||
|
petOperationPutResultsBox: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put pre.microlight"
|
||||||
|
},
|
||||||
|
petOperationPutMockCategoryID: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put pre.microlight span:nth-child(17)"
|
||||||
|
},
|
||||||
|
petOperationPutMockCategoryName: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put pre.microlight span:nth-child(23)"
|
||||||
|
},
|
||||||
|
petOperationPutMockName: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put pre.microlight span:nth-child(31)"
|
||||||
|
},
|
||||||
|
petOperationPutTagID: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put pre.microlight span:nth-child(54)"
|
||||||
|
},
|
||||||
|
petOperationPutTagName: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put pre.microlight span:nth-child(60)"
|
||||||
|
},
|
||||||
|
petOperationPutStatus: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put pre.microlight span:nth-child(70)"
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* Get pet/
|
* Get pet/
|
||||||
*/
|
*/
|
||||||
@@ -165,6 +213,31 @@ module.exports = {
|
|||||||
petOperationGetByTagExecuteBtn: {
|
petOperationGetByTagExecuteBtn: {
|
||||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated button.execute"
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated button.execute"
|
||||||
},
|
},
|
||||||
|
petOperationGetByTagTryTextArea: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated textarea"
|
||||||
|
},
|
||||||
|
petOperationGetByTagResultsBox: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated pre.microlight"
|
||||||
|
},
|
||||||
|
petOperationGetByTagMockCategoryID: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated pre.microlight span:nth-child(17)"
|
||||||
|
},
|
||||||
|
petOperationGetByTagMockCategoryName: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated pre.microlight span:nth-child(23)"
|
||||||
|
},
|
||||||
|
petOperationGetByTagMockName: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated pre.microlight span:nth-child(31)"
|
||||||
|
},
|
||||||
|
petOperationGetByTagTagID: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated pre.microlight span:nth-child(54)"
|
||||||
|
},
|
||||||
|
petOperationGetByTagTagName: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated pre.microlight span:nth-child(60)"
|
||||||
|
},
|
||||||
|
petOperationGetByTagStatus: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated pre.microlight span:nth-child(70)"
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete pet/
|
* Delete pet/
|
||||||
*/
|
*/
|
||||||
@@ -186,6 +259,30 @@ module.exports = {
|
|||||||
petOperationDeleteExecuteBtn: {
|
petOperationDeleteExecuteBtn: {
|
||||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete button.execute"
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete button.execute"
|
||||||
},
|
},
|
||||||
|
petOperationDeleteTryTextArea: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete textarea"
|
||||||
|
},
|
||||||
|
petOperationDeleteResultsBox: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete pre.microlight"
|
||||||
|
},
|
||||||
|
petOperationDeleteMockCategoryID: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete pre.microlight span:nth-child(17)"
|
||||||
|
},
|
||||||
|
petOperationDeleteMockCategoryName: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete pre.microlight span:nth-child(23)"
|
||||||
|
},
|
||||||
|
petOperationDeleteMockName: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete pre.microlight span:nth-child(31)"
|
||||||
|
},
|
||||||
|
petOperationDeleteTagID: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete pre.microlight span:nth-child(54)"
|
||||||
|
},
|
||||||
|
petOperationDeleteTagName: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete pre.microlight span:nth-child(60)"
|
||||||
|
},
|
||||||
|
petOperationDeleteStatus: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete pre.microlight span:nth-child(70)"
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ***********Store************
|
* ***********Store************
|
||||||
@@ -200,22 +297,22 @@ module.exports = {
|
|||||||
* Get /store/inventory
|
* Get /store/inventory
|
||||||
*/
|
*/
|
||||||
storeOperationGetContainer: {
|
storeOperationGetContainer: {
|
||||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-of-type(1)"
|
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1)"
|
||||||
},
|
},
|
||||||
storeOperationGetTitle: {
|
storeOperationGetTitle: {
|
||||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-of-type(1) .opblock-summary-get span.opblock-summary-path span"
|
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1) .opblock-summary-get span.opblock-summary-path span"
|
||||||
},
|
},
|
||||||
storeOperationGetCollpase: {
|
storeOperationGetCollpase: {
|
||||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-of-type(1) .opblock-summary-get"
|
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1) .opblock-summary-get"
|
||||||
},
|
},
|
||||||
storeOperationGetCollapseContainer: {
|
storeOperationGetCollapseContainer: {
|
||||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-of-type(1) .ReactCollapse--collapse"
|
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1) .ReactCollapse--collapse"
|
||||||
},
|
},
|
||||||
storeOperationGetTryBtn: {
|
storeOperationGetTryBtn: {
|
||||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-of-type(1) button.try-out__btn"
|
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1) button.try-out__btn"
|
||||||
},
|
},
|
||||||
storeOperationGetExecuteBtn: {
|
storeOperationGetExecuteBtn: {
|
||||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-of-type(1) button.execute"
|
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1) button.execute"
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Post /store/order
|
* Post /store/order
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ describe("render informationContainer", function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it("renders section", function (client) {
|
it("renders section", function (client) {
|
||||||
mainPage.expect.section("@informationContainer").to.be.visible.before(8000)
|
mainPage.expect.section("@informationContainer").to.be.visible.before(5000)
|
||||||
|
|
||||||
client.end()
|
client.end()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -48,7 +48,26 @@ describe("render pet api container", function () {
|
|||||||
.waitForElementVisible("@petOperationPostExecuteBtn", 1000)
|
.waitForElementVisible("@petOperationPostExecuteBtn", 1000)
|
||||||
.click("@petOperationPostTryBtn")
|
.click("@petOperationPostTryBtn")
|
||||||
.assert.cssClassNotPresent("@petOperationPostTryBtn", "cancel")
|
.assert.cssClassNotPresent("@petOperationPostTryBtn", "cancel")
|
||||||
|
|
||||||
|
client.end()
|
||||||
|
})
|
||||||
|
|
||||||
|
it("Testing post /pet api Mock data", function (client) {
|
||||||
|
apiWrapper.waitForElementVisible("@petOperationPostContainer", 5000)
|
||||||
|
.click("@petOperationPostCollpase")
|
||||||
|
.waitForElementVisible("@petOperationPostCollapseContainer", 3000)
|
||||||
|
.click("@petOperationPostTryBtn")
|
||||||
|
.waitForElementVisible("@petOperationPostExecuteBtn", 1000)
|
||||||
|
.click("@petOperationPostExecuteBtn")
|
||||||
|
.waitForElementVisible("@petOperationPostMockCategoryID", 2000)
|
||||||
|
.assert.containsText("@petOperationPostMockCategoryID", "0")
|
||||||
|
.assert.containsText("@petOperationPostMockCategoryName", "\"string\"")
|
||||||
|
.assert.containsText("@petOperationPostMockName", "\"doggie\"")
|
||||||
|
.assert.containsText("@petOperationPostTagID", "0")
|
||||||
|
.assert.containsText("@petOperationPostTagName", "\"string\"")
|
||||||
|
.assert.containsText("@petOperationPostStatus", "\"available\"")
|
||||||
|
.click("@petOperationPostTryBtn")
|
||||||
|
.assert.cssClassNotPresent("@petOperationPostTryBtn", "cancel")
|
||||||
|
|
||||||
client.end()
|
client.end()
|
||||||
})
|
})
|
||||||
@@ -64,11 +83,29 @@ describe("render pet api container", function () {
|
|||||||
.click("@petOperationPutTryBtn")
|
.click("@petOperationPutTryBtn")
|
||||||
.assert.cssClassNotPresent("@petOperationPutTryBtn", "cancel")
|
.assert.cssClassNotPresent("@petOperationPutTryBtn", "cancel")
|
||||||
|
|
||||||
|
client.end()
|
||||||
|
})
|
||||||
|
it("Testing put /pet api Mock data", function (client) {
|
||||||
|
apiWrapper.waitForElementVisible("@petOperationPutContainer", 5000)
|
||||||
|
.click("@petOperationPutCollpase")
|
||||||
|
.waitForElementVisible("@petOperationPutCollapseContainer", 3000)
|
||||||
|
.click("@petOperationPutTryBtn")
|
||||||
|
.waitForElementVisible("@petOperationPutExecuteBtn", 1000)
|
||||||
|
.click("@petOperationPutExecuteBtn")
|
||||||
|
.waitForElementVisible("@petOperationPutMockCategoryID")
|
||||||
|
.assert.containsText("@petOperationPutMockCategoryID", "0")
|
||||||
|
.assert.containsText("@petOperationPutMockCategoryName", "\"string\"")
|
||||||
|
.assert.containsText("@petOperationPutMockName", "\"doggie\"")
|
||||||
|
.assert.containsText("@petOperationPutTagID", "0")
|
||||||
|
.assert.containsText("@petOperationPutTagName", "\"string\"")
|
||||||
|
.assert.containsText("@petOperationPutStatus", "\"available\"")
|
||||||
|
.click("@petOperationPutTryBtn")
|
||||||
|
.assert.cssClassNotPresent("@petOperationPutTryBtn", "Cancel")
|
||||||
|
|
||||||
client.end()
|
client.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
it("render get /pet api container", function (client) {
|
it("render get by tag /pet api container", function (client) {
|
||||||
apiWrapper.waitForElementVisible("@petOperationGetByTagContainer", 5000)
|
apiWrapper.waitForElementVisible("@petOperationGetByTagContainer", 5000)
|
||||||
.assert.containsText("@petOperationGetByTagTitle", "/pet/findByTags")
|
.assert.containsText("@petOperationGetByTagTitle", "/pet/findByTags")
|
||||||
.click("@petOperationGetByTagCollpase")
|
.click("@petOperationGetByTagCollpase")
|
||||||
@@ -82,6 +119,26 @@ describe("render pet api container", function () {
|
|||||||
client.end()
|
client.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("Testing get by tag /pet api Mock data", function (client) {
|
||||||
|
apiWrapper.waitForElementVisible("@petOperationGetByTagContainer", 5000)
|
||||||
|
.click("@petOperationGetByTagCollpase")
|
||||||
|
.waitForElementVisible("@petOperationGetByTagCollapseContainer", 3000)
|
||||||
|
.click("@petOperationGetByTagTryBtn")
|
||||||
|
.waitForElementVisible("@petOperationGetByTagExecuteBtn", 1000)
|
||||||
|
.click("@petOperationGetByTagExecuteBtn")
|
||||||
|
.waitForElementVisible("@petOperationGetByTagMockCategoryID")
|
||||||
|
.assert.containsText("@petOperationGetByTagMockCategoryID", "0")
|
||||||
|
.assert.containsText("@petOperationGetByTagMockCategoryName", "\"string\"")
|
||||||
|
.assert.containsText("@petOperationGetByTagMockName", "\"doggie\"")
|
||||||
|
.assert.containsText("@petOpesrationGetByTagTagID", "0")
|
||||||
|
.assert.containsText("@petOperationGetByTagTagName", "\"string\"")
|
||||||
|
.assert.containsText("@petOperationGetByTagStatus", "\"available\"")
|
||||||
|
.click("@petOperationGetByTagTryBtn")
|
||||||
|
.assert.cssClassNotPresent("@petOperationGetByTagTryBtn", "cancel")
|
||||||
|
|
||||||
|
client.end()
|
||||||
|
})
|
||||||
|
|
||||||
it("render delete /pet api container", function (client) {
|
it("render delete /pet api container", function (client) {
|
||||||
apiWrapper.waitForElementVisible("@petOperationDeleteContainer", 5000)
|
apiWrapper.waitForElementVisible("@petOperationDeleteContainer", 5000)
|
||||||
.assert.containsText("@petOperationDeleteTitle", "/pet/{petId}")
|
.assert.containsText("@petOperationDeleteTitle", "/pet/{petId}")
|
||||||
@@ -94,4 +151,24 @@ describe("render pet api container", function () {
|
|||||||
|
|
||||||
client.end()
|
client.end()
|
||||||
})
|
})
|
||||||
|
it("Testing delete /pet api Mock data", function (client) {
|
||||||
|
apiWrapper.waitForElementVisible("@petOperationDeleteContainer", 5000)
|
||||||
|
.click("@petOperationDeleteCollpase")
|
||||||
|
.waitForElementVisible("@petOperationDeleteCollapseContainer", 3000)
|
||||||
|
.click("@petOperationDeleteTryBtn")
|
||||||
|
.waitForElementVisible("@petOperationDeleteExecuteBtn", 1000)
|
||||||
|
.click("@petOperationDeleteExecuteBtn")
|
||||||
|
.waitForElementVisible("@petOperationDeleteMockCategoryID")
|
||||||
|
.assert.containsText("@petOperationDeleteMockCategoryID", "0")
|
||||||
|
.assert.containsText("@petOperationDeleteMockCategoryName", "\"string\"")
|
||||||
|
.assert.containsText("@petOperationDeleteMockName", "\"doggie\"")
|
||||||
|
.assert.containsText("@petOpesrationDeleteTagID", "0")
|
||||||
|
.assert.containsText("@petOperationDeleteTagName", "\"string\"")
|
||||||
|
.assert.containsText("@petOperationDeleteStatus", "\"available\"")
|
||||||
|
.click("@petOperationDeleteTryBtn")
|
||||||
|
.assert.cssClassNotPresent("@petOperationDeleteTryBtn", "cancel")
|
||||||
|
|
||||||
|
client.end()
|
||||||
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user