This repository has been archived by the owner on Jan 4, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Input text markup removal test (JENKINS-41162)
- Loading branch information
Showing
4 changed files
with
92 additions
and
2 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
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,57 @@ | ||
/** @module encoded-input-text | ||
* @memberof params-inputs | ||
* @description | ||
* | ||
* Tests: covering encoding of message, name, description text on input controls used on Job params and input step. | ||
* | ||
* See https://issues.jenkins-ci.org/browse/JENKINS-41162 | ||
* | ||
*/ | ||
const jobName = 'parameterPipeline-html-in-descriptions'; | ||
|
||
module.exports = { | ||
'Step 01: create job': function (browser) { | ||
const pipelinesCreate = browser.page.pipelineCreate().navigate(); | ||
pipelinesCreate.createPipeline(jobName, 'parameterPipeline-html-in-descriptions.groovy'); | ||
}, | ||
'Step 02: start job run': function (browser) { | ||
// we need to create a browser page outside the async loop | ||
// const pipelinesCreate = browser.page.pipelineCreate().navigate(); | ||
const pipelinePage = browser.page.jobUtils().forJob(jobName); | ||
pipelinePage.buildStarted(function () { | ||
// Reload the job page and check that there was a build done. | ||
pipelinePage | ||
.waitForElementVisible('div#pipeline-box') | ||
.forRun(1) | ||
.waitForElementVisible('@executer'); | ||
}); | ||
}, | ||
'Step 03: check the run input form for html tags (JENKINS-41162)': function (browser) { | ||
const blueActivityPage = browser.page.bluePipelineActivity().forJob(jobName); | ||
|
||
blueActivityPage.waitForElementVisible('@activityTableEntries'); | ||
|
||
// Click the first in the list and wait for the | ||
// "Proceed" button to appear. | ||
blueActivityPage.click('@activityTableEntries'); | ||
blueActivityPage.waitForElementVisible('@inputStepSubmit'); | ||
|
||
// Check that the text was stripped of markup. | ||
// See parameterPipeline-html-in-descriptions.groovy and how the labels | ||
// and descriptions were defined with embedded <b> tags. | ||
// See https://issues.jenkins-ci.org/browse/JENKINS-41162 | ||
blueActivityPage.assert.containsText('@inputStepContainer', 'Some inputs'); | ||
blueActivityPage.assert.containsText('@inputStepContainer', 'My text.'); | ||
blueActivityPage.assert.containsText('@inputStepContainer', 'My choice.'); | ||
blueActivityPage.assert.containsText('@inputStepContainer', 'My flag.'); | ||
blueActivityPage.assert.containsText('@inputStepContainer', 'My password.'); | ||
blueActivityPage.assert.containsText('@inputStepContainer', 'My text description.'); | ||
blueActivityPage.assert.containsText('@inputStepContainer', 'My choice description.'); | ||
blueActivityPage.assert.containsText('@inputStepContainer', 'My flag description.'); | ||
blueActivityPage.assert.containsText('@inputStepContainer', 'My password description.'); | ||
|
||
// Press submit on the form, allowing the build to finish out. | ||
blueActivityPage.click('@inputStepSubmit'); | ||
blueActivityPage.waitForJobRunEnded(jobName); | ||
} | ||
}; |
4 changes: 2 additions & 2 deletions
4
...st/js/log-karaoke/parametrisedPipeline.js → .../js/params-inputs/multibranch-pipeline.js
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
31 changes: 31 additions & 0 deletions
31
src/test/resources/test_scripts/parameterPipeline-html-in-descriptions.groovy
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,31 @@ | ||
node { | ||
|
||
// | ||
// Commented out for now because pipeline doesn't accept Job parameters | ||
// on the first run of the Job, which seems a bit messed up. The actual | ||
// components for processing the inputs are the same in both cases, so | ||
// testing the inputs should be fine for now anyway. | ||
// | ||
// properties([ | ||
// parameters([ | ||
// booleanParam( | ||
// defaultValue: false, | ||
// description: 'My <b>flag</b>', | ||
// name: 'My <b>flag</b>' | ||
// ), | ||
// choice( | ||
// choices: 'master\ndevelopment\nfeatureXYZ\nhotfix69\nrevolution\nrefactor\nuglify', | ||
// description: 'My <b>choice</b>', | ||
// name: 'My <b>choice</b>' | ||
// ), | ||
// ]) | ||
// ]) | ||
// | ||
|
||
input message: 'Some <b>inputs</b>', parameters: [ | ||
[name: 'My <b>text</b>.', description: 'My text <b>description</b>.', $class: 'StringParameterDefinition'], | ||
[name: 'My <b>choice</b>.', description: 'My choice <b>description</b>.', choices: 'Choice 1\nChoice 2\nChoice 3', $class: 'ChoiceParameterDefinition'], | ||
[name: 'My <b>flag</b>.', description: 'My flag <b>description</b>.', $class: 'BooleanParameterDefinition'], | ||
[name: 'My <b>password</b>.', description: 'My password <b>description</b>.', $class: 'PasswordParameterDefinition'] | ||
] | ||
} |