style: fix indent spaces from 4 to 2 in test files (#6163)

This commit is contained in:
Tim Lai
2020-06-23 09:44:24 -07:00
committed by GitHub
parent e53d450cbc
commit faae3e9d2c
18 changed files with 1122 additions and 1214 deletions

View File

@@ -1,4 +1,4 @@
describe("bug #4445: callback-via-$ref rendering", function () { describe("bug #4409: operationId normalization and layout tracking", function () {
let mainPage let mainPage
beforeEach(function (client, done) { beforeEach(function (client, done) {
mainPage = client mainPage = client
@@ -7,7 +7,7 @@ describe("bug #4445: callback-via-$ref rendering", function () {
client.waitForElementVisible(".download-url-input:not([disabled])", 5000) client.waitForElementVisible(".download-url-input:not([disabled])", 5000)
.clearValue(".download-url-input") .clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3230/test-specs/bugs/4445.yaml") .setValue(".download-url-input", "http://localhost:3230/test-specs/bugs/4409.yaml")
.click("button.download-url-button") .click("button.download-url-button")
.pause(1000) .pause(1000)
@@ -16,15 +16,12 @@ describe("bug #4445: callback-via-$ref rendering", function () {
afterEach(function (client, done) { afterEach(function (client, done) {
done() done()
}) })
it("expands an operation that has a visible callback", function (client) { it("expands an operation that has a normalizable operationId", function (client) {
client.waitForElementVisible(".opblock-tag-section", 10000) client.waitForElementVisible(".opblock-tag-section", 10000)
.assert.containsText(".opblock-summary-path span", "/myApi")
.click(".opblock") .click(".opblock")
.waitForElementVisible(".opblock-body", 5000) .waitForElementVisible(".opblock-body", 5000)
.click(".opblock-section-header > .tab-header > div.tab-item:nth-of-type(2)") .assert.cssClassPresent(".opblock", "is-open")
.waitForElementVisible(".callbacks-container .opblock", 5000)
.click(".callbacks-container .opblock")
.waitForElementVisible(".callbacks-container .opblock-body", 5000)
.assert.containsText(".callbacks-container .opblock-description-wrapper:nth-of-type(2) p", "subscription payload")
client.end() client.end()
}) })

View File

@@ -1,4 +1,4 @@
describe("bug #4485: operation metadata storage when referenced via path item $ref", function () { describe("bug #4409: operationId normalization and layout tracking", function () {
let mainPage let mainPage
beforeEach(function (client, done) { beforeEach(function (client, done) {
mainPage = client mainPage = client
@@ -7,7 +7,7 @@ describe("bug #4485: operation metadata storage when referenced via path item $r
client.waitForElementVisible(".download-url-input:not([disabled])", 5000) client.waitForElementVisible(".download-url-input:not([disabled])", 5000)
.clearValue(".download-url-input") .clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3230/test-specs/bugs/4485/main.yaml") .setValue(".download-url-input", "http://localhost:3230/test-specs/bugs/4409.yaml")
.click("button.download-url-button") .click("button.download-url-button")
.pause(1000) .pause(1000)
@@ -16,14 +16,12 @@ describe("bug #4485: operation metadata storage when referenced via path item $r
afterEach(function (client, done) { afterEach(function (client, done) {
done() done()
}) })
it("sets a consumes value for a body parameter correctly", function (client) { it("expands an operation that has a normalizable operationId", function (client) {
client.waitForElementVisible(".opblock-tag-section", 10000) client.waitForElementVisible(".opblock-tag-section", 10000)
.assert.containsText(".opblock-summary-path span", "/myApi")
.click(".opblock") .click(".opblock")
.waitForElementVisible(".opblock-body", 5000) .waitForElementVisible(".opblock-body", 5000)
.click("button.btn.try-out__btn") .assert.cssClassPresent(".opblock", "is-open")
.click("select.content-type [value=\"application/xml\"]")
.pause(500)
.assert.value("select.content-type", "application/xml")
client.end() client.end()
}) })

View File

@@ -1,8 +1,7 @@
describe("render informationContainer", function () { describe("Render Model Wrapper", function () {
let mainPage let modelWrapper, mainPage
let informationContainer
beforeEach(function (client, done) {
beforeEach(function (client, done) {
mainPage = client mainPage = client
.url("localhost:3230") .url("localhost:3230")
.page.main() .page.main()
@@ -12,35 +11,67 @@ describe("render informationContainer", function () {
.click("button.download-url-button") .click("button.download-url-button")
.pause(1000) .pause(1000)
informationContainer = mainPage.section.informationContainer modelWrapper = mainPage.section.modelWrapper
done() done()
}) })
afterEach(function (client, done) {
it("renders section", function (client) { done()
mainPage.expect.section("@informationContainer").to.be.visible.before(5000) })
it("Render model wrapper", function (client) {
mainPage.expect.section("@modelWrapper").to.be.visible.before(5000)
client.end() client.end()
}) })
it("renders content", function (client) { it("Render model wrapper collapse", function (client) {
informationContainer.waitForElementVisible("@title", 5000) modelWrapper.waitForElementVisible("@modelContainer", 5000)
.assert.containsText("@title", "Swagger Petstore") .click("@modelCollapse")
.assert.containsText("@version", "1.0.0") .assert.cssClassNotPresent("@modelContainer", "is-open")
.assert.containsText("@baseUrl", "[ Base URL: localhost:3204/ ]")
.assert.attributeEquals("@mainUrl", "href", "http://localhost:3230/test-specs/petstore.json") client.end()
.assert.containsText("@mainUrlContent", "http://localhost:3230/test-specs/petstore.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/") it("Testing order model", function (client) {
.assert.attributeEquals("@swaggerircUrl", "href", "http://swagger.io/irc/") modelWrapper.waitForElementVisible("@orderModel")
.assert.attributeEquals("@termsLink", "href", "http://swagger.io/terms/") .click("@orderModelCallapse")
.assert.containsText("@termsLink", "Terms of service") .assert.cssClassNotPresent("@orderModelCallapse", "callapsed")
.assert.attributeEquals("@contactDevLink", "href", "mailto:apiteam@swagger.io")
.assert.containsText("@contactDevLink", "Contact the developer") client.end()
.assert.attributeEquals("@contactDevLink", "href", "mailto:apiteam@swagger.io") })
.assert.containsText("@contactDevLink", "Contact the developer")
.assert.attributeEquals("@aboutSwaggerLink", "href", "http://swagger.io/") it("Testing category model", function (client) {
.assert.containsText("@aboutSwaggerLink", "Find out more about Swagger") 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() client.end()
}) })

View File

@@ -1,4 +1,4 @@
describe("render pet api container", function () { describe("render store api container", function () {
let mainPage let mainPage
let apiWrapper let apiWrapper
beforeEach(function (client, done) { beforeEach(function (client, done) {
@@ -19,196 +19,93 @@ describe("render pet api container", function () {
afterEach(function (client, done) { afterEach(function (client, done) {
done() done()
}) })
it("render section", function (client) { it("test rendered store container", function (client) {
mainPage.expect.section("@apiWrapper").to.be.visible.before(10000) apiWrapper.waitForElementVisible("@storeAPIWrapper", 5000)
client.end() .expect.element("@storeAPIWrapper").to.be.visible
})
it("test rendered pet container", function (client) {
apiWrapper.waitForElementVisible("@petAPIWrapper", 5000)
.expect.element("@petAPIWrapper").to.be.visible
client.end() client.end()
}) })
it("collapse pet wrapper", function (client) { it("callapse store wrapper", function (client) {
apiWrapper.waitForElementVisible("@petAPIWrapper", 5000) apiWrapper.waitForElementVisible("@storeAPIWrapper", 5000)
.click("@petAPIWrapperBar") .click("@storeAPIWrapperBar")
.assert.cssClassNotPresent("@petAPIWrapper", "is-open") .assert.cssClassNotPresent("@storeAPIWrapper", "is-open")
client.end() client.end()
}) })
it("render post /pet api container", function (client) { it("render get /store/inventory api container", function (client) {
apiWrapper.waitForElementVisible("@petOperationPostContainer", 10000) apiWrapper.waitForElementVisible("@storeOperationGetContainer", 5000)
.assert.containsText("@petOperationPostTitle", "/pet") .assert.containsText("@storeOperationGetTitle", "/store/inventory")
.click("@petOperationPostCollpase") .click("@storeOperationGetCollpase")
.waitForElementVisible("@petOperationPostCollapseContainer", 5000) .waitForElementVisible("@storeOperationGetCollapseContainer", 5000)
.click("@petOperationPostTryBtn") .click("@storeOperationGetTryBtn")
.waitForElementVisible("@petOperationPostTryText", 1000) .waitForElementVisible("@storeOperationGetExecuteBtn", 1000)
.waitForElementVisible("@petOperationPostExecuteBtn", 1000) .click("@storeOperationGetTryBtn")
.click("@petOperationPostTryBtn") .assert.cssClassNotPresent("@storeOperationGetTryBtn", "cancel")
.assert.cssClassNotPresent("@petOperationPostTryBtn", "cancel")
client.end() client.end()
}) })
it("Testing post /pet api Mock data", function (client) { it("Testing get /store/inventory api Mock data ", function (client) {
apiWrapper.waitForElementVisible("@petOperationPostContainer", 5000) apiWrapper.waitForElementVisible("@storeOperationGetContainer", 5000)
.click("@petOperationPostCollpase") .assert.containsText("@storeOperationGetTitle", "/store/inventory")
.waitForElementVisible("@petOperationPostCollapseContainer", 5000) .click("@storeOperationGetCollpase")
.click("@petOperationPostTryBtn") .waitForElementVisible("@storeOperationGetCollapseContainer", 3000)
.waitForElementVisible("@petOperationPostExecuteBtn", 1000) .click("@storeOperationGetTryBtn")
.click("@petOperationPostExecuteBtn") .waitForElementVisible("@storeOperationGetExecuteBtn", 1000)
.waitForElementVisible("@petOperationPostMockCategoryID", 2000) .click("@storeOperationGetExecuteBtn")
.assert.containsText("@petOperationPostMockCategoryID", "0") .waitForElementVisible("@storeOperationResponseProps1")
.assert.containsText("@petOperationPostMockCategoryName", "\"string\"") .assert.containsText("@storeOperationResponseProps1", "0")
.assert.containsText("@petOperationPostMockName", "\"doggie\"") .assert.containsText("@storeOperationResponseProps2", "0")
.assert.containsText("@petOperationPostTagID", "0") .assert.containsText("@storeOperationResponseProps3", "0")
.assert.containsText("@petOperationPostTagName", "\"string\"") .click("@storeOperationGetTryBtn")
.assert.containsText("@petOperationPostStatus", "\"available\"") .assert.cssClassNotPresent("@storeOperationGetTryBtn", "cancel")
.click("@petOperationPostTryBtn")
.assert.cssClassNotPresent("@petOperationPostTryBtn", "cancel")
client.end() client.end()
}) })
it("Testing post /pet api model values", function (client) { it("render post /store/order api container", function (client) {
apiWrapper.waitForElementVisible("@petOperationPostContainer", 5000) apiWrapper.waitForElementVisible("@storeOperationPostContainer")
.click("@petOperationPostCollpase") .assert.containsText("@storeOperationPostTitle", "/store/order")
.waitForElementVisible("@petOperationPostCollapseContainer", 5000) .click("@storeOperationPostCollpase")
.click("a.tablinks[data-name=model]") .waitForElementVisible("@storeOperationPostCollapseContainer", 3000)
.assert.containsText("span.model-title > .model-title__text", `Pet`) .click("@storeOperationPostTryBtn")
.waitForElementVisible("@storeOperationPostExecuteBtn", 1000)
.click("@storeOperationPostTryBtn")
.assert.cssClassNotPresent("@storeOperationPostTryBtn", "cancel")
client.end() client.end()
}) })
it("render put /pet api container", function (client) { it("Testing post /store/order api Mock Data", function (client) {
apiWrapper.waitForElementVisible("@petOperationPutContainer", 5000) apiWrapper.waitForElementVisible("@storeOperationPostContainer")
.assert.containsText("@petOperationPutTitle", "/pet") .assert.containsText("@storeOperationPostTitle", "/store/order")
.click("@petOperationPutCollpase") .click("@storeOperationPostCollpase")
.waitForElementVisible("@petOperationPutCollapseContainer", 3000) .waitForElementVisible("@storeOperationPostCollapseContainer", 3000)
.click("@petOperationPutTryBtn") .click("@storeOperationPostTryBtn")
.waitForElementVisible("@petOperationPutTryText", 1000) .waitForElementVisible("@storeOperationPostExecuteBtn", 1000)
.waitForElementVisible("@petOperationPutExecuteBtn", 1000) .click("@storeOperationPostExecuteBtn")
.click("@petOperationPutTryBtn") .waitForElementVisible("@storeOperationPostResponseId")
.assert.cssClassNotPresent("@petOperationPutTryBtn", "cancel") .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() client.end()
}) })
it("render delete /store/order/{orderId} api container", function (client) {
it("Testing put /pet api Mock data", function (client) { apiWrapper.waitForElementVisible("@storeOperationDeleteContainer")
apiWrapper.waitForElementVisible("@petOperationPutContainer", 5000) .assert.containsText("@storeOperationDeleteTitle", "/store/order/{orderId}")
.click("@petOperationPutCollpase") .click("@storeOperationDeleteCollpase")
.waitForElementVisible("@petOperationPutCollapseContainer", 3000) .waitForElementVisible("@storeOperationDeleteCollapseContainer", 3000)
.click("@petOperationPutTryBtn") .click("@storeOperationDeleteTryBtn")
.waitForElementVisible("@petOperationPutExecuteBtn", 1000) .waitForElementVisible("@storeOperationDeleteExecuteBtn", 1000)
.click("@petOperationPutExecuteBtn") .click("@storeOperationDeleteExecuteBtn")
.waitForElementVisible("@petOperationPutMockCategoryID") .waitForElementVisible("@storeOperationGetResponseHeaders", "content-type: application/xml")
.assert.containsText("@petOperationPutMockCategoryID", "0") .click("@storeOperationDeleteTryBtn")
.assert.containsText("@petOperationPutMockCategoryName", "\"string\"") .assert.cssClassNotPresent("@storeOperationDeleteTryBtn", "cancel")
.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 get by ID /pet/{petId} api container", function (client) {
apiWrapper.waitForElementVisible("@petOperationGetByIdContainer", 5000)
.assert.containsText("@petOperationGetByIdTitle", "/pet/{petId}")
.click("@petOperationGetByIdCollpase")
.waitForElementVisible("@petOperationGetByIdCollapseContainer", 3000)
.click("@petOperationGetByIdTryBtn")
.waitForElementVisible("@petOperationGetByTagExecuteBtn", 1000)
.click("@petOperationGetByTagTryBtn")
.assert.cssClassNotPresent("@petOperationGetByTagTryBtn", "cancel")
client.end()
})
it("render get by ID /pet/{petId} api Mock data", function (client) {
apiWrapper.waitForElementVisible("@petOperationGetByIdContainer", 5000)
.assert.containsText("@petOperationGetByIdTitle", "/pet/{petId}")
.click("@petOperationGetByIdCollpase")
.waitForElementVisible("@petOperationGetByIdCollapseContainer", 3000)
.click("@petOperationGetByIdTryBtn")
.waitForElementVisible("@petOperationGetByTagExecuteBtn", 1000)
.setValue("@petOperationGetByIdParameter", "abc")
.click("@petOperationGetByIdExecuteBtn")
.waitForElementVisible("@petOperationGetByIdResultsBox")
.assert.containsText("@petOperationGetByIdParameter", "abc")
.assert.cssClassPresent("@petOperationGetByIdParameter", "invalid")
.assert.attributeEquals("@petOperationGetByIdParameter", "title", "Value must be an integer")
.click("@petOperationGetByTagTryBtn")
.assert.cssClassNotPresent("@petOperationGetByTagTryBtn", "cancel")
client.end()
})
it("render delete /pet api container", function (client) {
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() client.end()
}) })

View File

@@ -1,92 +1,77 @@
describe("render user api container", function(){ describe("Render Model Wrapper", function () {
let mainPage let modelWrapper, mainPage
let apiWrapper
beforeEach(function (client, done) { beforeEach(function (client, done) {
mainPage = client mainPage = client
.url("localhost:3230") .url("localhost:3230")
.page.main() .page.main()
client.waitForElementVisible(".download-url-input:not([disabled])", 5000) client.waitForElementVisible(".download-url-input:not([disabled])", 5000)
.clearValue(".download-url-input") .clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3230/test-specs/petstore.json") .setValue(".download-url-input", "http://localhost:3230/test-specs/petstore.json")
.click("button.download-url-button") .click("button.download-url-button")
.pause(1000) .pause(1000)
apiWrapper = mainPage.section.apiWrapper modelWrapper = mainPage.section.modelWrapper
done() done()
}) })
afterEach(function (client, done) { afterEach(function (client, done) {
done() done()
}) })
it("test rendered user container", function(client){ it("Render model wrapper", function (client) {
apiWrapper.waitForElementVisible("@userAPIWrapper", 5000) mainPage.expect.section("@modelWrapper").to.be.visible.before(5000)
.expect.element("@userAPIWrapper").to.be.visible
client.end() client.end()
}) })
it("callapse user wrapper", function(client){
apiWrapper.waitForElementVisible("@userAPIWrapper", 5000) it("Render model wrapper collapse", function (client) {
.click("@userAPIWrapperBar") modelWrapper.waitForElementVisible("@modelContainer", 5000)
.assert.cssClassNotPresent("@userAPIWrapper", "is-open") .click("@modelCollapse")
.assert.cssClassNotPresent("@modelContainer", "is-open")
client.end() client.end()
}) })
it("render put /user/{username} api container", function (client) {
apiWrapper.waitForElementVisible("@userOperationPutContainer", 5000) it("Testing order model", function (client) {
.assert.containsText("@userOperationPutTitle", "/user/{username}") modelWrapper.waitForElementVisible("@orderModel")
.click("@userOperationPutCollpase") .click("@orderModelCallapse")
.waitForElementVisible("@userOperationPutCollapseContainer", 3000) .assert.cssClassNotPresent("@orderModelCallapse", "callapsed")
.click("@userOperationPutTryBtn")
.waitForElementVisible("@userOperationPutExecuteBtn", 1000)
.click("@userOperationPutTryBtn")
.assert.cssClassNotPresent("@userOperationPutTryBtn", "cancel")
client.end() client.end()
}) })
it("Test put /user/{username} api Mock data", function (client) {
apiWrapper.waitForElementVisible("@userOperationPutContainer", 5000) it("Testing category model", function (client) {
.assert.containsText("@userOperationPutTitle", "/user/{username}") modelWrapper.waitForElementVisible("@categoryModel")
.click("@userOperationPutCollpase") .click("@categoryModelCallapse")
.waitForElementVisible("@userOperationPutCollapseContainer", 3000) .assert.cssClassNotPresent("@categoryModelCallapse", "callapsed")
.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() client.end()
}) })
it("render delete /user/{username} api container", function (client) { it("Testing user model", function (client) {
apiWrapper.waitForElementVisible("@userOperationDeleteContainer", 5000) modelWrapper.waitForElementVisible("@userModel")
.assert.containsText("@userOperationDeleteTitle", "/user/{username}") .click("@userModelCallapse")
.click("@userOperationDeleteCollpase") .assert.cssClassNotPresent("@userModelCallapse", "callapsed")
.waitForElementVisible("@userOperationDeleteCollapseContainer", 3000)
.click("@userOperationDeleteTryBtn")
.waitForElementVisible("@userOperationDeleteExecuteBtn", 1000)
.click("@userOperationDeleteTryBtn")
.assert.cssClassNotPresent("@userOperationDeleteTryBtn", "cancel")
client.end() client.end()
}) })
it("Test delete /user/{username} api Mock data", function (client) { it("Testing tag model", function (client) {
apiWrapper.waitForElementVisible("@userOperationDeleteContainer", 5000) modelWrapper.waitForElementVisible("@tagModel")
.assert.containsText("@userOperationDeleteTitle", "/user/{username}") .click("@tagModelCallapse")
.click("@userOperationDeleteCollpase") .assert.cssClassNotPresent("@tagModelCallapse", "callapsed")
.waitForElementVisible("@userOperationDeleteCollapseContainer", 3000)
.click("@userOperationDeleteTryBtn") client.end()
.waitForElementVisible("@userOperationDeleteParameter") })
.setValue("@userOperationDeleteParameter", "123") it("Testing pet model", function (client) {
.waitForElementVisible("@userOperationDeleteExecuteBtn", 1000) modelWrapper.waitForElementVisible("@petModel")
.click("userOperationDeleteExecuteBtn") .click("@petModelCallapse")
.waitForElementVisible("@userOperationDeleteResponseHeader") .assert.cssClassNotPresent("@petModelCallapse", "callapsed")
.assert.containsText("@userOperationDeleteResponseHeader", "content-type: application/xml")
.click("@userOperationDeleteTryBtn") client.end()
.assert.cssClassNotPresent("@userOperationDeleteTryBtn", "cancel") })
it("Testing apiResponse model", function (client) {
modelWrapper.waitForElementVisible("@apiResponseModel")
.click("@apiResponseModelCallapse")
.assert.cssClassNotPresent("@apiResponseModelCallapse", "callapsed")
client.end() client.end()
}) })