e2e test for the validation
This commit is contained in:
@@ -93,6 +93,7 @@ module.exports = {
|
|||||||
petAPIWrapperBar: {
|
petAPIWrapperBar: {
|
||||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-tag"
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-tag"
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post pet/ api
|
* Post pet/ api
|
||||||
*/
|
*/
|
||||||
@@ -141,6 +142,7 @@ module.exports = {
|
|||||||
petOperationPostStatus: {
|
petOperationPostStatus: {
|
||||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-addPet pre.microlight span:nth-child(70)"
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-addPet pre.microlight span:nth-child(70)"
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Put pet/ api
|
* Put pet/ api
|
||||||
*/
|
*/
|
||||||
@@ -189,8 +191,9 @@ module.exports = {
|
|||||||
petOperationPutStatus: {
|
petOperationPutStatus: {
|
||||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-updatePet pre.microlight span:nth-child(70)"
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-updatePet pre.microlight span:nth-child(70)"
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get pet/
|
* Get /pet/findByTags
|
||||||
*/
|
*/
|
||||||
petOperationGetByTagContainer: {
|
petOperationGetByTagContainer: {
|
||||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags"
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags"
|
||||||
@@ -238,6 +241,34 @@ module.exports = {
|
|||||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags pre.microlight span:nth-child(70)"
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags pre.microlight span:nth-child(70)"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get /pet/{petId}
|
||||||
|
*/
|
||||||
|
petOperationGetByIdContainer: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-getPetById"
|
||||||
|
},
|
||||||
|
petOperationGetByIdTitle: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-getPetById .opblock-summary-get span.opblock-summary-path span"
|
||||||
|
},
|
||||||
|
petOperationGetByIdCollpase: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-getPetById .opblock-summary-get"
|
||||||
|
},
|
||||||
|
petOperationGetByIdCollapseContainer: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-getPetById .ReactCollapse--collapse"
|
||||||
|
},
|
||||||
|
petOperationGetByIdTryBtn: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-getPetById button.try-out__btn"
|
||||||
|
},
|
||||||
|
petOperationGetByIdExecuteBtn: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-getPetById button.execute"
|
||||||
|
},
|
||||||
|
petOperationGetByIdParameter: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(3) div#operations-pet-getPetById div.parameters-col_description input"
|
||||||
|
},
|
||||||
|
petOperationGetByIdResultsBox: {
|
||||||
|
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-getPetById pre.microlight"
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete pet/
|
* Delete pet/
|
||||||
*/
|
*/
|
||||||
@@ -497,9 +528,5 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ describe("render pet api container", function () {
|
|||||||
|
|
||||||
client.end()
|
client.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
it("Testing put /pet api Mock data", function (client) {
|
it("Testing put /pet api Mock data", function (client) {
|
||||||
apiWrapper.waitForElementVisible("@petOperationPutContainer", 5000)
|
apiWrapper.waitForElementVisible("@petOperationPutContainer", 5000)
|
||||||
.click("@petOperationPutCollpase")
|
.click("@petOperationPutCollpase")
|
||||||
@@ -138,6 +139,38 @@ describe("render pet api container", function () {
|
|||||||
client.end()
|
client.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("render get by ID /pet/{petId} api container", function (client) {
|
||||||
|
apiWrapper.waitForElementVisible("@petOperationGetByIdContainer", 5000)
|
||||||
|
.assert.containsText("@petOperationGetByIdTitle", "/pet/{petId}")
|
||||||
|
.click("@petOperationGetByIdCollpase")
|
||||||
|
.waitForElementVisible("@petOperationGetByIdCollapseContainer", 3000)
|
||||||
|
.click("@petOperationGetByIdTryBtn")
|
||||||
|
.waitForElementVisible("@petOperationGetByTagExecuteBtn", 1000)
|
||||||
|
.click("@petOperationGetByTagTryBtn")
|
||||||
|
.assert.cssClassNotPresent("@petOperationGetByTagTryBtn", "cancel")
|
||||||
|
|
||||||
|
client.end()
|
||||||
|
})
|
||||||
|
|
||||||
|
it("render get by ID /pet/{petId} api Mock data", function (client) {
|
||||||
|
apiWrapper.waitForElementVisible("@petOperationGetByIdContainer", 5000)
|
||||||
|
.assert.containsText("@petOperationGetByIdTitle", "/pet/{petId}")
|
||||||
|
.click("@petOperationGetByIdCollpase")
|
||||||
|
.waitForElementVisible("@petOperationGetByIdCollapseContainer", 3000)
|
||||||
|
.click("@petOperationGetByIdTryBtn")
|
||||||
|
.waitForElementVisible("@petOperationGetByTagExecuteBtn", 1000)
|
||||||
|
.setValue("@petOperationGetByIdParameter", "abc")
|
||||||
|
.click("@petOperationGetByIdExecuteBtn")
|
||||||
|
.waitForElementVisible("@petOperationGetByIdResultsBox")
|
||||||
|
.assert.containsText("@petOperationGetByIdParameter", "abc")
|
||||||
|
.assert.cssClassPresent("@petOperationGetByIdParameter", "invalid")
|
||||||
|
.assert.attributeEquals("@petOperationGetByIdParameter", "title", "Value must be an integer")
|
||||||
|
.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")
|
apiWrapper.waitForElementVisible("@petOperationDeleteContainer")
|
||||||
.assert.containsText("@petOperationDeleteTitle", "/pet/{petId}")
|
.assert.containsText("@petOperationDeleteTitle", "/pet/{petId}")
|
||||||
@@ -150,6 +183,7 @@ describe("render pet api container", function () {
|
|||||||
|
|
||||||
client.end()
|
client.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
it("Testing delete /pet api Mock data", function (client) {
|
it("Testing delete /pet api Mock data", function (client) {
|
||||||
apiWrapper.waitForElementVisible("@petOperationDeleteContainer", 3000)
|
apiWrapper.waitForElementVisible("@petOperationDeleteContainer", 3000)
|
||||||
.click("@petOperationDeleteCollpase")
|
.click("@petOperationDeleteCollpase")
|
||||||
|
|||||||
Reference in New Issue
Block a user