finish overall test
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
"just-test": "karma start --config karma.conf.js",
|
||||
"just-test-in-node": "mocha --recursive --compilers js:babel-core/register test/core test/components test/bugs test/swagger-ui-dist-package",
|
||||
"test-e2e": "sleep 3 && nightwatch test/e2e/scenarios --config test/e2e/nightwatch.json",
|
||||
"test-e2e-initial-render": "nightwatch test/e2e/scenarios --config test/e2e/nightwatch.json --group initial-render",
|
||||
"test-e2e-initial-render": "nightwatch test/e2e/scenarios/ --config test/e2e/nightwatch.json --group initial-render",
|
||||
"mock-api": "json-server --watch test/e2e/db.json --port 3204",
|
||||
"e2e-flow": "npm-run-all --parallel -r hot-server mock-api test-e2e"
|
||||
},
|
||||
|
||||
144
test/e2e/db.json
144
test/e2e/db.json
@@ -143,6 +143,150 @@
|
||||
}
|
||||
],
|
||||
"status": "available"
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"category": {
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
},
|
||||
"name": "doggie",
|
||||
"photoUrls": [
|
||||
"string"
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
}
|
||||
],
|
||||
"status": "available"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"category": {
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
},
|
||||
"name": "doggie",
|
||||
"photoUrls": [
|
||||
"string"
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
}
|
||||
],
|
||||
"status": "available"
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"category": {
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
},
|
||||
"name": "doggie",
|
||||
"photoUrls": [
|
||||
"string"
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
}
|
||||
],
|
||||
"status": "available"
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"category": {
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
},
|
||||
"name": "doggie",
|
||||
"photoUrls": [
|
||||
"string"
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
}
|
||||
],
|
||||
"status": "available"
|
||||
},
|
||||
{
|
||||
"id": 14,
|
||||
"category": {
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
},
|
||||
"name": "doggie",
|
||||
"photoUrls": [
|
||||
"string"
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
}
|
||||
],
|
||||
"status": "available"
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"category": {
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
},
|
||||
"name": "doggie",
|
||||
"photoUrls": [
|
||||
"string"
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
}
|
||||
],
|
||||
"status": "available"
|
||||
},
|
||||
{
|
||||
"id": 16,
|
||||
"category": {
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
},
|
||||
"name": "doggie",
|
||||
"photoUrls": [
|
||||
"string"
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
}
|
||||
],
|
||||
"status": "available"
|
||||
},
|
||||
{
|
||||
"id": 17,
|
||||
"category": {
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
},
|
||||
"name": "doggie",
|
||||
"photoUrls": [
|
||||
"string"
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
}
|
||||
],
|
||||
"status": "available"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -314,6 +314,15 @@ module.exports = {
|
||||
storeOperationGetExecuteBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1) button.execute"
|
||||
},
|
||||
storeOperationResponseProps1: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1) pre.example.microlight span:nth-child(6)"
|
||||
},
|
||||
storeOperationResponseProps2: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1) pre.example.microlight span:nth-child(12)"
|
||||
},
|
||||
storeOperationResponseProps3: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1) pre.example.microlight span:nth-child(18)"
|
||||
},
|
||||
/**
|
||||
* Post /store/order
|
||||
*/
|
||||
@@ -335,6 +344,21 @@ module.exports = {
|
||||
storeOperationPostExecuteBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-post button.execute"
|
||||
},
|
||||
storeOperationPostResponseId: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-post pre.example.microlight span:nth-child(22)"
|
||||
},
|
||||
storeOperationPostResponsePetId: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-post pre.example.microlight span:nth-child(31)"
|
||||
},
|
||||
storeOperationPostResponseQuantity: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-post pre.example.microlight span:nth-child(40)"
|
||||
},
|
||||
storeOperationPostResponseStatus: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-post pre.example.microlight span:nth-child(66)"
|
||||
},
|
||||
storeOperationPostResponseComplete: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-post pre.example.microlight span:nth-child(75)"
|
||||
},
|
||||
/**
|
||||
* Delete /store/order/{orderId}
|
||||
*/
|
||||
@@ -356,6 +380,9 @@ module.exports = {
|
||||
storeOperationDeleteExecuteBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-delete button.execute"
|
||||
},
|
||||
storeOperationGetResponseHeaders: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-delete pre span"
|
||||
},
|
||||
/**
|
||||
* *********User**************
|
||||
*/
|
||||
@@ -386,6 +413,12 @@ module.exports = {
|
||||
userOperationPutExecuteBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-put button.execute"
|
||||
},
|
||||
userOperationPutParameter: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-put div.parameters-col_description input"
|
||||
},
|
||||
userOperationPutResponseHeader: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-put div.parameters-col_description input"
|
||||
},
|
||||
/**
|
||||
* Delete /user
|
||||
*/
|
||||
@@ -407,6 +440,12 @@ module.exports = {
|
||||
userOperationDeleteExecuteBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-delete button.execute"
|
||||
},
|
||||
userOperationDeleteParameter: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-delete div.parameters-col_description input"
|
||||
},
|
||||
userOperationDeleteResponseHeader: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-delete div.parameters-col_description input"
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
@@ -417,6 +456,9 @@ module.exports = {
|
||||
modelContainer: {
|
||||
selector: ".swagger-ui .models"
|
||||
},
|
||||
modelCollapse: {
|
||||
selector: ".swagger-ui .models h4"
|
||||
},
|
||||
orderModel: {
|
||||
selector: "section.models div.model-container:nth-child(1)"
|
||||
},
|
||||
|
||||
@@ -26,9 +26,9 @@ describe("Render Model Wrapper", function () {
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("Testing model callapse", function(client){
|
||||
modelWrapper.waitForElementVisible("@modelContainer")
|
||||
.click("@modelContainer")
|
||||
it("Render model wrapper collapse", function(client){
|
||||
modelWrapper.waitForElementVisible("@modelContainer", 5000)
|
||||
.click("@modelCollapse")
|
||||
.assert.cssClassNotPresent("@modelContainer", "is-open")
|
||||
|
||||
client.end()
|
||||
|
||||
@@ -130,7 +130,7 @@ describe("render pet api container", function () {
|
||||
.assert.containsText("@petOperationGetByTagMockCategoryID", "0")
|
||||
.assert.containsText("@petOperationGetByTagMockCategoryName", "\"string\"")
|
||||
.assert.containsText("@petOperationGetByTagMockName", "\"doggie\"")
|
||||
.assert.containsText("@petOpesrationGetByTagTagID", "0")
|
||||
.assert.containsText("@petOperationGetByTagTagID", "0")
|
||||
.assert.containsText("@petOperationGetByTagTagName", "\"string\"")
|
||||
.assert.containsText("@petOperationGetByTagStatus", "\"available\"")
|
||||
.click("@petOperationGetByTagTryBtn")
|
||||
@@ -140,7 +140,7 @@ describe("render pet api container", function () {
|
||||
})
|
||||
|
||||
it("render delete /pet api container", function (client) {
|
||||
apiWrapper.waitForElementVisible("@petOperationDeleteContainer", 5000)
|
||||
apiWrapper.waitForElementVisible("@petOperationDeleteContainer")
|
||||
.assert.containsText("@petOperationDeleteTitle", "/pet/{petId}")
|
||||
.click("@petOperationDeleteCollpase")
|
||||
.waitForElementVisible("@petOperationDeleteCollapseContainer", 3000)
|
||||
@@ -152,7 +152,7 @@ describe("render pet api container", function () {
|
||||
client.end()
|
||||
})
|
||||
it("Testing delete /pet api Mock data", function (client) {
|
||||
apiWrapper.waitForElementVisible("@petOperationDeleteContainer", 5000)
|
||||
apiWrapper.waitForElementVisible("@petOperationDeleteContainer", 3000)
|
||||
.click("@petOperationDeleteCollpase")
|
||||
.waitForElementVisible("@petOperationDeleteCollapseContainer", 3000)
|
||||
.click("@petOperationDeleteTryBtn")
|
||||
@@ -162,7 +162,7 @@ describe("render pet api container", function () {
|
||||
.assert.containsText("@petOperationDeleteMockCategoryID", "0")
|
||||
.assert.containsText("@petOperationDeleteMockCategoryName", "\"string\"")
|
||||
.assert.containsText("@petOperationDeleteMockName", "\"doggie\"")
|
||||
.assert.containsText("@petOpesrationDeleteTagID", "0")
|
||||
.assert.containsText("@petOperationDeleteTagID", "0")
|
||||
.assert.containsText("@petOperationDeleteTagName", "\"string\"")
|
||||
.assert.containsText("@petOperationDeleteStatus", "\"available\"")
|
||||
.click("@petOperationDeleteTryBtn")
|
||||
|
||||
@@ -20,33 +20,52 @@ describe("render store api container", function(){
|
||||
afterEach(function (client, done) {
|
||||
done()
|
||||
})
|
||||
it("test rendered store container", function(client){
|
||||
apiWrapper.waitForElementVisible("@storeAPIWrapper", 5000)
|
||||
.expect.element("@storeAPIWrapper").to.be.visible
|
||||
// it("test rendered store container", function(client){
|
||||
// apiWrapper.waitForElementVisible("@storeAPIWrapper", 5000)
|
||||
// .expect.element("@storeAPIWrapper").to.be.visible
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("callapse store wrapper", function(client){
|
||||
apiWrapper.waitForElementVisible("@storeAPIWrapper", 5000)
|
||||
.click("@storeAPIWrapperBar")
|
||||
.assert.cssClassNotPresent("@storeAPIWrapper", "is-open")
|
||||
// client.end()
|
||||
// })
|
||||
// it("callapse store wrapper", function(client){
|
||||
// apiWrapper.waitForElementVisible("@storeAPIWrapper", 5000)
|
||||
// .click("@storeAPIWrapperBar")
|
||||
// .assert.cssClassNotPresent("@storeAPIWrapper", "is-open")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("render get /store/inventory api container", function (client) {
|
||||
apiWrapper.waitForElementVisible("@storeOperationGetContainer", 5000)
|
||||
.assert.containsText("@storeOperationGetTitle", "/store/inventory")
|
||||
.click("@storeOperationGetCollpase")
|
||||
.waitForElementVisible("@storeOperationGetCollapseContainer", 3000)
|
||||
.click("@storeOperationGetTryBtn")
|
||||
.waitForElementVisible("@storeOperationGetExecuteBtn", 1000)
|
||||
.click("@storeOperationGetTryBtn")
|
||||
.assert.cssClassNotPresent("@storeOperationGetTryBtn", "cancel")
|
||||
// client.end()
|
||||
// })
|
||||
// it("render get /store/inventory api container", function (client) {
|
||||
// apiWrapper.waitForElementVisible("@storeOperationGetContainer", 5000)
|
||||
// .assert.containsText("@storeOperationGetTitle", "/store/inventory")
|
||||
// .click("@storeOperationGetCollpase")
|
||||
// .waitForElementVisible("@storeOperationGetCollapseContainer", 3000)
|
||||
// .click("@storeOperationGetTryBtn")
|
||||
// .waitForElementVisible("@storeOperationGetExecuteBtn", 1000)
|
||||
// .click("@storeOperationGetTryBtn")
|
||||
// .assert.cssClassNotPresent("@storeOperationGetTryBtn", "cancel")
|
||||
|
||||
client.end()
|
||||
})
|
||||
// client.end()
|
||||
// })
|
||||
|
||||
// it("Testing get /store/inventory api Mock data ", function (client) {
|
||||
// apiWrapper.waitForElementVisible("@storeOperationGetContainer", 5000)
|
||||
// .assert.containsText("@storeOperationGetTitle", "/store/inventory")
|
||||
// .click("@storeOperationGetCollpase")
|
||||
// .waitForElementVisible("@storeOperationGetCollapseContainer", 3000)
|
||||
// .click("@storeOperationGetTryBtn")
|
||||
// .waitForElementVisible("@storeOperationGetExecuteBtn", 1000)
|
||||
// .click("@storeOperationGetExecuteBtn")
|
||||
// .waitForElementVisible("@storeOperationResponseProps1")
|
||||
// .assert.containsText("@storeOperationResponseProps1", "0")
|
||||
// .assert.containsText("@storeOperationResponseProps2", "0")
|
||||
// .assert.containsText("@storeOperationResponseProps3", "0")
|
||||
// .click("@storeOperationGetTryBtn")
|
||||
// .assert.cssClassNotPresent("@storeOperationGetTryBtn", "cancel")
|
||||
|
||||
// client.end()
|
||||
// })
|
||||
|
||||
it("render post /store/order api container", function (client) {
|
||||
apiWrapper.waitForElementVisible("@storeOperationPostContainer", 5000)
|
||||
apiWrapper.waitForElementVisible("@storeOperationPostContainer")
|
||||
.assert.containsText("@storeOperationPostTitle", "/store/order")
|
||||
.click("@storeOperationPostCollpase")
|
||||
.waitForElementVisible("@storeOperationPostCollapseContainer", 3000)
|
||||
@@ -57,13 +76,35 @@ describe("render store api container", function(){
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("Testing post /store/order api Mock Data", function (client) {
|
||||
apiWrapper.waitForElementVisible("@storeOperationPostContainer")
|
||||
.assert.containsText("@storeOperationPostTitle", "/store/order")
|
||||
.click("@storeOperationPostCollpase")
|
||||
.waitForElementVisible("@storeOperationPostCollapseContainer", 3000)
|
||||
.click("@storeOperationPostTryBtn")
|
||||
.waitForElementVisible("@storeOperationPostExecuteBtn", 1000)
|
||||
.click("@storeOperationPostExecuteBtn")
|
||||
.waitForElementVisible("@storeOperationPostResponseId")
|
||||
.assert.containsText("@storeOperationPostResponseId", "0")
|
||||
.assert.containsText("@storeOperationPostResponsePetId", "0")
|
||||
.assert.containsText("@storeOperationPostResponseQuantity", "0")
|
||||
.assert.containsText("@storeOperationPostResponseStatus", "placed")
|
||||
.assert.containsText("@storeOperationPostResponseComplete", "false")
|
||||
.click("@storeOperationPostTryBtn")
|
||||
.assert.cssClassNotPresent("@storeOperationPostTryBtn", "cancel")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("render delete /store/order/{orderId} api container", function (client) {
|
||||
apiWrapper.waitForElementVisible("@storeOperationDeleteContainer", 5000)
|
||||
apiWrapper.waitForElementVisible("@storeOperationDeleteContainer")
|
||||
.assert.containsText("@storeOperationDeleteTitle", "/store/order/{orderId}")
|
||||
.click("@storeOperationDeleteCollpase")
|
||||
.waitForElementVisible("@storeOperationDeleteCollapseContainer", 3000)
|
||||
.click("@storeOperationDeleteTryBtn")
|
||||
.waitForElementVisible("@storeOperationDeleteExecuteBtn", 1000)
|
||||
.click("@storeOperationDeleteExecuteBtn")
|
||||
.waitForElementVisible("@storeOperationGetResponseHeaders", "content-type: application/xml")
|
||||
.click("@storeOperationDeleteTryBtn")
|
||||
.assert.cssClassNotPresent("@storeOperationDeleteTryBtn", "cancel")
|
||||
|
||||
|
||||
@@ -45,6 +45,23 @@ describe("render user api container", function(){
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("Test put /user/{username} api Mock data", function (client) {
|
||||
apiWrapper.waitForElementVisible("@userOperationPutContainer", 5000)
|
||||
.assert.containsText("@userOperationPutTitle", "/user/{username}")
|
||||
.click("@userOperationPutCollpase")
|
||||
.waitForElementVisible("@userOperationPutCollapseContainer", 3000)
|
||||
.click("@userOperationPutTryBtn")
|
||||
.waitForElementVisible("@userOperationPutParameter")
|
||||
.setValue("@userOperationPutParameter", "123")
|
||||
.waitForElementVisible("@userOperationPutExecuteBtn", 1000)
|
||||
.click("userOperationPutExecuteBtn")
|
||||
.waitForElementVisible("@userOperationPutResponseHeader")
|
||||
.assert.containsText("@userOperationPutResponseHeader", "content-type: application/xml")
|
||||
.click("@userOperationPutTryBtn")
|
||||
.assert.cssClassNotPresent("@userOperationPutTryBtn", "cancel")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("render delete /user/{username} api container", function (client) {
|
||||
apiWrapper.waitForElementVisible("@userOperationDeleteContainer", 5000)
|
||||
.assert.containsText("@userOperationDeleteTitle", "/user/{username}")
|
||||
@@ -57,4 +74,21 @@ describe("render user api container", function(){
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("Test delete /user/{username} api Mock data", function (client) {
|
||||
apiWrapper.waitForElementVisible("@userOperationDeleteContainer", 5000)
|
||||
.assert.containsText("@userOperationDeleteTitle", "/user/{username}")
|
||||
.click("@userOperationDeleteCollpase")
|
||||
.waitForElementVisible("@userOperationDeleteCollapseContainer", 3000)
|
||||
.click("@userOperationDeleteTryBtn")
|
||||
.waitForElementVisible("@userOperationDeleteParameter")
|
||||
.setValue("@userOperationDeleteParameter", "123")
|
||||
.waitForElementVisible("@userOperationDeleteExecuteBtn", 1000)
|
||||
.click("userOperationDeleteExecuteBtn")
|
||||
.waitForElementVisible("@userOperationDeleteResponseHeader")
|
||||
.assert.containsText("@userOperationDeleteResponseHeader", "content-type: application/xml")
|
||||
.click("@userOperationDeleteTryBtn")
|
||||
.assert.cssClassNotPresent("@userOperationDeleteTryBtn", "cancel")
|
||||
|
||||
client.end()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user