Rehydrate test code
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,3 +6,4 @@ npm-debug.log*
|
||||
.eslintcache
|
||||
package-lock.json
|
||||
*.iml
|
||||
selenium-debug.log
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
"test-in-node": "npm run lint-errors && npm run just-test-in-node",
|
||||
"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": "sleep 3 && nightwatch test/e2e/scenarios/ --config test/e2e/nightwatch.json",
|
||||
"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": "npm-run-all --parallel -r hot-server mock-api test-e2e"
|
||||
|
||||
252
test/e2e/db.json
252
test/e2e/db.json
@@ -18,6 +18,24 @@
|
||||
],
|
||||
"status": "available"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"category": {
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
},
|
||||
"name": "doggie",
|
||||
"photoUrls": [
|
||||
"string"
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
}
|
||||
],
|
||||
"status": "available"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"category": {
|
||||
@@ -53,240 +71,6 @@
|
||||
}
|
||||
],
|
||||
"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": {
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
},
|
||||
"name": "doggie",
|
||||
"photoUrls": [
|
||||
"string"
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "string"
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -59,7 +59,7 @@ module.exports = {
|
||||
selector: "select option"
|
||||
},
|
||||
btnAuthorize: {
|
||||
selector: "button"
|
||||
selector: "button.authorize"
|
||||
},
|
||||
authorizationModal: {
|
||||
selector: ".dialog-ux"
|
||||
@@ -97,191 +97,191 @@ module.exports = {
|
||||
* Post pet/ api
|
||||
*/
|
||||
petOperationPostContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-addPet"
|
||||
},
|
||||
petOperationPostTitle: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) .opblock-summary-post span.opblock-summary-path span"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-addPet .opblock-summary-post span.opblock-summary-path span"
|
||||
},
|
||||
petOperationPostCollpase: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) .opblock-summary-post"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-addPet .opblock-summary-post"
|
||||
},
|
||||
petOperationPostCollapseContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) .ReactCollapse--collapse"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-addPet>div:nth-child(2)"
|
||||
},
|
||||
petOperationPostTryBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) button.try-out__btn"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-addPet button.try-out__btn"
|
||||
},
|
||||
petOperationPostTryText: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) textarea.body-param__text"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-addPet textarea.body-param__text"
|
||||
},
|
||||
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) div#operations-pet-addPet button.execute"
|
||||
},
|
||||
petOperationPostTryTextArea: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) textarea"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-addPet textarea"
|
||||
},
|
||||
petOperationPostResultsBox: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) pre.microlight"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-addPet pre.microlight"
|
||||
},
|
||||
petOperationPostMockCategoryID: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-post:nth-of-type(1) pre.microlight span:nth-child(17)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-addPet 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)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-addPet 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)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-addPet 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)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-addPet 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)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-addPet 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)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-addPet pre.microlight span:nth-child(70)"
|
||||
},
|
||||
/**
|
||||
* Put pet/ api
|
||||
*/
|
||||
petOperationPutContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-updatePet"
|
||||
},
|
||||
petOperationPutTitle: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put .opblock-summary-put span.opblock-summary-path span"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-updatePet .opblock-summary-put span.opblock-summary-path span"
|
||||
},
|
||||
petOperationPutCollpase: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put .opblock-summary-put"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-updatePet .opblock-summary-put"
|
||||
},
|
||||
petOperationPutCollapseContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put .ReactCollapse--collapse"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-updatePet>div:nth-child(2)"
|
||||
},
|
||||
petOperationPutTryBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put button.try-out__btn"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-updatePet button.try-out__btn"
|
||||
},
|
||||
petOperationPutTryText: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put textarea.body-param__text"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-updatePet textarea.body-param__text"
|
||||
},
|
||||
petOperationPutExecuteBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put button.execute"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-updatePet button.execute"
|
||||
},
|
||||
petOperationPutTryTextArea: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put textarea"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-updatePet textarea"
|
||||
},
|
||||
petOperationPutResultsBox: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put pre.microlight"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-updatePet pre.microlight"
|
||||
},
|
||||
petOperationPutMockCategoryID: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put pre.microlight span:nth-child(17)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-updatePet pre.microlight span:nth-child(17)"
|
||||
},
|
||||
petOperationPutMockCategoryName: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put pre.microlight span:nth-child(23)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-updatePet pre.microlight span:nth-child(23)"
|
||||
},
|
||||
petOperationPutMockName: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put pre.microlight span:nth-child(31)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-updatePet pre.microlight span:nth-child(31)"
|
||||
},
|
||||
petOperationPutTagID: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put pre.microlight span:nth-child(54)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-updatePet pre.microlight span:nth-child(54)"
|
||||
},
|
||||
petOperationPutTagName: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put pre.microlight span:nth-child(60)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-updatePet pre.microlight span:nth-child(60)"
|
||||
},
|
||||
petOperationPutStatus: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-put 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/
|
||||
*/
|
||||
petOperationGetByTagContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags"
|
||||
},
|
||||
petOperationGetByTagTitle: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated .opblock-summary-get span.opblock-summary-path__deprecated span"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags .opblock-summary-get span.opblock-summary-path__deprecated span"
|
||||
},
|
||||
petOperationGetByTagCollpase: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated .opblock-summary-get"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags .opblock-summary-get"
|
||||
},
|
||||
petOperationGetByTagCollapseContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated .ReactCollapse--collapse"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags .ReactCollapse--collapse"
|
||||
},
|
||||
petOperationGetByTagTryBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated button.try-out__btn"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags button.try-out__btn"
|
||||
},
|
||||
petOperationGetByTagTryAdded: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated button.json-schema-form-item-add"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags button.json-schema-form-item-add"
|
||||
},
|
||||
petOperationGetByTagExecuteBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated button.execute"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags button.execute"
|
||||
},
|
||||
petOperationGetByTagTryTextArea: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated textarea"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags textarea"
|
||||
},
|
||||
petOperationGetByTagResultsBox: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated pre.microlight"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags pre.microlight"
|
||||
},
|
||||
petOperationGetByTagMockCategoryID: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated pre.microlight span:nth-child(17)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags pre.microlight span:nth-child(17)"
|
||||
},
|
||||
petOperationGetByTagMockCategoryName: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated pre.microlight span:nth-child(23)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags pre.microlight span:nth-child(23)"
|
||||
},
|
||||
petOperationGetByTagMockName: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated pre.microlight span:nth-child(31)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags pre.microlight span:nth-child(31)"
|
||||
},
|
||||
petOperationGetByTagTagID: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated pre.microlight span:nth-child(54)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags pre.microlight span:nth-child(54)"
|
||||
},
|
||||
petOperationGetByTagTagName: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated pre.microlight span:nth-child(60)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-findPetsByTags pre.microlight span:nth-child(60)"
|
||||
},
|
||||
petOperationGetByTagStatus: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-deprecated 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)"
|
||||
},
|
||||
|
||||
/**
|
||||
* Delete pet/
|
||||
*/
|
||||
petOperationDeleteContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-deletePet"
|
||||
},
|
||||
petOperationDeleteTitle: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete .opblock-summary-delete span.opblock-summary-path span"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-deletePet .opblock-summary-delete span.opblock-summary-path span"
|
||||
},
|
||||
petOperationDeleteCollpase: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete .opblock-summary-delete"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-deletePet .opblock-summary-delete"
|
||||
},
|
||||
petOperationDeleteCollapseContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete .ReactCollapse--collapse"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-deletePet>div:nth-child(2)"
|
||||
},
|
||||
petOperationDeleteTryBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete button.try-out__btn"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-deletePet button.try-out__btn"
|
||||
},
|
||||
petOperationDeleteExecuteBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete button.execute"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-deletePet button.execute"
|
||||
},
|
||||
petOperationDeleteTryTextArea: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete textarea"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-deletePet textarea"
|
||||
},
|
||||
petOperationDeleteResultsBox: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete pre.microlight"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-deletePet pre.microlight"
|
||||
},
|
||||
petOperationDeleteMockCategoryID: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete pre.microlight span:nth-child(17)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-deletePet pre.microlight span:nth-child(17)"
|
||||
},
|
||||
petOperationDeleteMockCategoryName: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete pre.microlight span:nth-child(23)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-deletePet pre.microlight span:nth-child(23)"
|
||||
},
|
||||
petOperationDeleteMockName: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete pre.microlight span:nth-child(31)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-deletePet pre.microlight span:nth-child(31)"
|
||||
},
|
||||
petOperationDeleteTagID: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete pre.microlight span:nth-child(54)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-deletePet pre.microlight span:nth-child(54)"
|
||||
},
|
||||
petOperationDeleteTagName: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete pre.microlight span:nth-child(60)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-deletePet pre.microlight span:nth-child(60)"
|
||||
},
|
||||
petOperationDeleteStatus: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) .opblock-delete pre.microlight span:nth-child(70)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(1) div#operations-pet-deletePet pre.microlight span:nth-child(70)"
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -297,91 +297,91 @@ module.exports = {
|
||||
* Get /store/inventory
|
||||
*/
|
||||
storeOperationGetContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-getInventory"
|
||||
},
|
||||
storeOperationGetTitle: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1) .opblock-summary-get span.opblock-summary-path span"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-getInventory .opblock-summary-get span.opblock-summary-path span"
|
||||
},
|
||||
storeOperationGetCollpase: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1) .opblock-summary-get"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-getInventory .opblock-summary-get"
|
||||
},
|
||||
storeOperationGetCollapseContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1) .ReactCollapse--collapse"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-getInventory>div:nth-child(2)"
|
||||
},
|
||||
storeOperationGetTryBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1) button.try-out__btn"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-getInventory button.try-out__btn"
|
||||
},
|
||||
storeOperationGetExecuteBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1) button.execute"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-getInventory button.execute"
|
||||
},
|
||||
storeOperationResponseProps1: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-get:nth-child(1) pre.example.microlight span:nth-child(6)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-getInventory 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)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-getInventory 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)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-getInventory pre.example.microlight span:nth-child(18)"
|
||||
},
|
||||
/**
|
||||
* Post /store/order
|
||||
*/
|
||||
storeOperationPostContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-post"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-placeOrder"
|
||||
},
|
||||
storeOperationPostTitle: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-post .opblock-summary-post span.opblock-summary-path span"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-placeOrder .opblock-summary-post span.opblock-summary-path span"
|
||||
},
|
||||
storeOperationPostCollpase: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-post .opblock-summary-post"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-placeOrder .opblock-summary-post"
|
||||
},
|
||||
storeOperationPostCollapseContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-post .ReactCollapse--collapse"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-placeOrder>div:nth-child(2)"
|
||||
},
|
||||
storeOperationPostTryBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-post button.try-out__btn"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-placeOrder button.try-out__btn"
|
||||
},
|
||||
storeOperationPostExecuteBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-post button.execute"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-placeOrder button.execute"
|
||||
},
|
||||
storeOperationPostResponseId: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-post pre.example.microlight span:nth-child(22)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-placeOrder 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)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-placeOrder 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)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-placeOrder 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)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-placeOrder 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)"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-placeOrder pre.example.microlight span:nth-child(75)"
|
||||
},
|
||||
/**
|
||||
* Delete /store/order/{orderId}
|
||||
*/
|
||||
storeOperationDeleteContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-delete"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-deleteOrder"
|
||||
},
|
||||
storeOperationDeleteTitle: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-delete .opblock-summary-delete span.opblock-summary-path span"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-deleteOrder .opblock-summary-delete span.opblock-summary-path span"
|
||||
},
|
||||
storeOperationDeleteCollpase: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-delete .opblock-summary-delete"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-deleteOrder .opblock-summary-delete"
|
||||
},
|
||||
storeOperationDeleteCollapseContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-delete .ReactCollapse--collapse"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-deleteOrder>div:nth-child(2)"
|
||||
},
|
||||
storeOperationDeleteTryBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-delete button.try-out__btn"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-deleteOrder button.try-out__btn"
|
||||
},
|
||||
storeOperationDeleteExecuteBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-delete button.execute"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-deleteOrder button.execute"
|
||||
},
|
||||
storeOperationGetResponseHeaders: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) .opblock-delete pre span"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(2) div#operations-store-deleteOrder pre span"
|
||||
},
|
||||
/**
|
||||
* *********User**************
|
||||
@@ -396,52 +396,52 @@ module.exports = {
|
||||
* Put /user/login
|
||||
*/
|
||||
userOperationPutContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-put"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) div#operations-user-updateUser"
|
||||
},
|
||||
userOperationPutTitle: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-put .opblock-summary-put span.opblock-summary-path span"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) div#operations-user-updateUser .opblock-summary-put span.opblock-summary-path span"
|
||||
},
|
||||
userOperationPutCollpase: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-put .opblock-summary-put"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) div#operations-user-updateUser .opblock-summary-put"
|
||||
},
|
||||
userOperationPutCollapseContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-put .ReactCollapse--collapse"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) div#operations-user-updateUser>div:nth-child(2)"
|
||||
},
|
||||
userOperationPutTryBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-put button.try-out__btn"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) div#operations-user-updateUser button.try-out__btn"
|
||||
},
|
||||
userOperationPutExecuteBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-put button.execute"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) div#operations-user-updateUser button.execute"
|
||||
},
|
||||
userOperationPutParameter: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-put div.parameters-col_description input"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) div#operations-user-updateUser div.parameters-col_description input"
|
||||
},
|
||||
userOperationPutResponseHeader: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-put div.parameters-col_description input"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) div#operations-user-updateUser div.parameters-col_description input"
|
||||
},
|
||||
/**
|
||||
* Delete /user
|
||||
*/
|
||||
userOperationDeleteContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-delete"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) div#operations-user-deleteUser"
|
||||
},
|
||||
userOperationDeleteTitle: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-delete .opblock-summary-delete span.opblock-summary-path span"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) div#operations-user-deleteUser .opblock-summary-delete span.opblock-summary-path span"
|
||||
},
|
||||
userOperationDeleteCollpase: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-delete .opblock-summary-delete"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) div#operations-user-deleteUser .opblock-summary-delete"
|
||||
},
|
||||
userOperationDeleteCollapseContainer: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-delete .ReactCollapse--collapse"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) div#operations-user-deleteUser>div:nth-child(2)"
|
||||
},
|
||||
userOperationDeleteTryBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-delete button.try-out__btn"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) div#operations-user-deleteUser button.try-out__btn"
|
||||
},
|
||||
userOperationDeleteExecuteBtn: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-delete button.execute"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) div#operations-user-deleteUser button.execute"
|
||||
},
|
||||
userOperationDeleteParameter: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-delete div.parameters-col_description input"
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) div#operations-user-deleteUser div.parameters-col_description input"
|
||||
},
|
||||
userOperationDeleteResponseHeader: {
|
||||
selector: ".swagger-ui .opblock-tag-section:nth-child(3) .opblock-delete div.parameters-col_description input"
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
describe("render informationContainer", function () {
|
||||
let mainPage
|
||||
let informationContainer
|
||||
beforeEach(function (client, done) {
|
||||
|
||||
mainPage = client
|
||||
.url("localhost:3200")
|
||||
.page.main()
|
||||
client.waitForElementVisible(".download-url-input", 5000)
|
||||
.pause(2000)
|
||||
.clearValue(".download-url-input")
|
||||
.setValue(".download-url-input", "http://localhost:3200/test-specs/1.json")
|
||||
.click("button.download-url-button")
|
||||
.pause(1000)
|
||||
|
||||
informationContainer = mainPage.section.informationContainer
|
||||
|
||||
done()
|
||||
})
|
||||
|
||||
it("renders section", function (client) {
|
||||
mainPage.expect.section("@informationContainer").to.be.visible.before(5000)
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("renders title", function (client) {
|
||||
informationContainer.waitForElementVisible("@title", 5000)
|
||||
.assert.containsText("@title", "Swagger Petstore")
|
||||
.assert.containsText("@version", "1.0.0")
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("renders base url", function (client) {
|
||||
informationContainer.waitForElementVisible("@baseUrl", 5000)
|
||||
.assert.containsText("@baseUrl", "[ Base URL: localhost:3204/]")
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("render main url", function (client) {
|
||||
informationContainer.waitForElementVisible("@mainUrl", 5000)
|
||||
.assert.attributeEquals("@mainUrl", "href", "http://localhost:3200/test-specs/1.json")
|
||||
.assert.containsText("@mainUrlContent", "http://localhost:3200/test-specs/1.json")
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("render description", function (client) {
|
||||
informationContainer.waitForElementVisible("@description", 5000)
|
||||
.assert.containsText("@description", "This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key special-key to test the authorization filters.")
|
||||
.assert.attributeEquals("@swaggerUrl", "href", "http://swagger.io/")
|
||||
.assert.attributeEquals("@swaggerircUrl", "href", "http://swagger.io/irc/")
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("render terms-of-service", function (client) {
|
||||
informationContainer.waitForElementVisible("@termsLink", 5000)
|
||||
.assert.attributeEquals("@termsLink", "href", "http://swagger.io/terms/")
|
||||
.assert.containsText("@termsLink", "Terms of service")
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("render contact-the-developer", function (client) {
|
||||
informationContainer.waitForElementVisible("@contactDevLink", 5000)
|
||||
.assert.attributeEquals("@contactDevLink", "href", "mailto:apiteam@swagger.io")
|
||||
.assert.containsText("@contactDevLink", "Contact the developer")
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("render apache", function (client) {
|
||||
informationContainer.waitForElementVisible("@apacheLink", 5000)
|
||||
.assert.attributeEquals("@apacheLink", "href", "http://www.apache.org/licenses/LICENSE-2.0.html")
|
||||
.assert.containsText("@apacheLink", "Apache 2.0")
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("render about swagger", function (client) {
|
||||
informationContainer.waitForElementVisible("@aboutSwaggerLink", 5000)
|
||||
.assert.attributeEquals("@aboutSwaggerLink", "href", "http://swagger.io/")
|
||||
.assert.containsText("@aboutSwaggerLink", "Find out more about Swagger")
|
||||
|
||||
client.end()
|
||||
})
|
||||
})
|
||||
@@ -1,80 +0,0 @@
|
||||
describe("Render Model Wrapper", function () {
|
||||
let mainPage
|
||||
let modelWrapper
|
||||
|
||||
beforeEach(function (client, done) {
|
||||
mainPage = client
|
||||
.url("localhost:3200")
|
||||
.page.main()
|
||||
client.waitForElementVisible(".download-url-input", 5000)
|
||||
.pause(2000)
|
||||
.clearValue(".download-url-input")
|
||||
.setValue(".download-url-input", "http://localhost:3200/test-specs/1.json")
|
||||
.click("button.download-url-button")
|
||||
.pause(1000)
|
||||
|
||||
modelWrapper = mainPage.section.modelWrapper
|
||||
|
||||
done()
|
||||
})
|
||||
afterEach(function (client, done){
|
||||
done()
|
||||
})
|
||||
it("Render model wrapper", function(client){
|
||||
mainPage.expect.section("@modelWrapper").to.be.visible.before(5000)
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("Render model wrapper collapse", function(client){
|
||||
modelWrapper.waitForElementVisible("@modelContainer", 5000)
|
||||
.click("@modelCollapse")
|
||||
.assert.cssClassNotPresent("@modelContainer", "is-open")
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("Testing order model", function(client){
|
||||
modelWrapper.waitForElementVisible("@orderModel")
|
||||
.click("@orderModelCallapse")
|
||||
.assert.cssClassNotPresent("@orderModelCallapse", "callapsed")
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("Testing category model", function(client){
|
||||
modelWrapper.waitForElementVisible("@categoryModel")
|
||||
.click("@categoryModelCallapse")
|
||||
.assert.cssClassNotPresent("@categoryModelCallapse", "callapsed")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("Testing user model", function(client){
|
||||
modelWrapper.waitForElementVisible("@userModel")
|
||||
.click("@userModelCallapse")
|
||||
.assert.cssClassNotPresent("@userModelCallapse", "callapsed")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("Testing tag model", function(client){
|
||||
modelWrapper.waitForElementVisible("@tagModel")
|
||||
.click("@tagModelCallapse")
|
||||
.assert.cssClassNotPresent("@tagModelCallapse", "callapsed")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("Testing pet model", function(client){
|
||||
modelWrapper.waitForElementVisible("@petModel")
|
||||
.click("@petModelCallapse")
|
||||
.assert.cssClassNotPresent("@petModelCallapse", "callapsed")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("Testing apiResponse model", function(client){
|
||||
modelWrapper.waitForElementVisible("@apiResponseModel")
|
||||
.click("@apiResponseModelCallapse")
|
||||
.assert.cssClassNotPresent("@apiResponseModelCallapse", "callapsed")
|
||||
|
||||
client.end()
|
||||
})
|
||||
})
|
||||
@@ -1,174 +0,0 @@
|
||||
|
||||
describe("render pet api container", function () {
|
||||
let mainPage
|
||||
let apiWrapper
|
||||
beforeEach(function (client, done) {
|
||||
mainPage = client
|
||||
.url("localhost:3200")
|
||||
.page.main()
|
||||
|
||||
client.waitForElementVisible(".download-url-input", 5000)
|
||||
.pause(2000)
|
||||
.clearValue(".download-url-input")
|
||||
.setValue(".download-url-input", "http://localhost:3200/test-specs/1.json")
|
||||
.click("button.download-url-button")
|
||||
.pause(1000)
|
||||
|
||||
apiWrapper = mainPage.section.apiWrapper
|
||||
|
||||
done()
|
||||
})
|
||||
afterEach(function (client, done) {
|
||||
done()
|
||||
})
|
||||
it("render section", function (client) {
|
||||
mainPage.expect.section("@apiWrapper").to.be.visible.before(5000)
|
||||
client.end()
|
||||
})
|
||||
it("test rendered pet container", function (client) {
|
||||
apiWrapper.waitForElementVisible("@petAPIWrapper", 5000)
|
||||
.expect.element("@petAPIWrapper").to.be.visible
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("collapse pet wrapper", function (client) {
|
||||
apiWrapper.waitForElementVisible("@petAPIWrapper", 5000)
|
||||
.click("@petAPIWrapperBar")
|
||||
.assert.cssClassNotPresent("@petAPIWrapper", "is-open")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("render post /pet api container", function (client) {
|
||||
apiWrapper.waitForElementVisible("@petOperationPostContainer", 5000)
|
||||
.assert.containsText("@petOperationPostTitle", "/pet")
|
||||
.click("@petOperationPostCollpase")
|
||||
.waitForElementVisible("@petOperationPostCollapseContainer", 3000)
|
||||
.click("@petOperationPostTryBtn")
|
||||
.waitForElementVisible("@petOperationPostTryText", 1000)
|
||||
.waitForElementVisible("@petOperationPostExecuteBtn", 1000)
|
||||
.click("@petOperationPostTryBtn")
|
||||
.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()
|
||||
})
|
||||
|
||||
it("render put /pet api container", function (client) {
|
||||
apiWrapper.waitForElementVisible("@petOperationPutContainer", 5000)
|
||||
.assert.containsText("@petOperationPutTitle", "/pet")
|
||||
.click("@petOperationPutCollpase")
|
||||
.waitForElementVisible("@petOperationPutCollapseContainer", 3000)
|
||||
.click("@petOperationPutTryBtn")
|
||||
.waitForElementVisible("@petOperationPutTryText", 1000)
|
||||
.waitForElementVisible("@petOperationPutExecuteBtn", 1000)
|
||||
.click("@petOperationPutTryBtn")
|
||||
.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()
|
||||
})
|
||||
|
||||
it("render get by tag /pet api container", function (client) {
|
||||
apiWrapper.waitForElementVisible("@petOperationGetByTagContainer", 5000)
|
||||
.assert.containsText("@petOperationGetByTagTitle", "/pet/findByTags")
|
||||
.click("@petOperationGetByTagCollpase")
|
||||
.waitForElementVisible("@petOperationGetByTagCollapseContainer", 3000)
|
||||
.click("@petOperationGetByTagTryBtn")
|
||||
.waitForElementVisible("@petOperationGetByTagTryAdded", 1000)
|
||||
.waitForElementVisible("@petOperationGetByTagExecuteBtn", 1000)
|
||||
.click("@petOperationGetByTagTryBtn")
|
||||
.assert.cssClassNotPresent("@petOperationGetByTagTryBtn", "cancel")
|
||||
|
||||
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("@petOperationGetByTagTagID", "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) {
|
||||
apiWrapper.waitForElementVisible("@petOperationDeleteContainer")
|
||||
.assert.containsText("@petOperationDeleteTitle", "/pet/{petId}")
|
||||
.click("@petOperationDeleteCollpase")
|
||||
.waitForElementVisible("@petOperationDeleteCollapseContainer", 3000)
|
||||
.click("@petOperationDeleteTryBtn")
|
||||
.waitForElementVisible("@petOperationDeleteExecuteBtn", 1000)
|
||||
.click("@petOperationDeleteTryBtn")
|
||||
.assert.cssClassNotPresent("@petOperationDeleteTryBtn", "cancel")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("Testing delete /pet api Mock data", function (client) {
|
||||
apiWrapper.waitForElementVisible("@petOperationDeleteContainer", 3000)
|
||||
.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("@petOperationDeleteTagID", "0")
|
||||
.assert.containsText("@petOperationDeleteTagName", "\"string\"")
|
||||
.assert.containsText("@petOperationDeleteStatus", "\"available\"")
|
||||
.click("@petOperationDeleteTryBtn")
|
||||
.assert.cssClassNotPresent("@petOperationDeleteTryBtn", "cancel")
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
})
|
||||
@@ -1,114 +0,0 @@
|
||||
describe("render store api container", function(){
|
||||
let mainPage
|
||||
let apiWrapper
|
||||
beforeEach( function(client, done){
|
||||
mainPage = client
|
||||
.url("localhost:3200")
|
||||
.page.main()
|
||||
|
||||
client.waitForElementVisible(".download-url-input", 5000)
|
||||
.pause(2000)
|
||||
.clearValue(".download-url-input")
|
||||
.setValue(".download-url-input", "http://localhost:3200/test-specs/1.json")
|
||||
.click("button.download-url-button")
|
||||
.pause(1000)
|
||||
|
||||
apiWrapper = mainPage.section.apiWrapper
|
||||
|
||||
done()
|
||||
})
|
||||
afterEach(function (client, done) {
|
||||
done()
|
||||
})
|
||||
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("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("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")
|
||||
.assert.containsText("@storeOperationPostTitle", "/store/order")
|
||||
.click("@storeOperationPostCollpase")
|
||||
.waitForElementVisible("@storeOperationPostCollapseContainer", 3000)
|
||||
.click("@storeOperationPostTryBtn")
|
||||
.waitForElementVisible("@storeOperationPostExecuteBtn", 1000)
|
||||
.click("@storeOperationPostTryBtn")
|
||||
.assert.cssClassNotPresent("@storeOperationPostTryBtn", "cancel")
|
||||
|
||||
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")
|
||||
.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")
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
})
|
||||
@@ -1,94 +0,0 @@
|
||||
describe("render user api container", function(){
|
||||
let mainPage
|
||||
let apiWrapper
|
||||
beforeEach( function(client, done){
|
||||
mainPage = client
|
||||
.url("localhost:3200")
|
||||
.page.main()
|
||||
|
||||
client.waitForElementVisible(".download-url-input", 5000)
|
||||
.pause(2000)
|
||||
.clearValue(".download-url-input")
|
||||
.setValue(".download-url-input", "http://localhost:3200/test-specs/1.json")
|
||||
.click("button.download-url-button")
|
||||
.pause(1000)
|
||||
|
||||
apiWrapper = mainPage.section.apiWrapper
|
||||
|
||||
done()
|
||||
})
|
||||
afterEach(function (client, done) {
|
||||
done()
|
||||
})
|
||||
it("test rendered user container", function(client){
|
||||
apiWrapper.waitForElementVisible("@userAPIWrapper", 5000)
|
||||
.expect.element("@userAPIWrapper").to.be.visible
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("callapse user wrapper", function(client){
|
||||
apiWrapper.waitForElementVisible("@userAPIWrapper", 5000)
|
||||
.click("@userAPIWrapperBar")
|
||||
.assert.cssClassNotPresent("@userAPIWrapper", "is-open")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("render put /user/{username} api container", function (client) {
|
||||
apiWrapper.waitForElementVisible("@userOperationPutContainer", 5000)
|
||||
.assert.containsText("@userOperationPutTitle", "/user/{username}")
|
||||
.click("@userOperationPutCollpase")
|
||||
.waitForElementVisible("@userOperationPutCollapseContainer", 3000)
|
||||
.click("@userOperationPutTryBtn")
|
||||
.waitForElementVisible("@userOperationPutExecuteBtn", 1000)
|
||||
.click("@userOperationPutTryBtn")
|
||||
.assert.cssClassNotPresent("@userOperationPutTryBtn", "cancel")
|
||||
|
||||
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}")
|
||||
.click("@userOperationDeleteCollpase")
|
||||
.waitForElementVisible("@userOperationDeleteCollapseContainer", 3000)
|
||||
.click("@userOperationDeleteTryBtn")
|
||||
.waitForElementVisible("@userOperationDeleteExecuteBtn", 1000)
|
||||
.click("@userOperationDeleteTryBtn")
|
||||
.assert.cssClassNotPresent("@userOperationDeleteTryBtn", "cancel")
|
||||
|
||||
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()
|
||||
})
|
||||
})
|
||||
@@ -1,50 +0,0 @@
|
||||
describe("Render scheme", function () {
|
||||
let mainPage
|
||||
let schemeContainer
|
||||
beforeEach(function (client, done) {
|
||||
|
||||
mainPage = client
|
||||
.url("localhost:3200")
|
||||
.page.main()
|
||||
|
||||
client.waitForElementVisible(".download-url-input", 5000)
|
||||
.pause(2000)
|
||||
.clearValue(".download-url-input")
|
||||
.setValue(".download-url-input", "http://localhost:3200/test-specs/1.json")
|
||||
.click("button.download-url-button")
|
||||
.pause(1000)
|
||||
|
||||
schemeContainer = mainPage.section.schemeContainer
|
||||
done()
|
||||
})
|
||||
|
||||
it("render section", function (client) {
|
||||
mainPage.expect.section("@schemeContainer").to.be.visible.before(5000)
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("render scheme option", function (client) {
|
||||
schemeContainer.waitForElementVisible("@httpOption", 5000)
|
||||
.expect.element("@httpOption").to.be.selected
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("render authorized button", function (client) {
|
||||
schemeContainer.waitForElementVisible("@btnAuthorize", 5000)
|
||||
.expect.element("@btnAuthorize").to.be.visible
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("render click event", function(client) {
|
||||
schemeContainer.waitForElementVisible("@btnAuthorize", 5000)
|
||||
.click("@btnAuthorize")
|
||||
.assert.visible("@authorizationModal")
|
||||
.assert.containsText("@appName", "Application: your-app-name")
|
||||
.assert.containsText("@authorizationUrl", "http://petstore.swagger.io/oauth/dialog")
|
||||
.assert.containsText("@flow", "implicit")
|
||||
.assert.value("@inputClientID", "your-client-id")
|
||||
|
||||
client.end()
|
||||
})
|
||||
})
|
||||
610
test/e2e/scenarios/initial-render/test.js
Normal file
610
test/e2e/scenarios/initial-render/test.js
Normal file
@@ -0,0 +1,610 @@
|
||||
describe("initial render", function () {
|
||||
let mainPage
|
||||
describe("for topbar", function () {
|
||||
let topbar
|
||||
before(function (client, done) {
|
||||
done()
|
||||
})
|
||||
|
||||
after(function (client, done) {
|
||||
client.end(function () {
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
afterEach(function (client, done) {
|
||||
done()
|
||||
})
|
||||
|
||||
beforeEach(function (client, done) {
|
||||
mainPage = client
|
||||
.url("localhost:3200")
|
||||
.page.main()
|
||||
|
||||
topbar = mainPage.section.topbar
|
||||
|
||||
client.waitForElementVisible(".download-url-input", 10000)
|
||||
.pause(5000)
|
||||
.clearValue(".download-url-input")
|
||||
.setValue(".download-url-input", "http://localhost:3200/test-specs/1.json")
|
||||
.click("button.download-url-button")
|
||||
.pause(1000)
|
||||
|
||||
done()
|
||||
})
|
||||
|
||||
it("renders section", function (client) {
|
||||
mainPage.expect.section("@topbar").to.be.visible
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("renders input box", function (client) {
|
||||
topbar.expect.element("@inputBox").to.be.visible
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("renders explore button", function (client) {
|
||||
topbar.expect.element("@btnExplore").to.be.visible
|
||||
|
||||
client.end()
|
||||
})
|
||||
})
|
||||
describe("Render scheme", function () {
|
||||
let schemeContainer
|
||||
beforeEach(function (client, done) {
|
||||
|
||||
mainPage = client
|
||||
.url("localhost:3200")
|
||||
.page.main()
|
||||
|
||||
schemeContainer = mainPage.section.schemeContainer
|
||||
|
||||
client.waitForElementVisible(".download-url-input", 5000)
|
||||
.pause(5000)
|
||||
.clearValue(".download-url-input")
|
||||
.setValue(".download-url-input", "http://localhost:3200/test-specs/1.json")
|
||||
.click("button.download-url-button")
|
||||
.pause(1000)
|
||||
|
||||
|
||||
done()
|
||||
})
|
||||
|
||||
it("render section", function (client) {
|
||||
mainPage.expect.section("@schemeContainer").to.be.visible.before(5000)
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("render scheme option", function (client) {
|
||||
schemeContainer.waitForElementVisible("@httpOption", 5000)
|
||||
.expect.element("@httpOption").to.be.selected
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("render authorized button", function (client) {
|
||||
schemeContainer.waitForElementVisible("@btnAuthorize", 5000)
|
||||
.expect.element("@btnAuthorize").to.be.visible
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("render click event", function(client) {
|
||||
schemeContainer.waitForElementVisible("@btnAuthorize", 5000)
|
||||
.click("@btnAuthorize")
|
||||
.assert.visible("@authorizationModal")
|
||||
.assert.containsText("@appName", "Application: your-app-name")
|
||||
.assert.containsText("@authorizationUrl", "http://petstore.swagger.io/oauth/dialog")
|
||||
.assert.containsText("@flow", "implicit")
|
||||
.assert.value("@inputClientID", "your-client-id")
|
||||
|
||||
client.end()
|
||||
})
|
||||
})
|
||||
describe("render informationContainer", function () {
|
||||
let mainPage
|
||||
let informationContainer
|
||||
beforeEach(function (client, done) {
|
||||
|
||||
mainPage = client
|
||||
.url("localhost:3200")
|
||||
.page.main()
|
||||
client.waitForElementVisible(".download-url-input", 5000)
|
||||
.pause(5000)
|
||||
.clearValue(".download-url-input")
|
||||
.setValue(".download-url-input", "http://localhost:3200/test-specs/1.json")
|
||||
.click("button.download-url-button")
|
||||
.pause(1000)
|
||||
|
||||
informationContainer = mainPage.section.informationContainer
|
||||
|
||||
done()
|
||||
})
|
||||
|
||||
it("renders section", function (client) {
|
||||
mainPage.expect.section("@informationContainer").to.be.visible.before(5000)
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("renders content", function (client) {
|
||||
informationContainer.waitForElementVisible("@title", 5000)
|
||||
.assert.containsText("@title", "Swagger Petstore")
|
||||
.assert.containsText("@version", "1.0.0")
|
||||
.assert.containsText("@baseUrl", "[ Base URL: localhost:3204/ ]")
|
||||
.assert.attributeEquals("@mainUrl", "href", "http://localhost:3200/test-specs/1.json")
|
||||
.assert.containsText("@mainUrlContent", "http://localhost:3200/test-specs/1.json")
|
||||
.assert.containsText("@description", "This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key special-key to test the authorization filters.")
|
||||
.assert.attributeEquals("@swaggerUrl", "href", "http://swagger.io/")
|
||||
.assert.attributeEquals("@swaggerircUrl", "href", "http://swagger.io/irc/")
|
||||
.assert.attributeEquals("@termsLink", "href", "http://swagger.io/terms/")
|
||||
.assert.containsText("@termsLink", "Terms of service")
|
||||
.assert.attributeEquals("@contactDevLink", "href", "mailto:apiteam@swagger.io")
|
||||
.assert.containsText("@contactDevLink", "Contact the developer")
|
||||
.assert.attributeEquals("@contactDevLink", "href", "mailto:apiteam@swagger.io")
|
||||
.assert.containsText("@contactDevLink", "Contact the developer")
|
||||
.assert.attributeEquals("@aboutSwaggerLink", "href", "http://swagger.io/")
|
||||
.assert.containsText("@aboutSwaggerLink", "Find out more about Swagger")
|
||||
|
||||
client.end()
|
||||
})
|
||||
})
|
||||
|
||||
describe("render pet api container", function () {
|
||||
let mainPage
|
||||
let apiWrapper
|
||||
beforeEach(function (client, done) {
|
||||
mainPage = client
|
||||
.url("localhost:3200")
|
||||
.page.main()
|
||||
|
||||
client.waitForElementVisible(".download-url-input", 5000)
|
||||
.pause(5000)
|
||||
.clearValue(".download-url-input")
|
||||
.setValue(".download-url-input", "http://localhost:3200/test-specs/1.json")
|
||||
.click("button.download-url-button")
|
||||
.pause(1000)
|
||||
|
||||
apiWrapper = mainPage.section.apiWrapper
|
||||
|
||||
done()
|
||||
})
|
||||
afterEach(function (client, done) {
|
||||
done()
|
||||
})
|
||||
it("render section", function (client) {
|
||||
mainPage.expect.section("@apiWrapper").to.be.visible.before(10000)
|
||||
client.end()
|
||||
})
|
||||
it("test rendered pet container", function (client) {
|
||||
apiWrapper.waitForElementVisible("@petAPIWrapper", 5000)
|
||||
.expect.element("@petAPIWrapper").to.be.visible
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("collapse pet wrapper", function (client) {
|
||||
apiWrapper.waitForElementVisible("@petAPIWrapper", 5000)
|
||||
.click("@petAPIWrapperBar")
|
||||
.assert.cssClassNotPresent("@petAPIWrapper", "is-open")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("render post /pet api container", function (client) {
|
||||
apiWrapper.waitForElementVisible("@petOperationPostContainer", 10000)
|
||||
.assert.containsText("@petOperationPostTitle", "/pet")
|
||||
.click("@petOperationPostCollpase")
|
||||
.waitForElementVisible("@petOperationPostCollapseContainer", 5000)
|
||||
.click("@petOperationPostTryBtn")
|
||||
.waitForElementVisible("@petOperationPostTryText", 1000)
|
||||
.waitForElementVisible("@petOperationPostExecuteBtn", 1000)
|
||||
.click("@petOperationPostTryBtn")
|
||||
.assert.cssClassNotPresent("@petOperationPostTryBtn", "cancel")
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("Testing post /pet api Mock data", function (client) {
|
||||
apiWrapper.waitForElementVisible("@petOperationPostContainer", 5000)
|
||||
.click("@petOperationPostCollpase")
|
||||
.waitForElementVisible("@petOperationPostCollapseContainer", 5000)
|
||||
.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()
|
||||
})
|
||||
|
||||
it("render put /pet api container", function (client) {
|
||||
apiWrapper.waitForElementVisible("@petOperationPutContainer", 5000)
|
||||
.assert.containsText("@petOperationPutTitle", "/pet")
|
||||
.click("@petOperationPutCollpase")
|
||||
.waitForElementVisible("@petOperationPutCollapseContainer", 3000)
|
||||
.click("@petOperationPutTryBtn")
|
||||
.waitForElementVisible("@petOperationPutTryText", 1000)
|
||||
.waitForElementVisible("@petOperationPutExecuteBtn", 1000)
|
||||
.click("@petOperationPutTryBtn")
|
||||
.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()
|
||||
})
|
||||
|
||||
it("render get by tag /pet api container", function (client) {
|
||||
apiWrapper.waitForElementVisible("@petOperationGetByTagContainer", 5000)
|
||||
.assert.containsText("@petOperationGetByTagTitle", "/pet/findByTags")
|
||||
.click("@petOperationGetByTagCollpase")
|
||||
.waitForElementVisible("@petOperationGetByTagCollapseContainer", 3000)
|
||||
.click("@petOperationGetByTagTryBtn")
|
||||
.waitForElementVisible("@petOperationGetByTagTryAdded", 1000)
|
||||
.waitForElementVisible("@petOperationGetByTagExecuteBtn", 1000)
|
||||
.click("@petOperationGetByTagTryBtn")
|
||||
.assert.cssClassNotPresent("@petOperationGetByTagTryBtn", "cancel")
|
||||
|
||||
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("@petOperationGetByTagTagID", "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) {
|
||||
apiWrapper.waitForElementVisible("@petOperationDeleteContainer")
|
||||
.assert.containsText("@petOperationDeleteTitle", "/pet/{petId}")
|
||||
.click("@petOperationDeleteCollpase")
|
||||
.waitForElementVisible("@petOperationDeleteCollapseContainer", 3000)
|
||||
.click("@petOperationDeleteTryBtn")
|
||||
.waitForElementVisible("@petOperationDeleteExecuteBtn", 1000)
|
||||
.click("@petOperationDeleteTryBtn")
|
||||
.assert.cssClassNotPresent("@petOperationDeleteTryBtn", "cancel")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("Testing delete /pet api Mock data", function (client) {
|
||||
apiWrapper.waitForElementVisible("@petOperationDeleteContainer", 3000)
|
||||
.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("@petOperationDeleteTagID", "0")
|
||||
.assert.containsText("@petOperationDeleteTagName", "\"string\"")
|
||||
.assert.containsText("@petOperationDeleteStatus", "\"available\"")
|
||||
.click("@petOperationDeleteTryBtn")
|
||||
.assert.cssClassNotPresent("@petOperationDeleteTryBtn", "cancel")
|
||||
|
||||
client.end()
|
||||
})
|
||||
})
|
||||
describe("render store api container", function(){
|
||||
let mainPage
|
||||
let apiWrapper
|
||||
beforeEach( function(client, done){
|
||||
mainPage = client
|
||||
.url("localhost:3200")
|
||||
.page.main()
|
||||
|
||||
client.waitForElementVisible(".download-url-input", 5000)
|
||||
.pause(3000)
|
||||
.clearValue(".download-url-input")
|
||||
.setValue(".download-url-input", "http://localhost:3200/test-specs/1.json")
|
||||
.click("button.download-url-button")
|
||||
.pause(1000)
|
||||
|
||||
apiWrapper = mainPage.section.apiWrapper
|
||||
|
||||
done()
|
||||
})
|
||||
afterEach(function (client, done) {
|
||||
done()
|
||||
})
|
||||
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("render get /store/inventory api container", function (client) {
|
||||
apiWrapper.waitForElementVisible("@storeOperationGetContainer", 5000)
|
||||
.assert.containsText("@storeOperationGetTitle", "/store/inventory")
|
||||
.click("@storeOperationGetCollpase")
|
||||
.waitForElementVisible("@storeOperationGetCollapseContainer", 5000)
|
||||
.click("@storeOperationGetTryBtn")
|
||||
.waitForElementVisible("@storeOperationGetExecuteBtn", 1000)
|
||||
.click("@storeOperationGetTryBtn")
|
||||
.assert.cssClassNotPresent("@storeOperationGetTryBtn", "cancel")
|
||||
|
||||
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")
|
||||
.assert.containsText("@storeOperationPostTitle", "/store/order")
|
||||
.click("@storeOperationPostCollpase")
|
||||
.waitForElementVisible("@storeOperationPostCollapseContainer", 3000)
|
||||
.click("@storeOperationPostTryBtn")
|
||||
.waitForElementVisible("@storeOperationPostExecuteBtn", 1000)
|
||||
.click("@storeOperationPostTryBtn")
|
||||
.assert.cssClassNotPresent("@storeOperationPostTryBtn", "cancel")
|
||||
|
||||
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")
|
||||
.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")
|
||||
|
||||
client.end()
|
||||
})
|
||||
})
|
||||
describe("render user api container", function(){
|
||||
let mainPage
|
||||
let apiWrapper
|
||||
beforeEach( function(client, done){
|
||||
mainPage = client
|
||||
.url("localhost:3200")
|
||||
.page.main()
|
||||
|
||||
client.waitForElementVisible(".download-url-input", 5000)
|
||||
.pause(5000)
|
||||
.clearValue(".download-url-input")
|
||||
.setValue(".download-url-input", "http://localhost:3200/test-specs/1.json")
|
||||
.click("button.download-url-button")
|
||||
.pause(1000)
|
||||
|
||||
apiWrapper = mainPage.section.apiWrapper
|
||||
|
||||
done()
|
||||
})
|
||||
afterEach(function (client, done) {
|
||||
done()
|
||||
})
|
||||
it("test rendered user container", function(client){
|
||||
apiWrapper.waitForElementVisible("@userAPIWrapper", 5000)
|
||||
.expect.element("@userAPIWrapper").to.be.visible
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("callapse user wrapper", function(client){
|
||||
apiWrapper.waitForElementVisible("@userAPIWrapper", 5000)
|
||||
.click("@userAPIWrapperBar")
|
||||
.assert.cssClassNotPresent("@userAPIWrapper", "is-open")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("render put /user/{username} api container", function (client) {
|
||||
apiWrapper.waitForElementVisible("@userOperationPutContainer", 5000)
|
||||
.assert.containsText("@userOperationPutTitle", "/user/{username}")
|
||||
.click("@userOperationPutCollpase")
|
||||
.waitForElementVisible("@userOperationPutCollapseContainer", 3000)
|
||||
.click("@userOperationPutTryBtn")
|
||||
.waitForElementVisible("@userOperationPutExecuteBtn", 1000)
|
||||
.click("@userOperationPutTryBtn")
|
||||
.assert.cssClassNotPresent("@userOperationPutTryBtn", "cancel")
|
||||
|
||||
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}")
|
||||
.click("@userOperationDeleteCollpase")
|
||||
.waitForElementVisible("@userOperationDeleteCollapseContainer", 3000)
|
||||
.click("@userOperationDeleteTryBtn")
|
||||
.waitForElementVisible("@userOperationDeleteExecuteBtn", 1000)
|
||||
.click("@userOperationDeleteTryBtn")
|
||||
.assert.cssClassNotPresent("@userOperationDeleteTryBtn", "cancel")
|
||||
|
||||
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()
|
||||
})
|
||||
})
|
||||
describe("Render Model Wrapper", function () {
|
||||
let modelWrapper
|
||||
|
||||
beforeEach(function (client, done) {
|
||||
mainPage = client
|
||||
.url("localhost:3200")
|
||||
.page.main()
|
||||
client.waitForElementVisible(".download-url-input", 5000)
|
||||
.pause(5000)
|
||||
.clearValue(".download-url-input")
|
||||
.setValue(".download-url-input", "http://localhost:3200/test-specs/1.json")
|
||||
.click("button.download-url-button")
|
||||
.pause(1000)
|
||||
|
||||
modelWrapper = mainPage.section.modelWrapper
|
||||
|
||||
done()
|
||||
})
|
||||
afterEach(function (client, done){
|
||||
done()
|
||||
})
|
||||
it("Render model wrapper", function(client){
|
||||
mainPage.expect.section("@modelWrapper").to.be.visible.before(5000)
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("Render model wrapper collapse", function(client){
|
||||
modelWrapper.waitForElementVisible("@modelContainer", 5000)
|
||||
.click("@modelCollapse")
|
||||
.assert.cssClassNotPresent("@modelContainer", "is-open")
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("Testing order model", function(client){
|
||||
modelWrapper.waitForElementVisible("@orderModel")
|
||||
.click("@orderModelCallapse")
|
||||
.assert.cssClassNotPresent("@orderModelCallapse", "callapsed")
|
||||
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("Testing category model", function(client){
|
||||
modelWrapper.waitForElementVisible("@categoryModel")
|
||||
.click("@categoryModelCallapse")
|
||||
.assert.cssClassNotPresent("@categoryModelCallapse", "callapsed")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("Testing user model", function(client){
|
||||
modelWrapper.waitForElementVisible("@userModel")
|
||||
.click("@userModelCallapse")
|
||||
.assert.cssClassNotPresent("@userModelCallapse", "callapsed")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("Testing tag model", function(client){
|
||||
modelWrapper.waitForElementVisible("@tagModel")
|
||||
.click("@tagModelCallapse")
|
||||
.assert.cssClassNotPresent("@tagModelCallapse", "callapsed")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("Testing pet model", function(client){
|
||||
modelWrapper.waitForElementVisible("@petModel")
|
||||
.click("@petModelCallapse")
|
||||
.assert.cssClassNotPresent("@petModelCallapse", "callapsed")
|
||||
|
||||
client.end()
|
||||
})
|
||||
it("Testing apiResponse model", function(client){
|
||||
modelWrapper.waitForElementVisible("@apiResponseModel")
|
||||
.click("@apiResponseModelCallapse")
|
||||
.assert.cssClassNotPresent("@apiResponseModelCallapse", "callapsed")
|
||||
|
||||
client.end()
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -1,52 +0,0 @@
|
||||
describe("initial render", function () {
|
||||
let mainPage
|
||||
describe("for topbar", function () {
|
||||
let topbar
|
||||
before(function (client, done) {
|
||||
done()
|
||||
})
|
||||
|
||||
after(function (client, done) {
|
||||
client.end(function () {
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
afterEach(function (client, done) {
|
||||
done()
|
||||
})
|
||||
|
||||
beforeEach(function (client, done) {
|
||||
mainPage = client
|
||||
.url("localhost:3200")
|
||||
.page.main()
|
||||
|
||||
topbar = mainPage.section.topbar
|
||||
|
||||
client.waitForElementVisible(".download-url-input", 10000)
|
||||
.pause(2000)
|
||||
.clearValue(".download-url-input")
|
||||
.setValue(".download-url-input", "http://localhost:3200/test-specs/1.json")
|
||||
.click("button.download-url-button")
|
||||
.pause(1000)
|
||||
|
||||
done()
|
||||
})
|
||||
|
||||
it("renders section", function (client) {
|
||||
mainPage.expect.section("@topbar").to.be.visible
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("renders input box", function (client) {
|
||||
topbar.expect.element("@inputBox").to.be.visible
|
||||
client.end()
|
||||
})
|
||||
|
||||
it("renders explore button", function (client) {
|
||||
topbar.expect.element("@btnExplore").to.be.visible
|
||||
|
||||
client.end()
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user