Commit 07966ca2 authored by shota niioka's avatar shota niioka Committed by Yas Naoi
Browse files

Issue #3282577: Add a BDD test suite for K8s Deployments (Read and Update)

parent e3f3b1b7
Loading
Loading
Loading
Loading
+57 −2
Original line number Diff line number Diff line
@minimal @ci_job
Feature: Create and delete a Deployment for K8s as "Authenticated User"
Feature: Create, read, update and delete a Deployment for K8s as "Authenticated User"

  @api @javascript
  Scenario: Create a Deployment
@@ -37,6 +37,61 @@ Feature: Create and delete a Deployment for K8s as "Authenticated User"
    And I should see neither error nor warning messages
    And I should see "{{ namespace }}" in the "{{ deployment_name }}" row

  @api @javascript
  Scenario: Read the Deployment
    Given I am logged in as user "{{ user_name }}"
    When I visit "/clouds/k8s/{{ cloud_context }}/deployment"
    And I click "Refresh"
    And I should see the link "{{ deployment_name }}"
    And I wait {{ wait }} milliseconds
    And I click "{{ deployment_name }}"
    Then the url should match "/clouds/k8s/{{ cloud_context }}/deployment/"
    And I should see "{{ deployment_name }}"
    And I should see "{{ namespace }}"
    And I should see neither error nor warning messages

  @api @javascript
  Scenario: Update the Deployment
    Given I am logged in as user "{{ user_name }}"
    When I visit "/clouds/k8s/{{ cloud_context }}/deployment"
    And I click "Refresh"
    And I should see the link "{{ deployment_name }}"
    And I wait {{ wait }} milliseconds
    And I click "{{ deployment_name }}"
    Then the url should match "/clouds/k8s/{{ cloud_context }}/deployment/"
    And I click "Edit"
    """
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: {{ deployment_name }}
      labels:
        app: {{ app_name }}
    spec:
      replicas: {{ replica_count_edit }}
      selector:
        matchLabels:
          app: {{ app_name }}
      template:
        metadata:
          labels:
            app: {{ app_name }}
        spec:
          containers:
          - name: {{ container_name }}
            image: {{ image_version }}
            ports:
            - containerPort: {{ port }}
    """
    And I press "Save"
    And I wait for AJAX to finish
    Then the url should match "/clouds/k8s/{{ cloud_context }}/deployment"
    And I should see the success message "has been updated"
    And I should see neither error nor warning messages
    And I click "{{ deployment_name }}"
    Then the url should match "/clouds/k8s/{{ cloud_context }}/deployment/"
    And I should see "{{ replica_count_edit }}"

  @api @javascript
  Scenario: Delete the Deployment
    Given I am logged in as user "{{ user_name }}"
@@ -45,7 +100,7 @@ Feature: Create and delete a Deployment for K8s as "Authenticated User"
    And I should see the link "{{ deployment_name }}"
    And I wait {{ wait }} milliseconds
    And I click "{{ deployment_name }}"
    And the url should match "/{{ cloud_context }}/deployment/"
    Then the url should match "/clouds/k8s/{{ cloud_context }}/deployment/"
    And I click "Delete" in the "actions"
    And the url should match "/delete"
    And I press "Delete"