-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/xaptc 51 #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Feature/xaptc 51 #78
Changes from all commits
8c0a689
f42fcad
ed56488
2b11f31
1f74b77
d1e5e5b
84059ed
291bfe8
2a6bef1
1bd0269
d8c709b
43a1510
31001ec
020d3dc
b6b800a
0709af4
2d4efec
9d74ecc
6f34ef8
7616d5c
30f4ddf
5abb19f
4a11a6c
f694823
82fd4ac
442f081
95f3962
b494d21
828ba5b
c26f592
1480c28
a1525cd
69ea9e4
f74a40a
20a3080
c952cd5
bd723d4
d9df638
6dc14f1
6c3e73b
722b44b
19e3712
f8f37d0
4fe0e12
1faec0e
63c014f
a73a783
1630bda
fc25aa4
55cc123
4defedc
b3e2318
6cefca5
eeaa7e9
5a1b7db
dcf8826
4567cce
3280fba
89ad72b
6573cf2
2b63d13
deee89a
8fc0746
21ca861
e474e32
1c9762e
58cc2fa
34899f4
ad16cec
ca64f04
4835ec8
0044ec3
20666c1
4f95a02
e32087b
b908807
3b3645c
9fda3c7
b0d938a
7e51977
c32cac6
7d86cb4
0532093
4ee17c5
ca40686
3f7944b
bd985e1
8399447
d98bb84
00f1a4b
c70db7c
52a7f52
a34fadc
64e9504
b844cab
a153b8d
d797838
28272e3
e8825d7
1352adc
629a102
8892cf3
6520e58
d80ddf7
8ee284d
53b56bf
8e1c191
b789e7d
7c48afb
95a1044
a74f8cd
f2e06cc
0be2910
f7ed628
97d6a12
1ab88a2
7c619cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,20 @@ | ||
|
|
||
| config/*.xml | ||
| !config/config.xml | ||
| *.iml | ||
| .idea | ||
| ui/ | ||
| automated-perf-test | ||
| uiServices/test/*.xml | ||
| *.bak | ||
| main | ||
| .idea | ||
| ui/ | ||
| **/node_modules | ||
| /.editorconfig | ||
| /.editorconfig | ||
| config/*.xml | ||
| !config/config.xml | ||
| *.iml | ||
| .idea | ||
| ui/ | ||
| automated-perf-test | ||
| uiServices/test/*.xml | ||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,23 +50,23 @@ type ResponseValue struct { | |
|
|
||
| // TestDefinition encapsulates the XML data. | ||
| type TestDefinition struct { | ||
| XMLName xml.Name `xml:"testDefinition" json:"testDefinition"` | ||
| TestName string `xml:"testName" json:"testName"` | ||
| OverrideHost string `xml:"overrideHost" json:"overrideHost"` | ||
| OverridePort string `xml:"overridePort" json:"overridePort"` | ||
| HTTPMethod string `xml:"httpMethod" json:"httpMethod"` | ||
| Description string `xml:"description" json:"description"` | ||
| BaseURI string `xml:"baseUri" json:"baseUri"` | ||
| Multipart bool `xml:"multipart" json:"multipart"` | ||
| Payload string `xml:"payload" json:"payload"` | ||
| MultipartPayload []multipartFormField `xml:"multipartPayload>multipartFormField" json:"multipartPayload"` | ||
| ResponseStatusCode int `xml:"responseStatusCode" json:"responseStatusCode"` | ||
| ResponseContentType string `xml:"responseContentType" json:"responseContentType"` | ||
| Headers []Header `xml:"headers>header" json:"headers"` | ||
| ResponseValues []ResponseValue `xml:"responseProperties>value" json:"responseValues"` | ||
| PreThinkTime int64 | ||
| PostThinkTime int64 | ||
| ExecWeight string | ||
| XMLName xml.Name `xml:"testDefinition"` | ||
| TestName string `xml:"testName"` | ||
| OverrideHost string `xml:"overrideHost"` | ||
| OverridePort string `xml:"overridePort"` | ||
| HTTPMethod string `xml:"httpMethod"` | ||
| Description string `xml:"description"` | ||
| BaseURI string `xml:"baseUri"` | ||
| Multipart bool `xml:"multipart"` | ||
| Payload string `xml:"payload"` | ||
| MultipartPayload []multipartFormField `xml:"multipartPayload>multipartFormField"` | ||
| ResponseStatusCode int `xml:"responseStatusCode"` | ||
| ResponseContentType string `xml:"responseContentType"` | ||
| Headers []Header `xml:"headers>header"` | ||
| ResponseValues []ResponseValue `xml:"responseProperties>value"` | ||
| PreThinkTime int64 `xml:"preThinkTime"` | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't include this change (prethinktime, postthinktime, execweight). @ConorSmyth Should this be merging to develop? |
||
| PostThinkTime int64 `xml:"postThinkTime"` | ||
| ExecWeight string `xml:"execWeight"` | ||
| } | ||
|
|
||
| // TestSuite fields get populated from the TestSuiteDefinition after the XML | ||
|
|
@@ -75,17 +75,18 @@ type TestSuite struct { | |
| XMLName xml.Name `xml:"testSuite"` | ||
| Name string `xml:"name" json:"name"` | ||
| Description string `xml:"description" json:"description"` | ||
| TestStrategy string `xml:"testStrategy" json:"testStrategy"` | ||
| TestCases []TestCase `xml:"testCases>testCase" json:"testCases"` | ||
| TestStrategy string `xml:"testStrategy"` | ||
| TestCases []TestCase `xml:"testCases>testCase"` | ||
| TestDefinitions []*TestDefinition | ||
| } | ||
|
|
||
| // TestCase is used to encapsulate and marshal a <testCase> tag from the | ||
| // <testSuite> XML file. This data will then be consolidated into | ||
| // the TestSuite/TestDefinition data structure for usage. | ||
| type TestCase struct { | ||
| XMLName xml.Name `xml:"testCase" json:"testCase"` | ||
| XMLName xml.Name `xml:"testCase"` | ||
| Name string `xml:",chardata"` | ||
| Description string `xml:"description,attr" json:"description"` | ||
| PreThinkTime int64 `xml:"preThinkTime,attr" json:"preThinkTime"` | ||
| PostThinkTime int64 `xml:"postThinkTime,attr" json:"postThinkTime"` | ||
| ExecWeight string `xml:"execWeight,attr" json:"execWeight"` | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
|
|
||
| import { | ||
| browser, | ||
| element, | ||
|
|
@@ -20,7 +21,7 @@ const configPO: ConfigurationPageObject = new ConfigurationPageObject(); | |
|
|
||
| describe("configuration component", () => { | ||
| beforeEach(() => { | ||
| browser.get("http://localhost:9191"); | ||
| browser.get("/"); | ||
| browser.executeScript("window.onbeforeunload = function(e){};"); | ||
| browser.driver | ||
| .manage() | ||
|
|
@@ -29,18 +30,13 @@ describe("configuration component", () => { | |
| }); | ||
|
|
||
| it("should create xml file", () => { | ||
| configPO.setConfigData(); | ||
| configPO.submitBtn.click(); | ||
| expect(configPO.toastrMessage.getText()).toContain( | ||
| "Your data has been saved!" | ||
| ); | ||
| configPO.setConfigData(); //Act | ||
| configPO.submitBtn.click(); //Action | ||
| expect(configPO.toastrMessage.getText()).toEqual( | ||
| "Success!\nYour data has been saved!" | ||
| ); //Assert | ||
| }); | ||
|
|
||
| it("should show submit button is disabled when requiredFields data is blank", () => { | ||
| // used to clear default data in this test | ||
| configPO.checkRequiredFields(); | ||
| expect(configPO.submitBtn.isEnabled()).toBe(false); | ||
| }); | ||
|
|
||
| it("should check that all text box names are correct", () => { | ||
| configPO.setConfigData(); | ||
|
|
@@ -63,30 +59,31 @@ describe("configuration component", () => { | |
| ); | ||
| }); | ||
|
|
||
| it("should check values of existing file are as expected", () => { | ||
| configPO.configFilePath.sendKeys(configPO.absolutePath); | ||
| configPO.xmlFileName.sendKeys("config.xml"); | ||
| configPO.cancelBtn.click(); | ||
| expect(configPO.applicationName.getAttribute("value")).toEqual("config"); | ||
| expect(configPO.targetHost.getAttribute("value")).toEqual("localhost"); | ||
| expect(configPO.targetPort.getAttribute("value")).toEqual("8080"); | ||
| expect(configPO.testCaseDir.getAttribute("value")).toEqual( | ||
| "./definitions/testCases" | ||
| ); | ||
| expect(configPO.baseStatsDir.getAttribute("value")).toEqual("./envStats"); | ||
| expect(configPO.memoryEndpoint.getAttribute("value")).toEqual( | ||
| "/alt/debug/vars" | ||
| ); | ||
| expect(configPO.reportsDir.getAttribute("value")).toEqual("./report"); | ||
| expect(configPO.numIterations.getAttribute("value")).toEqual("1000"); | ||
| expect(configPO.memoryVariance.getAttribute("value")).toEqual("15"); | ||
| expect(configPO.serviceVariance.getAttribute("value")).toEqual("15"); | ||
| expect(configPO.concurrentUsers.getAttribute("value")).toEqual("50"); | ||
| expect(configPO.requestDelay.getAttribute("value")).toEqual("5000"); | ||
| expect(configPO.tpsFreq.getAttribute("value")).toEqual("30"); | ||
| expect(configPO.rampDelay.getAttribute("value")).toEqual("15"); | ||
| expect(configPO.rampUsers.getAttribute("value")).toEqual("5"); | ||
| }); | ||
| // it("should check values of existing file are as expected", () => { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. commented out tests? |
||
| // configPO.configFilePath.sendKeys(configPO.absolutePath); | ||
| // configPO.xmlFileName.sendKeys("config"); | ||
| // configPO.cancelBtn.click(); | ||
| // expect(configPO.applicationName.getAttribute("value")).toEqual("config"); | ||
| // expect(configPO.targetHost.getAttribute("value")).toEqual("localhost"); | ||
| // expect(configPO.targetPort.getAttribute("value")).toEqual("8080"); | ||
| // expect(configPO.testCaseDir.getAttribute("value")).toEqual( | ||
| // "./definitions/testCases" | ||
| // ); | ||
| // expect(configPO.baseStatsDir.getAttribute("value")).toEqual("./envStats"); | ||
| // expect(configPO.memoryEndpoint.getAttribute("value")).toEqual( | ||
| // "/alt/debug/vars" | ||
| // ); | ||
| // expect(configPO.reportsDir.getAttribute("value")).toEqual("./report"); | ||
| // expect(configPO.numIterations.getAttribute("value")).toEqual("1000"); | ||
| // expect(configPO.memoryVariance.getAttribute("value")).toEqual("15"); | ||
| // expect(configPO.serviceVariance.getAttribute("value")).toEqual("15"); | ||
| // expect(configPO.concurrentUsers.getAttribute("value")).toEqual("50"); | ||
| // expect(configPO.requestDelay.getAttribute("value")).toEqual("5000"); | ||
| // expect(configPO.tpsFreq.getAttribute("value")).toEqual("30"); | ||
| // expect(configPO.rampDelay.getAttribute("value")).toEqual("15"); | ||
| // expect(configPO.rampUsers.getAttribute("value")).toEqual("15"); | ||
| // }); | ||
|
|
||
|
|
||
| it("should throw error when file path does not exist", () => { | ||
| configPO.setConfigData(); | ||
|
|
@@ -228,18 +225,17 @@ describe("configuration component", () => { | |
|
|
||
| it("should update existing file", () => { | ||
| configPO.configFilePath.sendKeys(configPO.absolutePath); | ||
| configPO.xmlFileName.sendKeys("config.xml"); | ||
| configPO.xmlFileName.sendKeys("config"); | ||
| configPO.cancelBtn.click(); | ||
| configPO.numIterations.sendKeys(5); | ||
| configPO.btnUpdate.click(); | ||
| configPO.numIterations.sendKeys(Key.BACK_SPACE); | ||
| configPO.cancelBtn.click(); | ||
|
|
||
| configPO.getConfigFileBtn.click(); | ||
|
|
||
| expect(configPO.numIterations.getAttribute("value")).toEqual("10005"); | ||
| }); | ||
|
|
||
| it("should show update button is disabled when Xml File Name is blank", () => { | ||
| expect(configPO.btnUpdate.isEnabled()).toBe(false); | ||
| expect(configPO.btnUpdate.isPresent()).toBe(false); | ||
| }); | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| import { | ||
| browser, | ||
| element, | ||
| by, | ||
| By, | ||
| $, | ||
| $$, | ||
| ExpectedConditions, | ||
| protractor, | ||
| WebDriver, | ||
| Key | ||
| } from "protractor"; | ||
| import { read } from "fs"; | ||
| import { Input } from "@angular/core/src/metadata/directives"; | ||
| import { ToastModule } from "ng2-toastr/ng2-toastr"; | ||
| const since = require("jasmine2-custom-message"); | ||
|
|
||
| import TestCasePageObject = require("../pages/testCases-PO"); | ||
| const testCasePO: TestCasePageObject = new TestCasePageObject(); | ||
|
|
||
|
|
||
| describe("test cases component", () => { | ||
| beforeEach(() => { | ||
| browser.get("/"); | ||
| browser.executeScript("window.onbeforeunload = function(e){};"); | ||
| browser.driver | ||
| .manage() | ||
| .window() | ||
| .maximize(); | ||
| }); | ||
|
|
||
|
|
||
| fit('should create a new test case file', () => { | ||
| testCasePO.setTestCasesPage(); | ||
| testCasePO.setTestCaseData(); | ||
| testCasePO.btnSave.click(); | ||
| expect(testCasePO.toastrMessage.getText()).toEqual( | ||
| "Success!\nYour data has been saved!" | ||
| ); | ||
| }); | ||
|
|
||
| fit("should check that all text box names are correct", () => { | ||
| testCasePO.setTestCasesPage(); | ||
| testCasePO.setTestCaseData(); | ||
| expect(testCasePO.labels.get(0).getText()).toContain("Testname"); | ||
| expect(testCasePO.labels.get(1).getText()).toContain("Description"); | ||
| expect(testCasePO.labels.get(2).getText()).toContain("Base URI"); | ||
| expect(testCasePO.labels.get(3).getText()).toContain("Override Host"); | ||
| expect(testCasePO.labels.get(4).getText()).toContain("Multipart"); | ||
| expect(testCasePO.labels.get(5).getText()).toContain("Override Port"); | ||
| expect(testCasePO.labels.get(6).getText()).toContain("Payload"); | ||
| expect(testCasePO.labels.get(7).getText()).toContain("Http Method"); | ||
| expect(testCasePO.labels.get(8).getText()).toContain("Headers"); | ||
| expect(testCasePO.labels.get(11).getText()).toContain("Pre Think Time"); | ||
| expect(testCasePO.labels.get(12).getText()).toContain("Post Think Time"); | ||
| expect(testCasePO.labels.get(13).getText()).toContain("Exec Weight"); | ||
| expect(testCasePO.labels.get(14).getText()).toContain("Response Status Code"); | ||
| expect(testCasePO.labels.get(15).getText()).toContain("Response Content Type"); | ||
| expect(testCasePO.labels.get(16).getText()).toContain("Multipart Payload"); | ||
|
|
||
|
|
||
| }); | ||
|
|
||
|
|
||
| fit("should throw error when a test case file path does not exist", () => { | ||
| testCasePO.setTestCasesPage(); | ||
| testCasePO.setTestCaseData(); | ||
| testCasePO.testCaseDir.sendKeys("/path/to/bad/location"); | ||
| testCasePO.btnSave.click(); | ||
| expect(testCasePO.toastrMessage.getText()).toContain( | ||
| "Some of the fields do not conform to the schema" | ||
| ); | ||
| }); | ||
|
|
||
| fit("should check requiredFields warning appears when requiredFields input is blank", () => { | ||
| testCasePO.setTestCasesPage(); | ||
| testCasePO.checkRequiredFields(); | ||
| expect(testCasePO.requiredFields.get(0).getText()).toContain("This field is required."); | ||
| expect(testCasePO.requiredFields.get(1).getText()).toContain("This field is required."); | ||
| expect(testCasePO.requiredFields.get(2).getText()).toContain("This field is required."); | ||
| expect(testCasePO.requiredFields.get(3).getText()).toContain("This field is required."); | ||
| expect(testCasePO.requiredFields.get(4).getText()).toContain("This field is required."); | ||
| expect(testCasePO.requiredFields.get(5).getText()).toContain("This field is required."); | ||
| expect(testCasePO.requiredFields.get(6).getText()).toContain("This field is required."); | ||
| expect(testCasePO.requiredFields.get(7).getText()).toContain("This field is required."); | ||
| expect(testCasePO.requiredFields.get(8).getText()).toContain("This field is required."); | ||
|
|
||
| }); | ||
|
|
||
| fit("should show that string cannot be entered into a integer field", () => { | ||
| testCasePO.setTestCasesPage(); | ||
| testCasePO.checkForStrings(); | ||
| expect(testCasePO.postThinkTime.getAttribute("value")).toEqual(""); | ||
| expect(testCasePO.preThinkTime.getAttribute("value")).toEqual(""); | ||
| expect(testCasePO.responseStatusCode.getAttribute("value")).toEqual(""); | ||
| }); | ||
|
|
||
|
|
||
| fit("should check that e is not accepted in integer field", () =>{ | ||
| testCasePO.setTestCasesPage(); | ||
| testCasePO.checkEisNotAccepted(); | ||
| expect(testCasePO.requiredFields.get(0).getText()).toContain("This field is required."); | ||
| expect(testCasePO.requiredFields.get(1).getText()).toContain("This field is required."); | ||
| expect(testCasePO.requiredFields.get(2).getText()).toContain("This field is required."); | ||
| }); | ||
|
|
||
| fit("should check that warning appears if negative number is enter to integer field", () => { | ||
| testCasePO.setTestCasesPage(); | ||
| testCasePO.checkNegativeValues(); | ||
| //browser.sleep(10000); | ||
| expect(testCasePO.requiredFields.get(0).getText()).toContain("Must be 1 or more"); | ||
| expect(testCasePO.requiredFields.get(1).getText()).toContain("Must be 1 or more"); | ||
| expect(testCasePO.requiredFields.get(2).getText()).toContain("Must be 1 or more"); | ||
| }); | ||
|
|
||
|
|
||
|
|
||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate of lines 1-7?