2018-09-12 19:41:43 +00:00
|
|
|
@setupApplicationTest
|
2019-12-17 18:47:37 +00:00
|
|
|
Feature: dc / intentions / create: Intention Create
|
2018-09-12 19:41:43 +00:00
|
|
|
In order to define intentions
|
|
|
|
As a user
|
|
|
|
I want to visit the intention create page, fill in the form and hit the create button and see a success notification
|
2021-01-04 17:22:10 +00:00
|
|
|
@onlyNamespaceable
|
|
|
|
Scenario: with namespaces enabled
|
|
|
|
Given 1 datacenter model with the value "datacenter"
|
|
|
|
And 3 service models from yaml
|
|
|
|
---
|
|
|
|
- Name: web
|
|
|
|
Kind: ~
|
|
|
|
- Name: db
|
|
|
|
Kind: ~
|
|
|
|
- Name: cache
|
|
|
|
Kind: ~
|
|
|
|
---
|
2021-09-22 09:21:20 +00:00
|
|
|
And 1 nspace model from yaml
|
|
|
|
---
|
|
|
|
- Name: nspace-0
|
|
|
|
---
|
2021-01-04 17:22:10 +00:00
|
|
|
When I visit the intention page for yaml
|
|
|
|
---
|
|
|
|
dc: datacenter
|
|
|
|
---
|
|
|
|
Then the url should be /datacenter/intentions/create
|
|
|
|
And the title should be "New Intention - Consul"
|
|
|
|
# Set source
|
|
|
|
And I click "[data-test-source-element] .ember-power-select-trigger"
|
|
|
|
And I type "web" into ".ember-power-select-search-input"
|
|
|
|
And I click ".ember-power-select-option:first-child"
|
|
|
|
Then I see the text "web" in "[data-test-source-element] .ember-power-select-selected-item"
|
|
|
|
# Set destination
|
|
|
|
And I click "[data-test-destination-element] .ember-power-select-trigger"
|
|
|
|
And I type "db" into ".ember-power-select-search-input"
|
|
|
|
And I click ".ember-power-select-option:first-child"
|
|
|
|
Then I see the text "db" in "[data-test-destination-element] .ember-power-select-selected-item"
|
2021-09-22 09:21:20 +00:00
|
|
|
# Set source nspace
|
|
|
|
And I click "[data-test-source-nspace] .ember-power-select-trigger"
|
2021-09-24 12:04:41 +00:00
|
|
|
And I click ".ember-power-select-option:last-child"
|
2021-09-22 09:21:20 +00:00
|
|
|
Then I see the text "nspace-0" in "[data-test-source-nspace] .ember-power-select-selected-item"
|
|
|
|
# Set destination nspace
|
|
|
|
And I click "[data-test-destination-nspace] .ember-power-select-trigger"
|
2021-09-24 12:04:41 +00:00
|
|
|
And I click ".ember-power-select-option:last-child"
|
2021-09-22 09:21:20 +00:00
|
|
|
Then I see the text "nspace-0" in "[data-test-destination-nspace] .ember-power-select-selected-item"
|
2021-01-04 17:22:10 +00:00
|
|
|
# Specifically set deny
|
2021-03-09 09:30:01 +00:00
|
|
|
And I click ".value-deny"
|
2021-01-04 17:22:10 +00:00
|
|
|
And I submit
|
2021-09-24 16:31:58 +00:00
|
|
|
Then a PUT request was made to "/v1/connect/intentions/exact?source=default%2Fnspace-0%2Fweb&destination=default%2Fnspace-0%2Fdb&dc=datacenter" from yaml
|
2021-09-22 09:21:20 +00:00
|
|
|
---
|
|
|
|
body:
|
|
|
|
SourceName: web
|
|
|
|
DestinationName: db
|
|
|
|
SourceNS: nspace-0
|
|
|
|
DestinationNS: nspace-0
|
2021-09-24 16:31:58 +00:00
|
|
|
SourcePartition: default
|
|
|
|
DestinationPartition: default
|
2021-09-22 09:21:20 +00:00
|
|
|
Action: deny
|
|
|
|
---
|
2021-01-04 17:22:10 +00:00
|
|
|
Then the url should be /datacenter/intentions
|
|
|
|
And the title should be "Intentions - Consul"
|
|
|
|
And "[data-notification]" has the "notification-update" class
|
|
|
|
And "[data-notification]" has the "success" class
|
|
|
|
@notNamespaceable
|
|
|
|
Scenario: with namespaces disabled
|
2018-09-12 19:41:43 +00:00
|
|
|
Given 1 datacenter model with the value "datacenter"
|
2019-12-17 18:47:37 +00:00
|
|
|
And 3 service models from yaml
|
|
|
|
---
|
|
|
|
- Name: web
|
|
|
|
Kind: ~
|
|
|
|
- Name: db
|
|
|
|
Kind: ~
|
|
|
|
- Name: cache
|
|
|
|
Kind: ~
|
|
|
|
---
|
2018-09-12 19:41:43 +00:00
|
|
|
When I visit the intention page for yaml
|
|
|
|
---
|
|
|
|
dc: datacenter
|
|
|
|
---
|
|
|
|
Then the url should be /datacenter/intentions/create
|
2020-01-28 14:25:52 +00:00
|
|
|
And the title should be "New Intention - Consul"
|
2018-09-12 19:41:43 +00:00
|
|
|
# Set source
|
|
|
|
And I click "[data-test-source-element] .ember-power-select-trigger"
|
|
|
|
And I type "web" into ".ember-power-select-search-input"
|
|
|
|
And I click ".ember-power-select-option:first-child"
|
|
|
|
Then I see the text "web" in "[data-test-source-element] .ember-power-select-selected-item"
|
|
|
|
# Set destination
|
|
|
|
And I click "[data-test-destination-element] .ember-power-select-trigger"
|
|
|
|
And I type "db" into ".ember-power-select-search-input"
|
|
|
|
And I click ".ember-power-select-option:first-child"
|
|
|
|
Then I see the text "db" in "[data-test-destination-element] .ember-power-select-selected-item"
|
2018-09-13 08:10:18 +00:00
|
|
|
# Specifically set deny
|
2021-03-09 09:30:01 +00:00
|
|
|
And I click ".value-deny"
|
2018-09-12 19:41:43 +00:00
|
|
|
And I submit
|
2021-09-24 16:31:58 +00:00
|
|
|
Then a PUT request was made to "/v1/connect/intentions/exact?source=default%2Fdefault%2Fweb&destination=default%2Fdefault%2Fdb&dc=datacenter" from yaml
|
2018-09-12 19:41:43 +00:00
|
|
|
---
|
2020-07-09 09:08:47 +00:00
|
|
|
body:
|
|
|
|
SourceName: web
|
|
|
|
DestinationName: db
|
|
|
|
Action: deny
|
2018-09-12 19:41:43 +00:00
|
|
|
---
|
|
|
|
Then the url should be /datacenter/intentions
|
2020-01-28 14:25:52 +00:00
|
|
|
And the title should be "Intentions - Consul"
|
2020-07-09 09:08:47 +00:00
|
|
|
And "[data-notification]" has the "notification-update" class
|
2018-09-12 19:41:43 +00:00
|
|
|
And "[data-notification]" has the "success" class
|