github.com/rposudnevskiy/consul@v1.4.5/ui-v2/tests/acceptance/dc/kvs/update.feature (about)

     1  @setupApplicationTest
     2  Feature: dc / kvs / update: KV Update
     3    Background:
     4      Given 1 datacenter model with the value "datacenter"
     5    Scenario: Update to [Name] change value to [Value]
     6      And 1 kv model from yaml
     7      ---
     8        Key: "[Name]"
     9      ---
    10      When I visit the kv page for yaml
    11      ---
    12        dc: datacenter
    13        kv: "[Name]"
    14      ---
    15      Then the url should be /datacenter/kv/[EncodedName]/edit
    16      # Turn the Code Editor off so we can fill the value easier
    17      And I click "[name=json]"
    18      Then I fill in with yaml
    19      ---
    20        value: [Value]
    21      ---
    22      And I submit
    23      Then a PUT request is made to "/v1/kv/[EncodedName]?dc=datacenter" with the body "[Value]"
    24      And "[data-notification]" has the "notification-update" class
    25      And "[data-notification]" has the "success" class
    26    Where:
    27        ---------------------------------------------------------
    28        | Name            | EncodedName          | Value        |
    29        | key             | key                  | value        |
    30        | #key            | %23key               | value        |
    31        | key-name        | key-name             | a value      |
    32        | key name        | key%20name           | a value      |
    33        | folder/key-name | folder/key-name      | a value      |
    34        ---------------------------------------------------------
    35    Scenario: Update to a key change value to '   '
    36      And 1 kv model from yaml
    37      ---
    38        Key: key
    39      ---
    40      When I visit the kv page for yaml
    41      ---
    42        dc: datacenter
    43        kv: key
    44      ---
    45      Then the url should be /datacenter/kv/key/edit
    46      # Turn the Code Editor off so we can fill the value easier
    47      And I click "[name=json]"
    48      Then I fill in with yaml
    49      ---
    50        value: '   '
    51      ---
    52      And I submit
    53      Then a PUT request is made to "/v1/kv/key?dc=datacenter" with the body "   "
    54      Then the url should be /datacenter/kv
    55      And "[data-notification]" has the "notification-update" class
    56      And "[data-notification]" has the "success" class
    57    Scenario: Update to a key change value to ''
    58      And 1 kv model from yaml
    59      ---
    60        Key: key
    61      ---
    62      When I visit the kv page for yaml
    63      ---
    64        dc: datacenter
    65        kv: key
    66      ---
    67      Then the url should be /datacenter/kv/key/edit
    68      # Turn the Code Editor off so we can fill the value easier
    69      And I click "[name=json]"
    70      Then I fill in with yaml
    71      ---
    72        value: ''
    73      ---
    74      And I submit
    75      Then a PUT request is made to "/v1/kv/key?dc=datacenter" with no body
    76      Then the url should be /datacenter/kv
    77      And "[data-notification]" has the "notification-update" class
    78      And "[data-notification]" has the "success" class
    79    Scenario: Update to a key when the value is empty
    80      And 1 kv model from yaml
    81      ---
    82      Key: key
    83      Value: ~
    84      ---
    85      When I visit the kv page for yaml
    86      ---
    87        dc: datacenter
    88        kv: key
    89      ---
    90      Then the url should be /datacenter/kv/key/edit
    91      And I submit
    92      Then a PUT request is made to "/v1/kv/key?dc=datacenter" with no body
    93      Then the url should be /datacenter/kv
    94      And "[data-notification]" has the "notification-update" class
    95      And "[data-notification]" has the "success" class
    96    Scenario: There was an error saving the key
    97      When I visit the kv page for yaml
    98      ---
    99        dc: datacenter
   100        kv: key
   101      ---
   102      Then the url should be /datacenter/kv/key/edit
   103  
   104      Given the url "/v1/kv/key" responds with a 500 status
   105      And I submit
   106      Then the url should be /datacenter/kv/key/edit
   107      Then "[data-notification]" has the "notification-update" class
   108      And "[data-notification]" has the "error" class
   109  @ignore
   110    Scenario: KV's with spaces are saved correctly
   111      Then ok
   112  @ignore
   113    Scenario: KV's with returns are saved correctly
   114      Then ok