Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public abstract class BaseUITest {

@BeforeClass
public static void beforeClass() throws Exception {

// Needed to set CI environment keyboard layout
SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public void testSuccessfulConnetion() {

@Test
public void testAddCheckmarxASTPlugin() {

// Add Checkmarx plugin to the eclipse view
addCheckmarxPlugin();

Expand All @@ -64,7 +63,6 @@ public void testAddCheckmarxASTPlugin() {

@Test
public void testMissingSetCheckmarxServerUrl() {

// Clear Checkmarx credentials to expect missing Server Url
clearCheckmarxCredentials();

Expand Down Expand Up @@ -104,7 +102,6 @@ public void testMissingSetCheckmarxServerUrl() {
*/
@Test
public void testEnd2End() throws TimeoutException {

// Set credentials, test connection and add checkmarx plugin
setUpCheckmarxPlugin();

Expand All @@ -123,7 +120,6 @@ public void testEnd2End() throws TimeoutException {

@Test
public void testFilterButtonsAndGroupByActionsInToolBar() throws TimeoutException {

// Add Checkmarx AST Plugin
addCheckmarxPlugin();

Expand All @@ -146,7 +142,6 @@ public void testFilterButtonsAndGroupByActionsInToolBar() throws TimeoutExceptio

@Test
public void testFilteringAndGroupingResults() throws TimeoutException {

// Set credentials, test connection and add checkmarx plugin
setUpCheckmarxPlugin();

Expand Down Expand Up @@ -187,9 +182,7 @@ public void testFilteringAndGroupingResults() throws TimeoutException {
// Click to include High severity
clickSeverityFilter(ActionName.HIGH.name());
currentActiveFilters.add(Severity.HIGH.name());

_bot.viewByTitle(VIEW_CHECKMARX_AST_SCAN).viewMenu().menu(ToolBarActions.MENU_GROUP_BY).menu(ToolBarActions.GROUP_BY_QUERY_NAME).click();


sleep(1000);

String firstNodeName = _bot.tree().cell(0, COLUMN_TITLE);
Expand Down Expand Up @@ -304,7 +297,6 @@ private List<String> expandTreeUntilFirstEngineAndGetCurrentSeverities() {
* Test successful connection
*/
private void testSuccessfulConnection() {

preventWidgetWasNullInCIEnvironment();

_bot.menu(TAB_WINDOW).menu(ITEM_PREFERENCES).click();
Expand Down Expand Up @@ -335,7 +327,6 @@ private void testSuccessfulConnection() {
* Add Checkmarx plugin in the show view perspective
*/
private void addCheckmarxPlugin() {

preventWidgetWasNullInCIEnvironment();

_bot.menu(TAB_WINDOW).menu(ITEM_SHOW_VIEW).menu(ITEM_OTHER).click();
Expand All @@ -348,7 +339,6 @@ private void addCheckmarxPlugin() {
* Type a valid Scan ID to get results
*/
private void typeValidScanID() {

preventWidgetWasNullInCIEnvironment();

_bot.textWithLabel(LABEL_SCAN_ID).setText(Environment.SCAN_ID);
Expand All @@ -359,7 +349,6 @@ private void typeValidScanID() {
* Clear all Checkmarx credentials
*/
private void clearCheckmarxCredentials() {

if (!_cxSettingsDefined) {
return;
}
Expand Down Expand Up @@ -403,7 +392,6 @@ private void clearCheckmarxCredentials() {
* @throws TimeoutException
*/
private static void waitWhileTreeNodeEqualsTo(String nodeText) throws TimeoutException {

int retryIdx = 0;

while (_bot.tree().getAllItems()[0].getText().equals(nodeText)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ public class PluginConstants {
public static final String SAST = "sast";
public static final String SCA_DEPENDENCY = "dependency";
public static final String KICS_INFRASTRUCTURE = "infrastructure";
public static final String MSG_RETRIEVING_RESULTS = "Retrieving the results for the scan id: %s .";
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ public class PluginUtils {

private static final String PARAM_TIMESTAMP_PATTERN = "yyyy-MM-dd | HH:mm:ss";
private static final String PARAM_SCAN_ID_VALID_FORMAT = "[a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[89ab][a-f0-9]{3}-[0-9a-f]{12}";



/**
* Converts a String timestamp to a specific format
*
* @param timestamp
* @return
*/
public static String convertStringTimeStamp(String timestamp) {

String parsedDate = null;

try {
Expand All @@ -41,52 +39,50 @@ public static String convertStringTimeStamp(String timestamp) {

return parsedDate;
}

/**
* Validate scan id format
*
* @param scanId
* @return
*/
public static boolean validateScanIdFormat(String scanId) {
return scanId.matches(PARAM_SCAN_ID_VALID_FORMAT);
return scanId.matches(PARAM_SCAN_ID_VALID_FORMAT);
}

/**
* Enables a combo viewer
*
* @param comboviewer
* @param enable
*/
public static void enableComboViewer(ComboViewer comboviewer, boolean enable){
public static void enableComboViewer(ComboViewer comboviewer, boolean enable) {
comboviewer.getCombo().setEnabled(enable);
}

/**
* Set combo viewer placeholder
*
* @param comboViewer
* @param text
*/
public static void setTextForComboViewer(ComboViewer comboViewer , String text) {
public static void setTextForComboViewer(ComboViewer comboViewer, String text) {
comboViewer.getCombo().setText(text);
}

/**
* Enable/Disable filter actions
*
* @param filterActions
*/
public static void updateFiltersEnabledAndCheckedState(List<Action> filterActions) {

for(Action action : filterActions) {

for (Action action : filterActions) {
// avoid to disable group by severity and group by query name actions
if(!action.getId().equals(ActionName.GROUP_BY_SEVERITY.name()) && !action.getId().equals(ActionName.GROUP_BY_QUERY_NAME.name())) {
if (!action.getId().equals(ActionName.GROUP_BY_SEVERITY.name()) && !action.getId().equals(ActionName.GROUP_BY_QUERY_NAME.name())) {
action.setEnabled(DataProvider.getInstance().getCurrentScanId() != null);
}

action.setChecked(FilterState.isSeverityEnabled(action.getId()));
}
}
}
}
Loading