-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add division page * Merge package-lock * Fix types * Use type import * Set header values * Unit test fix
- Loading branch information
1 parent
2556e49
commit 3ff8ae5
Showing
29 changed files
with
5,658 additions
and
4,891 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
experimental/traffic-portal/nightwatch/page_objects/divisionDetail.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { EnhancedPageObject } from "nightwatch"; | ||
|
||
/** | ||
* Defines the PageObject for Division Details. | ||
*/ | ||
export type DivisionDetailPageObject = EnhancedPageObject<{}, typeof divisionDetailPageObject.elements>; | ||
|
||
const divisionDetailPageObject = { | ||
elements: { | ||
id: { | ||
selector: "input[name='id']" | ||
}, | ||
lastUpdated: { | ||
selector: "input[name='lastUpdated']" | ||
}, | ||
name: { | ||
selector: "input[name='name']" | ||
}, | ||
saveBtn: { | ||
selector: "button[type='submit']" | ||
} | ||
}, | ||
}; | ||
|
||
export default divisionDetailPageObject; |
46 changes: 46 additions & 0 deletions
46
experimental/traffic-portal/nightwatch/page_objects/divisionsTable.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { EnhancedPageObject, EnhancedSectionInstance, NightwatchAPI } from "nightwatch"; | ||
|
||
import { TABLE_COMMANDS, TableSectionCommands } from "../globals/tables"; | ||
|
||
/** | ||
* Defines the Divisions table commands | ||
*/ | ||
type DivisionsTableCommands = TableSectionCommands; | ||
|
||
/** | ||
* Defines the Page Object for the Divisions page. | ||
*/ | ||
export type DivisionsPageObject = EnhancedPageObject<{}, {}, | ||
EnhancedSectionInstance<DivisionsTableCommands>>; | ||
|
||
const divisionsPageObject = { | ||
api: {} as NightwatchAPI, | ||
sections: { | ||
divisionsTable: { | ||
commands: { | ||
...TABLE_COMMANDS | ||
}, | ||
elements: {}, | ||
selector: "mat-card" | ||
} | ||
}, | ||
url(): string { | ||
return `${this.api.launchUrl}/core/divisions`; | ||
} | ||
}; | ||
|
||
export default divisionsPageObject; |
42 changes: 42 additions & 0 deletions
42
experimental/traffic-portal/nightwatch/tests/cacheGroups/divisions/detail.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
describe("Division Detail Spec", () => { | ||
it("Test division", () => { | ||
const page = browser.page.divisionDetail(); | ||
browser.url(`${page.api.launchUrl}/core/divisions/${browser.globals.testData.division.id}`, res => { | ||
browser.assert.ok(res.status === 0); | ||
page.waitForElementVisible("mat-card") | ||
.assert.enabled("@name") | ||
.assert.enabled("@saveBtn") | ||
.assert.not.enabled("@id") | ||
.assert.not.enabled("@lastUpdated") | ||
.assert.valueEquals("@name", browser.globals.testData.division.name) | ||
.assert.valueEquals("@id", String(browser.globals.testData.division.id)); | ||
}); | ||
}); | ||
|
||
it("New division", () => { | ||
const page = browser.page.divisionDetail(); | ||
browser.url(`${page.api.launchUrl}/core/divisions/new`, res => { | ||
browser.assert.ok(res.status === 0); | ||
page.waitForElementVisible("mat-card") | ||
.assert.enabled("@name") | ||
.assert.enabled("@saveBtn") | ||
.assert.not.elementPresent("@id") | ||
.assert.not.elementPresent("@lastUpdated") | ||
.assert.valueEquals("@name", ""); | ||
}); | ||
}); | ||
}); |
24 changes: 24 additions & 0 deletions
24
experimental/traffic-portal/nightwatch/tests/cacheGroups/divisions/table.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
describe("Divisions Spec", () => { | ||
it("Loads elements", async () => { | ||
browser.page.divisionsTable().navigate() | ||
.waitForElementPresent("input[name=fuzzControl]"); | ||
browser.elements("css selector", "div.ag-row", rows => { | ||
browser.assert.ok(rows.status === 0); | ||
browser.assert.ok((rows.value as []).length >= 2); | ||
}); | ||
}); | ||
}); |
14 changes: 0 additions & 14 deletions
14
experimental/traffic-portal/nightwatch/tests/servers/servers.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.