Skip to content
Snippets Groups Projects
Commit eb8b3168 authored by Takumaru Sekine's avatar Takumaru Sekine Committed by Yas Naoi
Browse files

Issue #3302049 by sekinet, kumikoono, yas: Add a BDD test suite for K8s Deployment Schedules

parent 211c8c71
Branches
Tags
3 merge requests!1759Issue #3356778: Release 5.1.1,!1679Issue #3349074: Fix the OpenStack Project create and edit form in SPA that "Member" cannot be saved due to a validation error,!1607Issue #3343582: Add the function to preview OpenStack stack in the SPA
...@@ -25,6 +25,7 @@ Feature: Create a Drupal role for K8s and a user as "Administrator" ...@@ -25,6 +25,7 @@ Feature: Create a Drupal role for K8s and a user as "Administrator"
And I check the box "Launch approved cloud launch template" And I check the box "Launch approved cloud launch template"
# Temporarily adds any permissions. # Temporarily adds any permissions.
And I check the box "View any K8s pod" And I check the box "View any K8s pod"
And I check the box "View any K8s deployment"
And I press "Save permissions" And I press "Save permissions"
And I should see the success message "The changes have been saved." And I should see the success message "The changes have been saved."
And I should see neither error nor warning messages And I should see neither error nor warning messages
......
@minimal @ci_job
Feature: Create and delete a deployment for K8s as "Authenticated User"
@api @javascript
Scenario: Create a Deployment Schedules
Given I am logged in as user "{{ user_name }}"
When I visit "/clouds/k8s/{{ cloud_context }}/deployment/add"
And I should see the heading "Add Deployment"
And I select "{{ namespace }}" from "Namespace"
And I fill in "Detail" with:
"""
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ deployment_name }}
labels:
app: {{ app_name }}
spec:
replicas: {{ replica_count }}
selector:
matchLabels:
app: {{ app_name }}
template:
metadata:
labels:
app: {{ app_name }}
spec:
containers:
- name: {{ container_name }}
image: {{ image_version }}
ports:
- containerPort: {{ port }}
"""
And I check the box "Enable time scheduler"
And I select "{{ start_elapsed_minute }}" minutes later now from the start-up time
And I select "{{ stop_elapsed_minute }}" minutes later now from the stop time
When I press "Save"
And I wait for AJAX to finish
And the url should match "/clouds/k8s/{{ cloud_context }}/deployment"
And I should see the success message "has been created"
And I should see neither error nor warning messages
# Visit schedule edit view to see start-up time.
When I visit "/clouds/k8s/{{ cloud_context }}/schedule"
Then I should see the link "{{ namespace }}_{{ deployment_name }}"
And I click "{{ namespace }}_{{ deployment_name }}"
And I click "Edit"
When I wait until start-up time for schedule
And I visit "/clouds/k8s/{{ cloud_context }}/deployment"
Given I run drush cron
Then I click "Refresh"
And I should see "{{ deployment_name }}" in the "{{ namespace }}" row
# Visit schedule edit view to see stop time.
When I visit "/clouds/k8s/{{ cloud_context }}/schedule"
Then I should see the link "{{ namespace }}_{{ deployment_name }}"
And I click "{{ namespace }}_{{ deployment_name }}"
And I click "Edit"
When I wait until stop time for schedule
And I visit "/clouds/k8s/{{ cloud_context }}/deployment"
Given I run drush cron
Then I click "Refresh"
And I should not see the link "{{ deployment_name }}"
@api @javascript
Scenario: Read the Deployment Schedules
Given I am logged in as user "{{ user_name }}"
When I visit "/clouds/k8s/{{ cloud_context }}/schedule"
And I should see "{{ namespace }}_{{ deployment_name }}" in the "{{ namespace }}" row
And I click "{{ namespace }}_{{ deployment_name }}"
And the url should match "clouds/k8s/{{ cloud_context }}/schedule/"
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 Schedules
Given I am logged in as user "{{ user_name }}"
When I visit "/clouds/k8s/{{ cloud_context }}/schedule"
And I should see the link "{{ namespace }}_{{ deployment_name }}"
And I click "{{ namespace }}_{{ deployment_name }}"
Then the url should match "/clouds/k8s/{{ cloud_context }}/schedule/"
And I click "Edit"
And I select "{{ start_elapsed_minute }}" minutes later now from the start-up time
And I select "{{ stop_elapsed_minute }}" minutes later now from the stop time
And I press "Save"
And I wait for AJAX to finish
Then the url should match "/clouds/k8s/{{ cloud_context }}/schedule"
And I should see the success message "has been updated"
And I should see neither error nor warning messages
And I click "{{ namespace }}_{{ deployment_name }}"
Then the url should match "/clouds/k8s/{{ cloud_context }}/schedule/"
# Visit schedule edit view to see start-up time.
And I click "Edit"
When I wait until start-up time for schedule
And I visit "/clouds/k8s/{{ cloud_context }}/deployment"
Given I run drush cron
Then I click "Refresh"
And I should see "{{ deployment_name }}" in the "{{ namespace }}" row
# Visit schedule edit view to see stop time.
When I visit "/clouds/k8s/{{ cloud_context }}/schedule"
Then I should see the link "{{ namespace }}_{{ deployment_name }}"
And I click "{{ namespace }}_{{ deployment_name }}"
And I click "Edit"
When I wait until stop time for schedule
And I visit "/clouds/k8s/{{ cloud_context }}/deployment"
Given I run drush cron
Then I click "Refresh"
And I should not see the link "{{ deployment_name }}"
@api @javascript
Scenario: Delete the Deployment Schedules
Given I am logged in as user "{{ user_name }}"
When I visit "/clouds/k8s/{{ cloud_context }}/schedule"
And I should see the link "{{ namespace }}_{{ deployment_name }}"
And I click "{{ namespace }}_{{ deployment_name }}"
And the url should match "/k8s/{{ cloud_context }}/schedule/"
And I click "Delete" in the "actions"
And the url should match "/delete"
And I press "Delete"
And I wait for AJAX to finish
Then I should be on "/clouds/k8s/{{ cloud_context }}/schedule"
And I should see the success message "has been deleted"
And I should see neither error nor warning messages
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment