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
update CustomCapabilities test
  • Loading branch information
maryvictol committed Nov 8, 2021
commit 15fe275523ee247841d67e6a690ce3a814ff9c9a
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,30 @@
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import java.util.Set;

import static com.codeborne.selenide.Condition.exist;
import static com.codeborne.selenide.Selenide.open;
import static com.epam.pipeline.autotests.ao.LogAO.configurationParameter;
import static com.epam.pipeline.autotests.ao.LogAO.containsMessages;
import static com.epam.pipeline.autotests.ao.LogAO.log;
import static com.epam.pipeline.autotests.ao.LogAO.taskWithName;
import static com.epam.pipeline.autotests.ao.Primitive.EXEC_ENVIRONMENT;
import static com.epam.pipeline.autotests.ao.Primitive.PARAMETERS;
import static com.epam.pipeline.autotests.ao.Primitive.RUN_CAPABILITIES;
import static com.epam.pipeline.autotests.utils.Utils.readResourceFully;
import static java.lang.String.format;
import static java.util.concurrent.TimeUnit.SECONDS;
import static java.util.stream.Collectors.toSet;

public class ToolsParametersTest
extends AbstractSinglePipelineRunningTest
extends AbstractSeveralPipelineRunningTest
implements 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 final String customCapabilities = "{\n\"testCapability1\": {\n \"description\": \"Custom test capability 1\",\n" +
" \"commands\": [\n \"echo testLine1\",\n \"echo 'testLine1' > ~/testFile1.txt\"\n ]\n },\n \"testCapability2\": {\n" +
" \"description\": \"Custom test capability 2\",\n \"commands\": [\n \"echo testLine2\",\n" +
" \"echo 'testLine2' >> ~/testFile1.txt\"\n ]\n }\n}";
private static final String CUSTOM_CAPABILITIES_JSON = "/customCapabilities.json";
private String prefInitialValue = "";
private final String custCapability1 = "testCapability1";
private final String custCapability2 = "testCapability2";
Expand Down Expand Up @@ -85,9 +85,9 @@ public void runToolThatHaveNoNginxEndpoint() {
.save()
.run(this)
)
.showLog(getRunId());
.showLog(getLastRunId());
new RunsMenuAO()
.waitForInitializeNode(getRunId())
.waitForInitializeNode(getLastRunId())
.clickEndpoint()
.screenshot("test501screenshot")
.assertPageTitleIs("502 Bad Gateway");
Expand All @@ -99,7 +99,8 @@ public void customCapabilitiesImplementation() {
navigationMenu()
.settings()
.switchToPreferences()
.clearAndSetJsonToPreference(launchCapabilities, customCapabilities, true)
.clearAndSetJsonToPreference(launchCapabilities,
readResourceFully(CUSTOM_CAPABILITIES_JSON), true)
.saveIfNeeded();
tools()
.perform(registry, group, tool, ToolTab::runWithCustomSettings)
Expand All @@ -109,22 +110,29 @@ public void customCapabilitiesImplementation() {
.selectValue(RUN_CAPABILITIES, custCapability2)
.checkTooltipText(custCapability1, "Custom test capability 1")
.checkTooltipText(custCapability2, "Custom test capability 2")
.launch(this)
.showLog(getRunId())
.expandTab(PARAMETERS)
.ensure(configurationParameter(format("CP_CAP_CUSTOM_%s", custCapability1), "true"), exist)
.ensure(configurationParameter(format("CP_CAP_CUSTOM_%s", custCapability2), "true"), exist)
.waitForSshLink()
.ensure(log(), containsMessages(format("Running '%s' commands:", custCapability1),
"--> Command: 'echo testLine1'",
format("Running '%s' commands:", custCapability2),
"--> Command: 'echo testLine2'"))
.launch(this);
final Set<String> logMess =
runsMenu()
.showLog(getLastRunId())
.expandTab(PARAMETERS)
.ensure(configurationParameter(format("CP_CAP_CUSTOM_%s", custCapability1), "true"), exist)
.ensure(configurationParameter(format("CP_CAP_CUSTOM_%s", custCapability2), "true"), exist)
.waitForSshLink()
.click(taskWithName("Console"))
.logMessages()
.collect(toSet());
runsMenu()
.showLog(getLastRunId())
.logContainsMessage(logMess, format("Running '%s' commands:", custCapability1))
.logContainsMessage(logMess, "Command: 'echo testLine1'")
.logContainsMessage(logMess, format("Running '%s' commands:", custCapability2))
.logContainsMessage(logMess, "Command: 'echo testLine2'")
.ssh(shell -> shell
.waitUntilTextAppears(getRunId())
.waitUntilTextAppears(getLastRunId())
.execute("ls")
.assertOutputContains("testFile1.txt")
.execute("cat testFile1.txt")
.assertOutputContains("cap1", "cap2")
.assertOutputContains("testLine1", "testLine2")
.close());
}
}
16 changes: 16 additions & 0 deletions e2e/gui/src/test/resources/customCapabilities.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"testCapability1": {
"description": "Custom test capability 1",
"commands": [
"echo testLine1",
"echo 'testLine1' > ~/testFile1.txt"
]
},
"testCapability2": {
"description": "Custom test capability 2",
"commands": [
"echo testLine2",
"echo 'testLine2' >> ~/testFile1.txt"
]
}
}