-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new action for PipelineRun - Edit and run
- Loading branch information
Showing
19 changed files
with
531 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
Copyright 2022 The Tekton Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
const namespace = 'e2e-actions'; | ||
describe('Edit and run Pipeline Run', () => { | ||
before(() => { | ||
cy.exec('kubectl version --client'); | ||
cy.exec(`kubectl create namespace ${namespace} || true`); | ||
}); | ||
|
||
after(() => { | ||
cy.exec(`kubectl delete namespace ${namespace} || true`); | ||
}); | ||
|
||
it('should create pipelinerun on edit and run', function () { | ||
// given pipeline | ||
const uniqueNumber = Date.now(); | ||
const pipelineName = `sp-${uniqueNumber}`; | ||
const pipeline = `apiVersion: tekton.dev/v1beta1 | ||
kind: Pipeline | ||
metadata: | ||
name: ${pipelineName} | ||
namespace: ${namespace} | ||
spec: | ||
tasks: | ||
- name: hello | ||
taskSpec: | ||
steps: | ||
- name: echo | ||
image: busybox | ||
script: | | ||
#!/bin/ash | ||
echo "Hello World!" | ||
`; | ||
cy.exec(`echo "${pipeline}" | kubectl apply -f -`); | ||
// when create first pipeline run | ||
cy.visit( | ||
`/#/pipelineruns/create?namespace=${namespace}&pipelineName=${pipelineName}` | ||
); | ||
cy.get('[id=create-pipelinerun--namespaces-dropdown]').should( | ||
'have.value', | ||
namespace | ||
); | ||
cy.get('[id=create-pipelinerun--pipelines-dropdown]').should( | ||
'have.value', | ||
pipelineName | ||
); | ||
cy.contains('button', 'Create').click(); | ||
|
||
cy.contains('h1', 'PipelineRuns'); | ||
|
||
cy.get( | ||
`td:has(.bx--link[title*=${pipelineName}-run]) + td:has(.tkn--status[data-reason=Succeeded])`, | ||
{ timeout: 15000 } | ||
).should('have.length', 1); | ||
|
||
// when edit and run to create second pipeline run | ||
cy.contains('a', `${pipelineName}-run`).click(); | ||
cy.contains('button', 'Actions').click(); | ||
cy.contains('button', 'Edit and run').click(); | ||
cy.get('.cm-content').contains(`name: ${pipelineName}`); | ||
cy.contains('button', 'Create').click(); | ||
cy.contains('h1', 'PipelineRuns'); | ||
|
||
// then | ||
cy.get( | ||
`td:has(.bx--link[title*=${pipelineName}-run]) + td:has(.tkn--status[data-reason=Succeeded])`, | ||
{ timeout: 15000 } | ||
).should('have.length', 2); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.