Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gui custom capabilities testcases #2287

Merged
merged 25 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9d7de35
Add CustomCapabilities testcase
maryvictol Oct 29, 2021
d87e3a2
Merge branch 'develop' into gui_custom_capabilities_testcases
maryvictol Oct 29, 2021
d0c6ccc
Update CustomCapabilities testcase
maryvictol Oct 30, 2021
3912ec8
add customCapabilities test
maryvictol Nov 2, 2021
00c63e9
Merge remote-tracking branch 'origin/develop' into gui_custom_capabil…
maryvictol Nov 2, 2021
7f8ef8f
update customCapabilities tests
maryvictol Nov 3, 2021
1d1b3e0
update CustomCapabilities test
maryvictol Nov 8, 2021
15fe275
update CustomCapabilities test
maryvictol Nov 8, 2021
c87ba0d
update customCapabilities test
maryvictol Nov 8, 2021
793ae0e
update customCapabilities testcase
maryvictol Nov 11, 2021
07428b8
Update customCapabilities testcase
maryvictol Nov 11, 2021
a291bef
add CustomCapabilities test 2295
maryvictol Nov 12, 2021
02ec2ef
update CustomCapabilities test
maryvictol Nov 12, 2021
0577eae
update CustomCapabilities test
maryvictol Nov 12, 2021
b4639f7
update CustomCapabilities test
maryvictol Nov 12, 2021
8fb19ca
update CustomCapabilities test
maryvictol Nov 12, 2021
0e25883
update CustomCapabilities test
maryvictol Nov 12, 2021
cb62a26
update CustomCapabilities test
maryvictol Nov 12, 2021
cba79a5
update CustomCapabilities test
maryvictol Nov 12, 2021
1d0c0b6
update CustomCapabilities test
maryvictol Nov 12, 2021
4b11fd4
update CustomCapabilities test
maryvictol Nov 12, 2021
8a380e9
Update customCapabilities testcases
maryvictol Nov 15, 2021
a0bb643
update CustomCapabilities test
maryvictol Nov 15, 2021
dc12530
update CustomCapabilities tests
maryvictol Nov 15, 2021
b707d47
Issue #2287 custom capabilities small clean up
kamyshova Nov 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add CustomCapabilities test 2295
  • Loading branch information
maryvictol committed Nov 12, 2021
commit a291befccdf97e8c81113bcfe727d8a50d58e762
34 changes: 34 additions & 0 deletions docs/testcases/UI/Run_tools_in_sandbox/Launch_parameters/2295.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# "Custom" capabilities with configured job parameters

Test verifies that
- administrator shall be able to add params field to the capability - list of key/values.
- parameters are set as the parameters for a job.

**Prerequisites**:
- Admin user
- Non-admin user
- Test tool is available to the non-admin user

| Steps | Actions | Expected results |
| :---: | --- | --- |
| 1 | Login as the admin user from the prerequisites | |
| 2 | Open the **Settings** page | |
| 3 | Open the **PREFERENCES** tab | |
| 4 | Click the **Launch** tab | |
| 5 | Find the **`launch.capabilities`** preference | |
| 6 | Save the preference value, then clear and input the following json <ul> `{` <ul> `"testCapability1": {` <ul> `"description": "Custom test capability 1"`, <br> `"commands": [` <ul> `"echo testLine1"`, <br> `"echo 'testLine1' > ~/testFile1.txt"` </ul> `],` <br> `"params": {` <ul> `"MY_PARAM1": "MY_VALUE1"`, <br> `"MY_BOOLEAN_PARAM": true,` <br> `"MY_NUMBER_PARAM": 1` </ul> `}` </ul> `},` <br> `"testCapability2": {` <ul> `"description": "Custom test capability 2",` <br> `"commands": [` <ul> `"echo testLine2",` <br> `"echo 'testLine2' > ~/testFile1.txt"` </ul> `],` <br> `"params": {` <ul> `"MY_PARAM2": "MY_VALUE2"`, <br> `"MY_BOOLEAN_PARAM": false,` <br> `"MY_NUMBER_PARAM": 2` </ul> `}` </ul> `},` </ul> `}` </ul> `}` |
NShaforostov marked this conversation as resolved.
Show resolved Hide resolved
| 7 | Click **Save** button | |
| 8 | Login as the non-admin user from the prerequisites | |
| 9 | Open the **Tools** page | |
| 10 | Select the test tool | |
| 11 | Run with custom settings | |
NShaforostov marked this conversation as resolved.
Show resolved Hide resolved
| 12 | Expand **Exec environment** section | |
| 13 | Click into the field near the ***Run capabilities*** label | Drop-down list of capabilities appears and contains ***testCapability1*** and ***testCapability2*** |
| 14 | Select ***testCapability1*** and ***testCapability2*** from list | |
| 15 | Launch the tool | |
| 16 | At the **Runs** page, click the just-launched run | |
| 17 | Expand the Parameters section | The Parameters section contains parameters <ul> *CP_CAP_CUSTOM_testCapability1: true* <br> *CP_CAP_CUSTOM_testCapability2: true* <br> *MY_PARAM1: MY_VALUE1* <br> *MY_PARAM2: MY_VALUE2* <br> *MY_BOOLEAN_PARAM: false* <br> *MY_NUMBER_PARAM: 2* |

**After:**
- Stop the run launched at step 15
- Restore the value of the `launch.capabilities` preference to the previous value saved at step 6
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.epam.pipeline.autotests.ao.RunsMenuAO;
import com.epam.pipeline.autotests.ao.ToolTab;
import com.epam.pipeline.autotests.mixins.Authorization;
import com.epam.pipeline.autotests.mixins.Tools;
import com.epam.pipeline.autotests.utils.C;
import com.epam.pipeline.autotests.utils.TestCase;
Expand All @@ -40,14 +41,14 @@

public class ToolsParametersTest
extends AbstractSeveralPipelineRunningTest
implements Tools {
implements Authorization, Tools {

private final String tool = C.TESTING_TOOL_NAME;
private final String registry = C.DEFAULT_REGISTRY;
private final String group = C.DEFAULT_GROUP;
private final String invalidEndpoint = "8700";
private final String launchCapabilities = "launch.capabilities";
private static final String CUSTOM_CAPABILITIES_JSON = "/customCapabilities.json";
private static final String CUSTOM_CAPABILITIES_1_JSON = "/customCapabilities1.json";
private String prefInitialValue = "";
private final String custCapability1 = "testCapability1";
private final String custCapability2 = "testCapability2";
Expand Down Expand Up @@ -100,8 +101,10 @@ public void customCapabilitiesImplementation() {
.settings()
.switchToPreferences()
.clearAndSetJsonToPreference(launchCapabilities,
readResourceFully(CUSTOM_CAPABILITIES_JSON), true)
readResourceFully(CUSTOM_CAPABILITIES_1_JSON), true)
.saveIfNeeded();
logout();
loginAs(user);
tools()
.perform(registry, group, tool, ToolTab::runWithCustomSettings)
.expandTab(EXEC_ENVIRONMENT)
Expand Down Expand Up @@ -134,4 +137,32 @@ public void customCapabilitiesImplementation() {
.assertOutputContains("testLine1", "testLine2")
.close());
}

@Test
@TestCase(value = {"2295"})
public void customCapabilitiesWithConfiguredJobParameters() {
navigationMenu()
.settings()
.switchToPreferences()
.clearAndSetJsonToPreference(launchCapabilities,
readResourceFully(CUSTOM_CAPABILITIES_1_JSON), true)
.saveIfNeeded();
logout();
loginAs(user);
tools()
.perform(registry, group, tool, ToolTab::runWithCustomSettings)
.expandTab(EXEC_ENVIRONMENT)
.selectValue(RUN_CAPABILITIES, custCapability1)
.click(RUN_CAPABILITIES)
.selectValue(RUN_CAPABILITIES, custCapability2)
.launch(this)
.showLog(getLastRunId())
.expandTab(PARAMETERS)
.ensure(configurationParameter(format("CP_CAP_CUSTOM_%s", custCapability1), "true"), exist)
.ensure(configurationParameter(format("CP_CAP_CUSTOM_%s", custCapability2), "true"), exist)
.ensure(configurationParameter("MY_PARAM1", "MY_VALUE1"), exist)
.ensure(configurationParameter("MY_PARAM2", "MY_VALUE2"), exist)
.ensure(configurationParameter("MY_BOOLEAN_PARAM", "false"), exist)
.ensure(configurationParameter("MY_NUMBER_PARAM", "2"), exist);
}
}
26 changes: 26 additions & 0 deletions e2e/gui/src/test/resources/customCapabilities2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"testCapability1": {
"description": "Custom test capability 1",
"commands": [
"echo testLine1",
"echo 'testLine1' > ~/testFile1.txt"
],
"params": {
"MY_PARAM1": "MY_VALUE1",
"MY_BOOLEAN_PARAM": true,
"MY_NUMBER_PARAM": 1
}
},
"testCapability2": {
"description": "Custom test capability 2",
"commands": [
"echo testLine2",
"echo 'testLine2' >> ~/testFile1.txt"
],
"params": {
"MY_PARAM2": "MY_VALUE2",
"MY_BOOLEAN_PARAM": false,
"MY_NUMBER_PARAM": 2
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new line, please

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done