Skip to content

Commit

Permalink
added cypress scripts for pipeline triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
makambalaji committed Jan 31, 2021
1 parent 79c6d11 commit 2230a5d
Show file tree
Hide file tree
Showing 9 changed files with 457 additions and 158 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"screenshotsFolder": "../../../gui_test_screenshots/cypress/screenshots",
"videosFolder": "../../../gui_test_screenshots/cypress/videos",
"env": {
"TAGS": "@smoke and not @manual"
"TAGS": "@smoke or @regression and not @manual"
},
"retries": {
"runMode": 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,148 +1,149 @@
@pipelines
Feature: Triggers
As a user, I want to add or remove trigger details and verify the trigger for the git web hooks from pipeline

Background:
Given user has installed OpenShift Pipelines operator
And user has selected namespace "aut-pipeline-triggers"
And user is at pipelines page


@regression, @smoke
Scenario Outline: Add Trigger modal details : P-09-TC01
Given pipeline "<pipeline_name>" is available with git resource
When user selects "Add Trigger" from the kebab menu for "<pipeline_name>"
Then modal with "Add Trigger" appears
And Git provider type field is enabled
And Add button is disabled

Examples:
| pipeline_name |
| git-trigger-one |


@regression
Scenario: Variables section in Add Trigger modal details : P-09-TC02
Given user is at Add Trigger modal
When user selects the "github-pullreq" from Git Provider Type field
And user clicks on "show variables" link
Then user should be able to see "Hide Variables" link with varaibles section
And variables section displayed with message "The following variables can be used in the Parameters or when created new Resources."
And Add button is enabled


@regression, @smoke
Scenario Outline: Add the trigger to the pipeline from pipelines page : P-09-TC03
Given "<pipeline_name>" is displayed on pipelines page
When user selects "Add Trigger" from the kebab menu for "<pipeline_name>"
And user selects the "github-pullreq" from Git Provider Type field
And user clicks on Add button present in Add Trigger modal
Then pipelines page is displayed
And "Remove Trigger" is displayed in kebab menu for "<pipeline_name>"

Examples:
| pipeline_name |
| git-one |


@regression, @smoke
Scenario Outline: Pipeline Trigger template display in pipeline details page: P-09-TC04
Given pipeline "<pipeline_name>" with trigger in pipelines page
When user clicks pipeline "<pipeline_name>"
Then pipeline Details page is displayed with header name "<pipeline_name>"
And Trigger Templates section is displayed

Examples:
| pipeline_name |
| pipelines-one |


@regression, @smoke
Scenario: Trigger template details page : P-09-TC05
Given Trigger is added to the pipeline "git-pipeline" present in pipeline details page
And user is at pipeline Details page
When user clicks on trigger template
Then user will be redirected to Trigger Template Details page
And user is able to see Details, YAML tabs
And Details tab is displayed with field names Name, Namespace, Labels, Annotations, Created At, Owner, Pipelines and Event Listeners
And Actions dropdown display on the top right corner of the page


@regression, @smoke
Scenario: Event Listener Details page : P-09-TC06, P-09-TC07
Given Trigger is added to the pipeline "git-pipeline-events" present in pipeline details page
And user is at Trigger Template Details page
When user clicks on Event listener
Then user will be redirected to Event Listener Details page
And user is able to see Details, YAML tabs
And Details tab is displayed with field names Name, Namespace, Labels, Annotations, Created At, Owner, Trigger Templates and Trigger Bindings
And Actions dropdown display on the top right corner of the page


@regression, @smoke
Scenario: Cluster Trigger Binding Details page : P-09-TC08, P-09-TC09
Given Trigger is added to the pipeline "git-pipeline-triggerbinding" present in pipeline details page
And user is at Event Listener Details page
When user clicks on Trigger Binding
Then user will be redirected to Cluster Trigger Binding Details page
And user is able to see Details, YAML tabs
And Details tab is displayed with field names Name, Labels, Annotations, Created At, Owner
And Actions dropdown display on Cluster Trigger Binding page


@regression, @smoke
Scenario Outline: Remove Trigger modal details : P-09-TC10
Given Trigger is added to the pipeline "<pipeline_name>" present in pipeline details page
And user is at pipelines page
When user selects "Remove Trigger" from the kebab menu for "<pipeline_name>"
Then modal is displayed with header message "Remove Trigger"
And trigger template dropdown displayed with help text Select Trigger Template
And Remove button will be disabled

Examples:
| pipeline_name |
| git-pipeline-removetrigger |


@regression, @smoke
Scenario Outline: Remove the trigger from pipelines page : P-09-TC11
Given Trigger is added to the pipeline "<pipeline_name>" present in pipeline details page
And user is at pipelines page
When user selects "Remove Trigger" from the kebab menu for "<pipeline_name>"
And user selects the first option from the Trigger Template drop down field
And user clicks on Remove button
Then option "Remove Trigger" is not availale in kebab menu for "<pipeline_name>"

Examples:
| pipeline_name |
| git-pipeline-removetrigger-1 |


@regression, @manual
Scenario: Start the pipeline with secret by updating the git repo : P-10-TC01
Given Trigger is added to the pipeline "git-pipeline" present in pipeline details page
And user is at pipeline trigger template page for pipeline "git-pipeline"
When user navigates to github repo url
And user selects webhooks from github settings page
And user clicks Add Webhook
And user enters payload url as trigger template url
And user enters content type as "application/json"
And user clicks on Add Webhook
And update the content in ReadMe file
And user navigates to pipelines page
Then user is able to see new pipeline run for "git-pipeline" in pipelines page


@regression, @manual
Scenario: Start the pipeline with secret by updating the git repo : P-10-TC02
Given Trigger is added to the pipeline "git-pipeline" present in pipeline details page
And user is at pipeline trigger template page for pipeline "git-pipeline"
When user navigates to github repo url
And user selects webhooks from github settings page
And user clicks Add Webhook
And user enters payload url as trigger template url
And user enters content type as "application/json"
And user enters the secret authentication key
And user clicks on Add Webhook
And update the content in ReadMe file
And user navigates to pipelines page
Then user is able to see new pipeline run for "git-pipeline" in pipelines page
Background:
Given user has installed OpenShift Pipelines operator
And user has selected namespace "aut-pipeline-triggers"
And user is at pipelines page


@smoke
Scenario Outline: Add Trigger modal details : P-09-TC01
Given pipeline "<pipeline_name>" is available with git resource
When user selects "Add Trigger" from the kebab menu for "<pipeline_name>"
Then modal with "Add Trigger" appears
And Git provider type field is enabled
And Add button is disabled

Examples:
| pipeline_name |
| git-trigger-one |


@regression
Scenario: Variables section in Add Trigger modal details : P-09-TC02
Given user is at Add Trigger modal
When user selects the "github-pullreq" from Git Provider Type field
And user clicks on "Show Variables" link
Then user should be able to see "Hide Variables" link with variables section
And variables section displayed with message "The following variables can be used in the Parameters or when created new Resources."
And Add button is enabled


@smoke
Scenario Outline: Add the trigger to the pipeline from pipelines page : P-09-TC03
Given "<pipeline_name>" is displayed on pipelines page
When user selects "Add Trigger" from the kebab menu for "<pipeline_name>"
And user selects the "github-pullreq" from Git Provider Type field
And user clicks on Add button present in Add Trigger modal
Then pipelines page is displayed
And "Remove Trigger" is displayed in kebab menu for "<pipeline_name>"

Examples:
| pipeline_name |
| git-one |


@smoke
Scenario Outline: Pipeline Trigger template display in pipeline details page: P-09-TC04
Given pipeline "<pipeline_name>" with trigger in pipelines page
When user clicks pipeline "<pipeline_name>"
Then pipeline Details page is displayed with header name "<pipeline_name>"
And Trigger Templates section is displayed

Examples:
| pipeline_name |
| pipelines-one |


@smoke
Scenario: Trigger template details page : P-09-TC05
Given Trigger is added to the pipeline "git-pipeline" present in pipeline details page
And user is at pipeline Details page
When user clicks on trigger template
Then user will be redirected to Trigger Template Details page
And user is able to see Details, YAML tabs
And Details tab is displayed with field names Name, Namespace, Labels, Annotations, Created At, Owner, Pipelines and Event Listeners
And Actions dropdown display on the top right corner of the page


@smoke
Scenario: Event Listener Details page : P-09-TC06, P-09-TC07
Given Trigger is added to the pipeline "git-pipeline-events" present in pipeline details page
And user is at Trigger Template Details page
When user clicks on Event listener
Then user will be redirected to Event Listener Details page
And user is able to see Details, YAML tabs
And Details tab is displayed with field names Name, Namespace, Labels, Annotations, Created At, Owner, Trigger Templates and Trigger Bindings
And Actions dropdown display on the top right corner of the page


@smoke
Scenario: Cluster Trigger Binding Details page : P-09-TC08, P-09-TC09
Given Trigger is added to the pipeline "git-pipeline-triggerbinding" present in pipeline details page
And user is at Event Listener Details page
When user clicks on Trigger Binding
Then user will be redirected to Cluster Trigger Binding Details page
And user is able to see Details, YAML tabs
And Details tab is displayed with field names Name, Labels, Annotations, Created At, Owner
And Actions dropdown display on Cluster Trigger Binding page


@smoke
Scenario Outline: Remove Trigger modal details : P-09-TC10
Given Trigger is added to the pipeline "<pipeline_name>" present in pipeline details page
And user is at pipelines page
When user selects "Remove Trigger" from the kebab menu for "<pipeline_name>"
Then modal is displayed with header message "Remove Trigger"
And trigger template dropdown displayed with help text Select Trigger Template
And Remove button will be disabled

Examples:
| pipeline_name |
| git-pipeline-removetrigger |


@smoke
Scenario Outline: Remove the trigger from pipelines page : P-09-TC11
Given Trigger is added to the pipeline "<pipeline_name>" present in pipeline details page
And user is at pipelines page
When user selects "Remove Trigger" from the kebab menu for "<pipeline_name>"
And user selects the first option from the Trigger Template drop down field
And user clicks on Remove button
Then option "Remove Trigger" is not available in kebab menu for "<pipeline_name>"

Examples:
| pipeline_name |
| git-pipeline-removetrigger-1 |


@regression, @manual
Scenario: Start the pipeline with secret by updating the git repo : P-10-TC01
Given Trigger is added to the pipeline "git-pipeline" present in pipeline details page
And user is at pipeline trigger template page for pipeline "git-pipeline"
When user navigates to github repo url
And user selects webhooks from github settings page
And user clicks Add Webhook
And user enters payload url as trigger template url
And user enters content type as "application/json"
And user clicks on Add Webhook
And update the content in ReadMe file
And user navigates to pipelines page
Then user is able to see new pipeline run for "git-pipeline" in pipelines page


@regression, @manual
Scenario: Start the pipeline with secret by updating the git repo : P-10-TC02
Given Trigger is added to the pipeline "git-pipeline" present in pipeline details page
And user is at pipeline trigger template page for pipeline "git-pipeline"
When user navigates to github repo url
And user selects webhooks from github settings page
And user clicks Add Webhook
And user enters payload url as trigger template url
And user enters content type as "application/json"
And user enters the secret authentication key
And user clicks on Add Webhook
And update the content in ReadMe file
And user navigates to pipelines page
Then user is able to see new pipeline run for "git-pipeline" in pipelines page
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ export const pageTitle = {
ConfigMaps: 'Config Maps',
Secrets: 'Secrets',
PipelineRunDetails: 'Pipeline Run details',
PipelineDetails: 'Pipeline details',
TriggerTemplateDetails: 'Trigger Template details',
EventListenerDetails: 'EventListener details',
ClusterTriggerTemplateDetails: 'ClusterTriggerBinding Details',
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ export const pipelineBuilderPage = {
.get(pipelineBuilderPO.task)
.contains(taskName)
.click(),
seelctParallelTask: (taskName: string) => {
selectParallelTask: (taskName: string) => {
cy.mouseHover('.odc-pipeline-vis-task__content');
cy.get('g.odc-plus-node-decorator')
.eq(2)
.click();
pipelineBuilderPage.selectTask(taskName);
},
seelctSeriesTask: (taskName: string) => {
selectSeriesTask: (taskName: string) => {
cy.mouseHover('.odc-pipeline-vis-task__content');
cy.get('g.odc-plus-node-decorator')
.eq(0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { detailsPage } from '../../../../../integration-tests-cypress/views/details-page';
import { pageTitle } from '../../constants/pageTitle';
import {
clusterTriggerBindingDetailsPO,
eventListenerDetailsPO,
Expand All @@ -17,13 +18,14 @@ export const pipelineDetailsPage = {
},
verifyTriggerTemplateSection: () =>
cy.get(pipelineDetailsPO.details.triggerTemplateSection).should('be.visible'),
verifyPage: () => cy.get(pipelineDetailsPO.title).should('contain.text', 'Pipeline Details'),
verifyPage: () =>
cy.get(pipelineDetailsPO.title).should('contain.text', pageTitle.PipelineDetails),
selectTriggerTemplateLink: () => cy.get(pipelineDetailsPO.details.triggerTemplateLink).click(),
};

export const triggerTemplateDetailsPage = {
verifyPage: () =>
cy.get(triggerTemplateDetailsPO.title).should('contain.text', 'Trigger Template Details'),
cy.get(triggerTemplateDetailsPO.title).should('contain.text', pageTitle.TriggerTemplateDetails),
verifyTabs: () => {
cy.get('ul.co-m-horizontal-nav__menu li a').as('tabName');
cy.get('@tabName')
Expand Down Expand Up @@ -62,7 +64,7 @@ export const triggerTemplateDetailsPage = {

export const eventListenerDetailsPage = {
verifyPage: () =>
cy.get(eventListenerDetailsPO.title).should('contain.text', 'Event Listener Details'),
cy.get(eventListenerDetailsPO.title).should('contain.text', pageTitle.EventListenerDetails),
verifyTabs: () => {
cy.get('ul.co-m-horizontal-nav__menu li a').as('tabName');
cy.get('@tabName')
Expand Down Expand Up @@ -102,7 +104,7 @@ export const clusterTriggerBindingDetailsPage = {
verifyPage: () =>
cy
.get(clusterTriggerBindingDetailsPO.title)
.should('contain.text', 'ClusterTriggerBinding Details'),
.should('contain.text', pageTitle.ClusterTriggerTemplateDetails),
verifyTabs: () => {
cy.get('ul.co-m-horizontal-nav__menu li a').as('tabName');
cy.get('@tabName')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export const pipelinesPage = {
};

export const startPipelineInPipelinesPage = {
clickCancel: () => cy.byLegacyTestID('modal-cancel-action').click(),
verifySections: () => {
cy.get(pipelinesPO.startPipeline.sectionTitle).as('sectionTitle');
cy.get('@sectionTitle')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ When('user navigates to Topology page', () => {
navigateTo(devNavigationMenu.Topology);
});

When('user clicks node {string} to open the side bar', (componentNode) => {
topologyPage.clickOnNode(componentNode);
topologySidePane.verify();
});

Then('user is able to see workload {string} in topology page list view', (workloadName: string) => {
topologyPage.verifyWorkloadInTopologyPage(workloadName);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ When('user clicks on tick mark', () => {

Then('{string} is added under secrets section', (secretName: string) => {
cy.byLegacyTestID(secretName).should('be.visible');
cy.byLegacyTestID('modal-cancel-action').click();
startPipelineInPipelinesPage.clickCancel();
});

When('user enters the SSH KEY as {string}', (sshKey: string) => {
Expand Down
Loading

0 comments on commit 2230a5d

Please sign in to comment.