Skip to content

Commit

Permalink
added piplines workspaces scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
makambalaji committed Dec 16, 2020
1 parent 2efa276 commit b243f95
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 3 deletions.
Expand Up @@ -7,15 +7,15 @@ Background:
And user is at pipelines page


@regression, @smoke, @manual
@pipelines, @smoke, @manual
Scenario: Create the pipeline with workspace : P-12-TC01
Given user is at Edit Yaml page
When user enters yaml content "pipeline-with-workspaces.yaml" in editor
And user clicks on create button in Edit Yaml file
Then user will be redirected to Pipeline Details page with header name "test-workspace-pipeline"


@regression, @manual
@pipelines, @regression, @manual
Scenario: Types of volume present in shared workspace : P-12-TC02
Given user created pipeline with workspace
When user clicks kebab menu for the pipeline "test-workspace-pipeline"
Expand All @@ -24,7 +24,7 @@ Scenario: Types of volume present in shared workspace : P-12-TC02
Then user is able to see different shared workspaces like Empty Directory, Config Map, Secret, PVC


@regression, @manual
@pipelines, @regression, @manual
Scenario: Start the pipeline with Empty workspace : P-12-TC03
Given user created pipeline with workspace
When user clicks kebab menu for the pipeline "test-workspace-pipeline"
Expand All @@ -35,6 +35,7 @@ Scenario: Start the pipeline with Empty workspace : P-12-TC03
Then user will be redirected to Pipeline Run Details page


@pipelines
Scenario: Start the pipeline with ConfigMap : P-12-TC04
Given user created pipeline with workspace
And user created Config Map using yaml "pipeline-configMap.yaml"
Expand All @@ -47,6 +48,7 @@ Scenario: Start the pipeline with ConfigMap : P-12-TC04
Then user will be redirected to Pipeline Run Details page


@pipelines
Scenario: Start the pipeline with Secret : P-12-TC05
Given user created pipeline with workspace
And user created Secret using yaml "pipeline-secret.yaml"
Expand All @@ -59,6 +61,7 @@ Scenario: Start the pipeline with Secret : P-12-TC05
Then user will be redirected to Pipeline Run Details page


@pipelines
Scenario: Start the pipeline with PVC : P-12-TC06
Given user created pipeline with workspace
And user created Secret using yaml "pipeline-secret.yaml"
Expand Down
@@ -0,0 +1,52 @@
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
import { pipelineBuilderPage } from '../../pages/pipelines/pipelineBuilder-page';
import { naviagteTo } from '../../pages/app';
import { devNavigationMenu } from '../../constants/global';
import { pipelinesPO, pipelineBuilderPO } from '../../pageObjects/pipelines-po';

When('user enters yaml content {string} in editor', (pipelineYamlFile: string) => {
cy.fixture(`pipelines/pipelines-workspaces/${pipelineYamlFile}`).then((yaml) => {
cy.log(yaml);
cy.get('[data-mode-id="yaml"]')
.click()
.focused()
.type('{ctrl}a')
.type(yaml);
});
});

When('user clicks on create button in Edit Yaml file', () => {
cy.get(pipelineBuilderPO.yamlCreatePipeline.create).click();
});

Given('user is at Edit Yaml page', () => {
pipelineBuilderPage.editYaml();
});

Given('user created pipeline with workspace', () => {
pipelineBuilderPage.editYaml();
cy.fixture(`pipelines/pipelines-workspaces/pipeline-with-workspace.yaml`).then((yaml) => {
cy.log(yaml);
cy.get('[data-mode-id="yaml"]')
.click()
.focused()
.type('{ctrl}a')
.type(yaml);
});
cy.get(pipelineBuilderPO.yamlCreatePipeline.create).click();
naviagteTo(devNavigationMenu.Pipelines);
});

Then(
'user is able to see different shared workspaces like Empty Directory, Config Map, Secret, PVC',
() => {
cy.byTestDropDownMenu('EmptyDirectory').should('be.visible');
cy.byTestDropDownMenu('ConfigMap').should('be.visible');
cy.byTestDropDownMenu('Secret').should('be.visible');
cy.byTestDropDownMenu('PVC').should('be.visible');
},
);

When('user selects shared workspaces drop down', () => {
cy.get(pipelinesPO.startPipeline.sharedWorkspace).click();
});

0 comments on commit b243f95

Please sign in to comment.