Skip to content

Commit

Permalink
fix the failing e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GnsP committed Nov 16, 2023
1 parent 33afd4d commit f57e0de
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
17 changes: 4 additions & 13 deletions src/e2e-test/features/source.control.management.sync.apps.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,22 @@

@Integration_Tests
Feature: Source Control Management - Pulling and pushing applications
Background:
When Open Source Control Management Page
Then Delete the repo config
Then Initialize the repository config

@SOURCE_CONTROL_MANAGEMENT_TEST
Scenario: Should successfully push a pipeline to git from pipeline list page
When Open Source Control Management Page
When Initialize the repository config
When Deploy and test pipeline "test_pipeline2_fll_airport" with pipeline JSON file "fll_airport_pipeline2.json"
Then Click push button in Actions dropdown
Then Commit changes with message "upload pipeline to Git"
Then Banner is shown with message "Successfully pushed pipeline test_pipeline2_fll_airport"
Then Clean up pipeline "test_pipeline2_fll_airport" which is created for testing
When Open Source Control Management Page
Then Delete the repo config

@SOURCE_CONTROL_MANAGEMENT_TEST
Scenario: Remote pipeline tab loads pipelines from git
# Setup
When Open Source Control Management Page
When Initialize the repository config
When Deploy and test pipeline "test_pipeline2_fll_airport" with pipeline JSON file "fll_airport_pipeline2.json"
# Test push from SCM sync page
When Open Source Control Sync Page
Expand All @@ -51,15 +49,10 @@ Feature: Source Control Management - Pulling and pushing applications
Then Pull success indicator is shown for pipeline "test_pipeline2_fll_airport"
# Clean up
Then Clean up pipeline "test_pipeline2_fll_airport" which is created for testing
When Open Source Control Management Page
Then Delete the repo config

@PIPELINE_EDIT_TEST
@SOURCE_CONTROL_MANAGEMENT_TEST
Scenario: Edit a simple pipeline and restore a version from git
# Setup Repo config
When Open Source Control Management Page
When Initialize the repository config
When Deploy and test pipeline "pipeline_edit_test" with pipeline JSON file "logs_generator.json"
# Push version 1 of the pipeline to git.
Then Click push button in Actions dropdown
Expand All @@ -77,5 +70,3 @@ Feature: Source Control Management - Pulling and pushing applications
Then History should show 3 entries
# Clean up.
Then Clean up pipeline "pipeline_edit_test" which is created for testing
When Open Source Control Management Page
Then Delete the repo config
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import io.cucumber.java.en.When;
import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebElement;

/**
Expand Down Expand Up @@ -99,7 +100,16 @@ public void verifySavedRepoConfig() {

@Then("Delete the repo config")
public void deleteTheRepoConfig() {
ElementHelper.clickOnElement(Helper.locateElementByTestId("actions-popover"));
// This first step tries to find and open the action popover for the repository
// config (the only row in the table). If this step fails with a NoSuchElementException,
// then it means that the repo config is not present in the page.
// In this case, we can skip the rest of the steps, as we do not have a repo config to delete.
try {
ElementHelper.clickOnElement(Helper.locateElementByTestId("actions-popover"));
} catch (NoSuchElementException e) {
return;
}

ElementHelper.clickOnElement(Helper.locateElementByTestId("Delete-on-popover"));
ElementHelper.clickOnElement(Helper.locateElementByTestId("Delete"));
}
Expand Down

0 comments on commit f57e0de

Please sign in to comment.